From 90317e8fa3d006838868a8743e5ea39d818552cb Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Fri, 6 Mar 2026 10:55:10 +0000 Subject: [PATCH] Generate iaas --- services/iaas/api_default.go | 1558 +- services/iaas/client.go | 7 + services/iaas/configuration.go | 2 + services/iaas/go.mod | 4 +- services/iaas/go.sum | 8 +- ...del_add_routes_to_routing_table_payload.go | 24 + ...model_add_routing_table_to_area_payload.go | 111 +- .../model_add_volume_to_server_payload.go | 44 + services/iaas/model_affinity_group.go | 53 + .../model_affinity_group_list_response.go | 24 + .../iaas/model_allowed_addresses_inner.go | 14 + services/iaas/model_area_id.go | 15 + .../model_availability_zone_list_response.go | 24 + services/iaas/model_backup.go | 130 +- services/iaas/model_backup_list_response.go | 24 + services/iaas/model_backup_source.go | 32 + .../iaas/model_base_security_group_rule.go | 127 + services/iaas/model_boot_volume.go | 66 + services/iaas/model_boot_volume_source.go | 32 + .../model_create_affinity_group_payload.go | 53 + services/iaas/model_create_backup_payload.go | 47 +- services/iaas/model_create_image_payload.go | 195 +- .../model_create_isolated_network_payload.go | 58 +- .../iaas/model_create_key_pair_payload.go | 78 +- .../iaas/model_create_network_area_payload.go | 36 +- ...model_create_network_area_range_payload.go | 24 + ...odel_create_network_area_region_payload.go | 34 + ...model_create_network_area_route_payload.go | 24 + services/iaas/model_create_network_ipv4.go | 15 + .../model_create_network_ipv4_with_prefix.go | 46 + ..._create_network_ipv4_with_prefix_length.go | 35 + services/iaas/model_create_network_ipv6.go | 15 + .../model_create_network_ipv6_with_prefix.go | 46 + ..._create_network_ipv6_with_prefix_length.go | 35 + services/iaas/model_create_network_payload.go | 90 +- services/iaas/model_create_nic_payload.go | 159 +- services/iaas/model_create_protocol.go | 15 + .../iaas/model_create_public_ip_payload.go | 58 +- .../model_create_security_group_payload.go | 100 +- ...odel_create_security_group_rule_payload.go | 138 + ...del_create_security_group_rule_protocol.go | 24 + .../iaas/model_create_server_networking.go | 23 + ...odel_create_server_networking_with_nics.go | 24 + services/iaas/model_create_server_payload.go | 267 +- .../model_create_server_payload_all_of.go | 24 + ...create_server_payload_all_of_networking.go | 15 + .../iaas/model_create_snapshot_payload.go | 99 +- services/iaas/model_create_volume_payload.go | 184 +- services/iaas/model_destination_cidrv4.go | 32 + services/iaas/model_destination_cidrv6.go | 32 + services/iaas/model_error.go | 33 + .../iaas/model_get_server_log_200_response.go | 23 + services/iaas/model_icmp_parameters.go | 34 + services/iaas/model_image.go | 195 +- services/iaas/model_image_agent.go | 35 + services/iaas/model_image_checksum.go | 32 + services/iaas/model_image_config.go | 173 + services/iaas/model_image_create_response.go | 32 + .../iaas/model_image_from_volume_payload.go | 67 +- services/iaas/model_image_list_response.go | 24 + services/iaas/model_image_share.go | 35 + services/iaas/model_image_share_consumer.go | 55 + services/iaas/model_key_pair_list_response.go | 24 + services/iaas/model_keypair.go | 78 +- services/iaas/model_machine_type.go | 74 + .../iaas/model_machine_type_list_response.go | 24 + services/iaas/model_network.go | 130 +- services/iaas/model_network_area.go | 79 +- .../iaas/model_network_area_list_response.go | 24 + services/iaas/model_network_ipv4.go | 57 + services/iaas/model_network_ipv6.go | 47 + services/iaas/model_network_list_response.go | 24 + services/iaas/model_network_range.go | 55 + .../iaas/model_network_range_list_response.go | 24 + services/iaas/model_nexthop_blackhole.go | 23 + services/iaas/model_nexthop_internet.go | 23 + services/iaas/model_nexthop_ipv4.go | 32 + services/iaas/model_nexthop_ipv6.go | 32 + services/iaas/model_nic.go | 159 +- services/iaas/model_nic_list_response.go | 24 + ...del_partial_update_network_area_payload.go | 36 +- .../model_partial_update_network_payload.go | 90 +- services/iaas/model_port_range.go | 34 + services/iaas/model_project.go | 75 + services/iaas/model_project_list_response.go | 24 + services/iaas/model_protocol.go | 34 + services/iaas/model_public_ip.go | 58 +- .../iaas/model_public_ip_list_response.go | 24 + services/iaas/model_public_network.go | 32 + .../model_public_network_list_response.go | 24 + services/iaas/model_quota.go | 34 + services/iaas/model_quota_list.go | 134 + .../iaas/model_quota_list_backup_gigabytes.go | 34 + services/iaas/model_quota_list_backups.go | 34 + services/iaas/model_quota_list_gigabytes.go | 34 + services/iaas/model_quota_list_networks.go | 34 + services/iaas/model_quota_list_nics.go | 34 + services/iaas/model_quota_list_public_ips.go | 34 + services/iaas/model_quota_list_ram.go | 34 + services/iaas/model_quota_list_response.go | 24 + .../model_quota_list_security_group_rules.go | 34 + .../iaas/model_quota_list_security_groups.go | 34 + services/iaas/model_quota_list_snapshots.go | 34 + services/iaas/model_quota_list_vcpu.go | 34 + services/iaas/model_quota_list_volumes.go | 34 + services/iaas/model_regional_area.go | 34 + services/iaas/model_regional_area_ipv4.go | 74 + .../iaas/model_regional_area_list_response.go | 24 + services/iaas/model_request.go | 70 + services/iaas/model_request_resource.go | 41 + services/iaas/model_rescue_server_payload.go | 23 + services/iaas/model_resize_server_payload.go | 23 + services/iaas/model_resize_volume_payload.go | 24 + services/iaas/model_route.go | 79 +- services/iaas/model_route_destination.go | 15 + services/iaas/model_route_list_response.go | 24 + services/iaas/model_route_nexthop.go | 17 + services/iaas/model_routing_table.go | 111 +- .../iaas/model_routing_table_list_response.go | 24 + services/iaas/model_security_group.go | 100 +- .../model_security_group_list_response.go | 24 + services/iaas/model_security_group_rule.go | 138 + ...model_security_group_rule_list_response.go | 24 + .../model_security_group_rule_protocol.go | 24 + services/iaas/model_server.go | 268 +- services/iaas/model_server_agent.go | 24 + services/iaas/model_server_boot_volume.go | 66 + services/iaas/model_server_console_url.go | 23 + services/iaas/model_server_list_response.go | 24 + services/iaas/model_server_maintenance.go | 53 + services/iaas/model_server_network.go | 112 + services/iaas/model_server_networking.go | 15 + ...odel_service_account_mail_list_response.go | 24 + .../iaas/model_set_image_share_payload.go | 35 + services/iaas/model_snapshot.go | 99 +- services/iaas/model_snapshot_list_response.go | 24 + services/iaas/model_static_area_id.go | 19 +- .../model_update_attached_volume_payload.go | 44 + services/iaas/model_update_backup_payload.go | 130 +- services/iaas/model_update_image_payload.go | 101 +- .../iaas/model_update_image_share_payload.go | 35 + .../iaas/model_update_key_pair_payload.go | 26 +- ...odel_update_network_area_region_payload.go | 24 + ...model_update_network_area_route_payload.go | 26 +- .../iaas/model_update_network_ipv4_body.go | 36 + .../iaas/model_update_network_ipv6_body.go | 36 + services/iaas/model_update_nic_payload.go | 79 +- .../iaas/model_update_public_ip_payload.go | 58 +- .../iaas/model_update_regional_area_ipv4.go | 57 + ...l_update_route_of_routing_table_payload.go | 26 +- ...el_update_routing_table_of_area_payload.go | 68 +- .../model_update_security_group_payload.go | 46 +- services/iaas/model_update_server_payload.go | 47 +- .../iaas/model_update_snapshot_payload.go | 36 +- services/iaas/model_update_volume_payload.go | 68 +- services/iaas/model_volume.go | 184 +- services/iaas/model_volume_attachment.go | 44 + .../model_volume_attachment_list_response.go | 24 + .../iaas/model_volume_encryption_parameter.go | 72 + services/iaas/model_volume_list_response.go | 24 + .../iaas/model_volume_performance_class.go | 68 +- ..._volume_performance_class_list_response.go | 24 + services/iaas/model_volume_source.go | 32 + services/iaas/oas_commit | 2 +- services/iaas/utils.go | 81 + services/iaas/v1api/api_default.go | 26151 ++++++++++++++ services/iaas/v1api/api_default_mock.go | 2640 ++ services/iaas/v1api/client.go | 659 + services/iaas/v1api/configuration.go | 41 + .../model_add_volume_to_server_payload.go | 200 + services/iaas/v1api/model_affinity_group.go | 261 + .../model_affinity_group_list_response.go | 158 + .../v1api/model_allowed_addresses_inner.go | 126 + services/iaas/v1api/model_area.go | 237 + services/iaas/v1api/model_area_config.go | 260 + services/iaas/v1api/model_area_id.go | 160 + .../v1api/model_area_prefix_config_ipv4.go | 212 + .../model_availability_zone_list_response.go | 158 + services/iaas/v1api/model_backup.go | 497 + .../iaas/v1api/model_backup_list_response.go | 158 + services/iaas/v1api/model_backup_source.go | 187 + .../v1api/model_base_security_group_rule.go | 531 + services/iaas/v1api/model_boot_volume.go | 273 + .../iaas/v1api/model_boot_volume_source.go | 187 + .../model_create_affinity_group_payload.go | 261 + .../v1api/model_create_area_address_family.go | 125 + services/iaas/v1api/model_create_area_ipv4.go | 383 + .../iaas/v1api/model_create_backup_payload.go | 231 + .../iaas/v1api/model_create_image_payload.go | 740 + .../v1api/model_create_key_pair_payload.go | 344 + .../model_create_network_address_family.go | 161 + .../model_create_network_area_payload.go | 223 + ...model_create_network_area_range_payload.go | 126 + ...model_create_network_area_route_payload.go | 126 + .../v1api/model_create_network_ipv4_body.go | 247 + .../v1api/model_create_network_ipv6_body.go | 247 + .../v1api/model_create_network_payload.go | 309 + .../iaas/v1api/model_create_nic_payload.go | 611 + services/iaas/v1api/model_create_protocol.go | 160 + .../v1api/model_create_public_ip_payload.go | 248 + .../model_create_security_group_payload.go | 422 + ...odel_create_security_group_rule_payload.go | 567 + ...del_create_security_group_rule_protocol.go | 125 + .../v1api/model_create_server_networking.go | 126 + ...odel_create_server_networking_with_nics.go | 126 + .../iaas/v1api/model_create_server_payload.go | 998 + .../model_create_server_payload_networking.go | 160 + .../v1api/model_create_snapshot_payload.go | 418 + .../iaas/v1api/model_create_volume_payload.go | 711 + services/iaas/v1api/model_error.go | 186 + .../model_get_server_log_200_response.go | 125 + services/iaas/v1api/model_icmp_parameters.go | 187 + services/iaas/v1api/model_image.go | 740 + services/iaas/v1api/model_image_agent.go | 163 + services/iaas/v1api/model_image_checksum.go | 187 + services/iaas/v1api/model_image_config.go | 695 + .../iaas/v1api/model_image_create_response.go | 186 + .../iaas/v1api/model_image_list_response.go | 158 + services/iaas/v1api/model_image_share.go | 163 + .../iaas/v1api/model_image_share_consumer.go | 238 + .../v1api/model_key_pair_list_response.go | 158 + services/iaas/v1api/model_keypair.go | 344 + services/iaas/v1api/model_machine_type.go | 319 + .../v1api/model_machine_type_list_response.go | 158 + services/iaas/v1api/model_network.go | 680 + services/iaas/v1api/model_network_area.go | 392 + .../iaas/v1api/model_network_area_ipv4.go | 360 + .../v1api/model_network_area_list_response.go | 158 + .../iaas/v1api/model_network_list_response.go | 158 + services/iaas/v1api/model_network_range.go | 270 + .../model_network_range_list_response.go | 158 + services/iaas/v1api/model_nic.go | 611 + .../iaas/v1api/model_nic_list_response.go | 158 + ...del_partial_update_network_area_payload.go | 199 + .../model_partial_update_network_payload.go | 273 + services/iaas/v1api/model_port_range.go | 187 + services/iaas/v1api/model_project.go | 363 + .../iaas/v1api/model_project_list_response.go | 158 + services/iaas/v1api/model_protocol.go | 163 + services/iaas/v1api/model_public_ip.go | 248 + .../v1api/model_public_ip_list_response.go | 158 + services/iaas/v1api/model_public_network.go | 158 + .../model_public_network_list_response.go | 158 + services/iaas/v1api/model_quota.go | 185 + services/iaas/v1api/model_quota_list.go | 477 + .../iaas/v1api/model_quota_list_response.go | 157 + services/iaas/v1api/model_request.go | 309 + services/iaas/v1api/model_request_resource.go | 216 + .../iaas/v1api/model_rescue_server_payload.go | 158 + .../iaas/v1api/model_resize_server_payload.go | 158 + .../iaas/v1api/model_resize_volume_payload.go | 158 + services/iaas/v1api/model_route.go | 336 + .../iaas/v1api/model_route_list_response.go | 158 + services/iaas/v1api/model_security_group.go | 422 + .../model_security_group_list_response.go | 158 + .../iaas/v1api/model_security_group_rule.go | 567 + ...model_security_group_rule_list_response.go | 158 + .../model_security_group_rule_protocol.go | 125 + services/iaas/v1api/model_server.go | 998 + services/iaas/v1api/model_server_agent.go | 126 + .../iaas/v1api/model_server_console_url.go | 157 + .../iaas/v1api/model_server_list_response.go | 158 + .../iaas/v1api/model_server_maintenance.go | 253 + services/iaas/v1api/model_server_network.go | 459 + .../iaas/v1api/model_server_networking.go | 160 + ...odel_service_account_mail_list_response.go | 158 + .../v1api/model_set_image_share_payload.go | 163 + services/iaas/v1api/model_snapshot.go | 418 + .../v1api/model_snapshot_list_response.go | 158 + services/iaas/v1api/model_static_area_id.go | 111 + .../v1api/model_update_area_address_family.go | 125 + services/iaas/v1api/model_update_area_ipv4.go | 236 + .../model_update_attached_volume_payload.go | 200 + .../iaas/v1api/model_update_backup_payload.go | 497 + .../iaas/v1api/model_update_image_payload.go | 383 + .../v1api/model_update_image_share_payload.go | 163 + .../v1api/model_update_key_pair_payload.go | 126 + .../model_update_network_address_family.go | 161 + ...model_update_network_area_route_payload.go | 126 + .../v1api/model_update_network_ipv4_body.go | 174 + .../v1api/model_update_network_ipv6_body.go | 174 + .../iaas/v1api/model_update_nic_payload.go | 311 + .../v1api/model_update_public_ip_payload.go | 248 + .../model_update_security_group_payload.go | 200 + .../iaas/v1api/model_update_server_payload.go | 200 + .../v1api/model_update_snapshot_payload.go | 163 + .../iaas/v1api/model_update_volume_payload.go | 273 + services/iaas/v1api/model_volume.go | 711 + .../iaas/v1api/model_volume_attachment.go | 200 + .../model_volume_attachment_list_response.go | 158 + .../model_volume_encryption_parameter.go | 319 + .../iaas/v1api/model_volume_list_response.go | 158 + .../v1api/model_volume_performance_class.go | 306 + ..._volume_performance_class_list_response.go | 158 + services/iaas/v1api/model_volume_source.go | 187 + services/iaas/v1api/response.go | 48 + services/iaas/v1api/utils.go | 362 + services/iaas/v2alpha1api/api_default.go | 3609 ++ services/iaas/v2alpha1api/api_default_mock.go | 382 + services/iaas/v2alpha1api/client.go | 659 + services/iaas/v2alpha1api/configuration.go | 38 + ...del_add_routes_to_routing_table_payload.go | 158 + ...model_add_routing_table_to_area_payload.go | 463 + .../v2alpha1api/model_create_network_ipv4.go | 160 + .../model_create_network_ipv4_with_prefix.go | 243 + ..._create_network_ipv4_with_prefix_length.go | 194 + .../v2alpha1api/model_create_network_ipv6.go | 160 + .../model_create_network_ipv6_with_prefix.go | 243 + ..._create_network_ipv6_with_prefix_length.go | 194 + .../model_create_network_payload.go | 382 + .../v2alpha1api/model_destination_cidrv4.go | 186 + .../v2alpha1api/model_destination_cidrv6.go | 186 + services/iaas/v2alpha1api/model_error.go | 186 + services/iaas/v2alpha1api/model_network.go | 510 + .../iaas/v2alpha1api/model_network_ipv4.go | 279 + .../iaas/v2alpha1api/model_network_ipv6.go | 242 + .../model_network_list_response.go | 158 + .../v2alpha1api/model_nexthop_blackhole.go | 157 + .../v2alpha1api/model_nexthop_internet.go | 157 + .../iaas/v2alpha1api/model_nexthop_ipv4.go | 186 + .../iaas/v2alpha1api/model_nexthop_ipv6.go | 186 + .../model_partial_update_network_payload.go | 346 + services/iaas/v2alpha1api/model_route.go | 334 + .../v2alpha1api/model_route_destination.go | 154 + .../v2alpha1api/model_route_list_response.go | 158 + .../iaas/v2alpha1api/model_route_nexthop.go | 218 + .../iaas/v2alpha1api/model_routing_table.go | 463 + .../model_routing_table_list_response.go | 158 + .../model_update_network_ipv4_body.go | 174 + .../model_update_network_ipv6_body.go | 174 + ...l_update_route_of_routing_table_payload.go | 126 + ...el_update_routing_table_of_area_payload.go | 274 + services/iaas/v2alpha1api/response.go | 48 + services/iaas/v2alpha1api/utils.go | 362 + services/iaas/v2api/api_default.go | 29300 ++++++++++++++++ services/iaas/v2api/api_default_mock.go | 2962 ++ services/iaas/v2api/client.go | 659 + services/iaas/v2api/configuration.go | 38 + ...del_add_routes_to_routing_table_payload.go | 158 + ...model_add_routing_table_to_area_payload.go | 463 + .../model_add_volume_to_server_payload.go | 200 + services/iaas/v2api/model_affinity_group.go | 261 + .../model_affinity_group_list_response.go | 158 + .../v2api/model_allowed_addresses_inner.go | 126 + services/iaas/v2api/model_area_id.go | 160 + .../model_availability_zone_list_response.go | 158 + services/iaas/v2api/model_backup.go | 497 + .../iaas/v2api/model_backup_list_response.go | 158 + services/iaas/v2api/model_backup_source.go | 187 + .../v2api/model_base_security_group_rule.go | 531 + services/iaas/v2api/model_boot_volume.go | 273 + .../iaas/v2api/model_boot_volume_source.go | 187 + .../model_create_affinity_group_payload.go | 261 + .../iaas/v2api/model_create_backup_payload.go | 231 + .../iaas/v2api/model_create_image_payload.go | 740 + .../model_create_isolated_network_payload.go | 272 + .../v2api/model_create_key_pair_payload.go | 344 + .../model_create_network_area_payload.go | 194 + ...model_create_network_area_range_payload.go | 126 + ...odel_create_network_area_region_payload.go | 162 + ...model_create_network_area_route_payload.go | 158 + .../iaas/v2api/model_create_network_ipv4.go | 160 + .../model_create_network_ipv4_with_prefix.go | 243 + ..._create_network_ipv4_with_prefix_length.go | 194 + .../iaas/v2api/model_create_network_ipv6.go | 160 + .../model_create_network_ipv6_with_prefix.go | 243 + ..._create_network_ipv6_with_prefix_length.go | 194 + .../v2api/model_create_network_payload.go | 382 + .../iaas/v2api/model_create_nic_payload.go | 611 + services/iaas/v2api/model_create_protocol.go | 160 + .../v2api/model_create_public_ip_payload.go | 248 + .../model_create_security_group_payload.go | 422 + ...odel_create_security_group_rule_payload.go | 567 + ...del_create_security_group_rule_protocol.go | 125 + .../v2api/model_create_server_networking.go | 126 + ...odel_create_server_networking_with_nics.go | 126 + .../iaas/v2api/model_create_server_payload.go | 990 + ...create_server_payload_all_of_networking.go | 160 + .../v2api/model_create_snapshot_payload.go | 418 + .../iaas/v2api/model_create_volume_payload.go | 711 + .../iaas/v2api/model_destination_cidrv4.go | 186 + .../iaas/v2api/model_destination_cidrv6.go | 186 + services/iaas/v2api/model_error.go | 186 + .../model_get_server_log_200_response.go | 125 + services/iaas/v2api/model_icmp_parameters.go | 187 + services/iaas/v2api/model_image.go | 740 + services/iaas/v2api/model_image_agent.go | 163 + services/iaas/v2api/model_image_checksum.go | 187 + services/iaas/v2api/model_image_config.go | 695 + .../iaas/v2api/model_image_create_response.go | 186 + .../v2api/model_image_from_volume_payload.go | 228 + .../iaas/v2api/model_image_list_response.go | 158 + services/iaas/v2api/model_image_share.go | 163 + .../iaas/v2api/model_image_share_consumer.go | 238 + .../v2api/model_key_pair_list_response.go | 158 + services/iaas/v2api/model_keypair.go | 344 + services/iaas/v2api/model_machine_type.go | 319 + .../v2api/model_machine_type_list_response.go | 158 + services/iaas/v2api/model_network.go | 510 + services/iaas/v2api/model_network_area.go | 343 + .../v2api/model_network_area_list_response.go | 158 + services/iaas/v2api/model_network_ipv4.go | 279 + services/iaas/v2api/model_network_ipv6.go | 242 + .../iaas/v2api/model_network_list_response.go | 158 + services/iaas/v2api/model_network_range.go | 270 + .../model_network_range_list_response.go | 158 + .../iaas/v2api/model_nexthop_blackhole.go | 157 + services/iaas/v2api/model_nexthop_internet.go | 157 + services/iaas/v2api/model_nexthop_ipv4.go | 186 + services/iaas/v2api/model_nexthop_ipv6.go | 186 + services/iaas/v2api/model_nic.go | 611 + .../iaas/v2api/model_nic_list_response.go | 158 + ...del_partial_update_network_area_payload.go | 162 + .../model_partial_update_network_payload.go | 346 + services/iaas/v2api/model_port_range.go | 187 + services/iaas/v2api/model_project.go | 326 + .../iaas/v2api/model_project_list_response.go | 158 + services/iaas/v2api/model_protocol.go | 163 + services/iaas/v2api/model_public_ip.go | 248 + .../v2api/model_public_ip_list_response.go | 158 + services/iaas/v2api/model_public_network.go | 187 + .../model_public_network_list_response.go | 158 + services/iaas/v2api/model_quota.go | 185 + services/iaas/v2api/model_quota_list.go | 477 + .../iaas/v2api/model_quota_list_response.go | 157 + services/iaas/v2api/model_regional_area.go | 162 + .../iaas/v2api/model_regional_area_ipv4.go | 316 + .../model_regional_area_list_response.go | 157 + services/iaas/v2api/model_request.go | 309 + services/iaas/v2api/model_request_resource.go | 216 + .../iaas/v2api/model_rescue_server_payload.go | 158 + .../iaas/v2api/model_resize_server_payload.go | 158 + .../iaas/v2api/model_resize_volume_payload.go | 158 + services/iaas/v2api/model_route.go | 334 + .../iaas/v2api/model_route_destination.go | 154 + .../iaas/v2api/model_route_list_response.go | 158 + services/iaas/v2api/model_route_nexthop.go | 218 + services/iaas/v2api/model_routing_table.go | 463 + .../model_routing_table_list_response.go | 158 + services/iaas/v2api/model_security_group.go | 422 + .../model_security_group_list_response.go | 158 + .../iaas/v2api/model_security_group_rule.go | 567 + ...model_security_group_rule_list_response.go | 158 + .../model_security_group_rule_protocol.go | 125 + services/iaas/v2api/model_server.go | 998 + services/iaas/v2api/model_server_agent.go | 126 + .../iaas/v2api/model_server_console_url.go | 157 + .../iaas/v2api/model_server_list_response.go | 158 + .../iaas/v2api/model_server_maintenance.go | 253 + services/iaas/v2api/model_server_network.go | 459 + .../iaas/v2api/model_server_networking.go | 160 + ...odel_service_account_mail_list_response.go | 158 + .../v2api/model_set_image_share_payload.go | 163 + services/iaas/v2api/model_snapshot.go | 418 + .../v2api/model_snapshot_list_response.go | 158 + services/iaas/v2api/model_static_area_id.go | 111 + .../model_update_attached_volume_payload.go | 200 + .../iaas/v2api/model_update_backup_payload.go | 497 + .../iaas/v2api/model_update_image_payload.go | 383 + .../v2api/model_update_image_share_payload.go | 163 + .../v2api/model_update_key_pair_payload.go | 126 + ...odel_update_network_area_region_payload.go | 125 + ...model_update_network_area_route_payload.go | 126 + .../v2api/model_update_network_ipv4_body.go | 174 + .../v2api/model_update_network_ipv6_body.go | 174 + .../iaas/v2api/model_update_nic_payload.go | 311 + .../v2api/model_update_public_ip_payload.go | 248 + .../v2api/model_update_regional_area_ipv4.go | 236 + ...l_update_route_of_routing_table_payload.go | 126 + ...el_update_routing_table_of_area_payload.go | 274 + .../model_update_security_group_payload.go | 200 + .../iaas/v2api/model_update_server_payload.go | 200 + .../v2api/model_update_snapshot_payload.go | 163 + .../iaas/v2api/model_update_volume_payload.go | 273 + services/iaas/v2api/model_volume.go | 711 + .../iaas/v2api/model_volume_attachment.go | 200 + .../model_volume_attachment_list_response.go | 158 + .../model_volume_encryption_parameter.go | 319 + .../iaas/v2api/model_volume_list_response.go | 158 + .../v2api/model_volume_performance_class.go | 306 + ..._volume_performance_class_list_response.go | 158 + services/iaas/v2api/model_volume_source.go | 187 + services/iaas/v2api/response.go | 48 + services/iaas/v2api/utils.go | 362 + services/iaas/v2beta1api/api_default.go | 29068 +++++++++++++++ services/iaas/v2beta1api/api_default_mock.go | 2940 ++ services/iaas/v2beta1api/client.go | 659 + services/iaas/v2beta1api/configuration.go | 38 + ...del_add_routes_to_routing_table_payload.go | 158 + ...model_add_routing_table_to_area_payload.go | 463 + .../model_add_volume_to_server_payload.go | 200 + .../iaas/v2beta1api/model_affinity_group.go | 261 + .../model_affinity_group_list_response.go | 158 + .../model_allowed_addresses_inner.go | 126 + services/iaas/v2beta1api/model_area_id.go | 160 + .../model_availability_zone_list_response.go | 158 + services/iaas/v2beta1api/model_backup.go | 497 + .../v2beta1api/model_backup_list_response.go | 158 + .../iaas/v2beta1api/model_backup_source.go | 187 + .../model_base_security_group_rule.go | 531 + services/iaas/v2beta1api/model_boot_volume.go | 273 + .../v2beta1api/model_boot_volume_source.go | 187 + .../model_create_affinity_group_payload.go | 261 + .../v2beta1api/model_create_backup_payload.go | 231 + .../v2beta1api/model_create_image_payload.go | 740 + .../model_create_isolated_network_payload.go | 272 + .../model_create_key_pair_payload.go | 344 + .../model_create_network_area_payload.go | 194 + ...model_create_network_area_range_payload.go | 126 + ...model_create_network_area_route_payload.go | 158 + .../v2beta1api/model_create_network_ipv4.go | 160 + .../model_create_network_ipv4_with_prefix.go | 243 + ..._create_network_ipv4_with_prefix_length.go | 194 + .../v2beta1api/model_create_network_ipv6.go | 160 + .../model_create_network_ipv6_with_prefix.go | 243 + ..._create_network_ipv6_with_prefix_length.go | 194 + .../model_create_network_payload.go | 382 + .../v2beta1api/model_create_nic_payload.go | 611 + .../iaas/v2beta1api/model_create_protocol.go | 160 + .../model_create_public_ip_payload.go | 248 + .../model_create_security_group_payload.go | 422 + ...odel_create_security_group_rule_payload.go | 567 + ...del_create_security_group_rule_protocol.go | 125 + .../model_create_server_networking.go | 126 + ...odel_create_server_networking_with_nics.go | 126 + .../v2beta1api/model_create_server_payload.go | 990 + ...create_server_payload_all_of_networking.go | 160 + .../v2beta1api/model_create_volume_payload.go | 711 + .../v2beta1api/model_destination_cidrv4.go | 186 + .../v2beta1api/model_destination_cidrv6.go | 186 + services/iaas/v2beta1api/model_error.go | 186 + .../model_get_server_log_200_response.go | 125 + .../iaas/v2beta1api/model_icmp_parameters.go | 187 + services/iaas/v2beta1api/model_image.go | 740 + services/iaas/v2beta1api/model_image_agent.go | 163 + .../iaas/v2beta1api/model_image_checksum.go | 187 + .../iaas/v2beta1api/model_image_config.go | 695 + .../v2beta1api/model_image_create_response.go | 186 + .../v2beta1api/model_image_list_response.go | 158 + services/iaas/v2beta1api/model_image_share.go | 163 + .../v2beta1api/model_image_share_consumer.go | 238 + .../model_key_pair_list_response.go | 158 + services/iaas/v2beta1api/model_keypair.go | 344 + .../iaas/v2beta1api/model_machine_type.go | 319 + .../model_machine_type_list_response.go | 158 + services/iaas/v2beta1api/model_network.go | 510 + .../iaas/v2beta1api/model_network_area.go | 343 + .../model_network_area_list_response.go | 158 + .../iaas/v2beta1api/model_network_ipv4.go | 279 + .../iaas/v2beta1api/model_network_ipv6.go | 242 + .../v2beta1api/model_network_list_response.go | 158 + .../iaas/v2beta1api/model_network_range.go | 270 + .../model_network_range_list_response.go | 158 + .../v2beta1api/model_nexthop_blackhole.go | 157 + .../iaas/v2beta1api/model_nexthop_internet.go | 157 + .../iaas/v2beta1api/model_nexthop_ipv4.go | 186 + .../iaas/v2beta1api/model_nexthop_ipv6.go | 186 + services/iaas/v2beta1api/model_nic.go | 611 + .../v2beta1api/model_nic_list_response.go | 158 + ...del_partial_update_network_area_payload.go | 162 + .../model_partial_update_network_payload.go | 346 + services/iaas/v2beta1api/model_port_range.go | 187 + services/iaas/v2beta1api/model_project.go | 326 + .../v2beta1api/model_project_list_response.go | 158 + services/iaas/v2beta1api/model_protocol.go | 163 + services/iaas/v2beta1api/model_public_ip.go | 248 + .../model_public_ip_list_response.go | 158 + .../iaas/v2beta1api/model_public_network.go | 187 + .../model_public_network_list_response.go | 158 + services/iaas/v2beta1api/model_quota.go | 185 + services/iaas/v2beta1api/model_quota_list.go | 477 + .../v2beta1api/model_quota_list_response.go | 157 + .../iaas/v2beta1api/model_regional_area.go | 162 + .../v2beta1api/model_regional_area_ipv4.go | 316 + .../model_regional_area_list_response.go | 157 + services/iaas/v2beta1api/model_request.go | 309 + .../iaas/v2beta1api/model_request_resource.go | 216 + .../v2beta1api/model_rescue_server_payload.go | 158 + .../v2beta1api/model_resize_server_payload.go | 158 + .../v2beta1api/model_resize_volume_payload.go | 158 + services/iaas/v2beta1api/model_route.go | 334 + .../v2beta1api/model_route_destination.go | 154 + .../v2beta1api/model_route_list_response.go | 158 + .../iaas/v2beta1api/model_route_nexthop.go | 218 + .../iaas/v2beta1api/model_routing_table.go | 463 + .../model_routing_table_list_response.go | 158 + .../iaas/v2beta1api/model_security_group.go | 422 + .../model_security_group_list_response.go | 158 + .../v2beta1api/model_security_group_rule.go | 567 + ...model_security_group_rule_list_response.go | 158 + .../model_security_group_rule_protocol.go | 125 + services/iaas/v2beta1api/model_server.go | 998 + .../iaas/v2beta1api/model_server_agent.go | 126 + .../v2beta1api/model_server_console_url.go | 157 + .../v2beta1api/model_server_list_response.go | 158 + .../v2beta1api/model_server_maintenance.go | 253 + .../iaas/v2beta1api/model_server_network.go | 459 + .../v2beta1api/model_server_networking.go | 160 + ...odel_service_account_mail_list_response.go | 158 + .../model_set_image_share_payload.go | 163 + services/iaas/v2beta1api/model_snapshot.go | 418 + .../model_snapshot_list_response.go | 158 + .../iaas/v2beta1api/model_static_area_id.go | 111 + .../model_update_attached_volume_payload.go | 200 + .../v2beta1api/model_update_image_payload.go | 383 + .../model_update_image_share_payload.go | 163 + .../model_update_key_pair_payload.go | 126 + .../model_update_network_ipv4_body.go | 174 + .../model_update_network_ipv6_body.go | 174 + .../v2beta1api/model_update_nic_payload.go | 311 + .../model_update_public_ip_payload.go | 248 + .../model_update_regional_area_ipv4.go | 236 + ...l_update_route_of_routing_table_payload.go | 126 + ...el_update_routing_table_of_area_payload.go | 274 + .../v2beta1api/model_update_server_payload.go | 200 + .../v2beta1api/model_update_volume_payload.go | 273 + ...1_configure_network_area_region_payload.go | 162 + .../model_v2beta1_create_snapshot_payload.go | 418 + .../model_v2beta1_update_backup_payload.go | 497 + ...eta1_update_network_area_region_payload.go | 125 + ...el_v2beta1_update_route_of_area_payload.go | 126 + ...l_v2beta1_update_security_group_payload.go | 200 + .../model_v2beta1_update_snapshot_payload.go | 163 + services/iaas/v2beta1api/model_volume.go | 711 + .../v2beta1api/model_volume_attachment.go | 200 + .../model_volume_attachment_list_response.go | 158 + .../model_volume_encryption_parameter.go | 319 + .../v2beta1api/model_volume_list_response.go | 158 + .../model_volume_performance_class.go | 306 + ..._volume_performance_class_list_response.go | 158 + .../iaas/v2beta1api/model_volume_source.go | 187 + services/iaas/v2beta1api/response.go | 48 + services/iaas/v2beta1api/utils.go | 362 + services/iaas/wait/deprecation.go | 2 + 634 files changed, 227042 insertions(+), 264 deletions(-) create mode 100644 services/iaas/v1api/api_default.go create mode 100644 services/iaas/v1api/api_default_mock.go create mode 100644 services/iaas/v1api/client.go create mode 100644 services/iaas/v1api/configuration.go create mode 100644 services/iaas/v1api/model_add_volume_to_server_payload.go create mode 100644 services/iaas/v1api/model_affinity_group.go create mode 100644 services/iaas/v1api/model_affinity_group_list_response.go create mode 100644 services/iaas/v1api/model_allowed_addresses_inner.go create mode 100644 services/iaas/v1api/model_area.go create mode 100644 services/iaas/v1api/model_area_config.go create mode 100644 services/iaas/v1api/model_area_id.go create mode 100644 services/iaas/v1api/model_area_prefix_config_ipv4.go create mode 100644 services/iaas/v1api/model_availability_zone_list_response.go create mode 100644 services/iaas/v1api/model_backup.go create mode 100644 services/iaas/v1api/model_backup_list_response.go create mode 100644 services/iaas/v1api/model_backup_source.go create mode 100644 services/iaas/v1api/model_base_security_group_rule.go create mode 100644 services/iaas/v1api/model_boot_volume.go create mode 100644 services/iaas/v1api/model_boot_volume_source.go create mode 100644 services/iaas/v1api/model_create_affinity_group_payload.go create mode 100644 services/iaas/v1api/model_create_area_address_family.go create mode 100644 services/iaas/v1api/model_create_area_ipv4.go create mode 100644 services/iaas/v1api/model_create_backup_payload.go create mode 100644 services/iaas/v1api/model_create_image_payload.go create mode 100644 services/iaas/v1api/model_create_key_pair_payload.go create mode 100644 services/iaas/v1api/model_create_network_address_family.go create mode 100644 services/iaas/v1api/model_create_network_area_payload.go create mode 100644 services/iaas/v1api/model_create_network_area_range_payload.go create mode 100644 services/iaas/v1api/model_create_network_area_route_payload.go create mode 100644 services/iaas/v1api/model_create_network_ipv4_body.go create mode 100644 services/iaas/v1api/model_create_network_ipv6_body.go create mode 100644 services/iaas/v1api/model_create_network_payload.go create mode 100644 services/iaas/v1api/model_create_nic_payload.go create mode 100644 services/iaas/v1api/model_create_protocol.go create mode 100644 services/iaas/v1api/model_create_public_ip_payload.go create mode 100644 services/iaas/v1api/model_create_security_group_payload.go create mode 100644 services/iaas/v1api/model_create_security_group_rule_payload.go create mode 100644 services/iaas/v1api/model_create_security_group_rule_protocol.go create mode 100644 services/iaas/v1api/model_create_server_networking.go create mode 100644 services/iaas/v1api/model_create_server_networking_with_nics.go create mode 100644 services/iaas/v1api/model_create_server_payload.go create mode 100644 services/iaas/v1api/model_create_server_payload_networking.go create mode 100644 services/iaas/v1api/model_create_snapshot_payload.go create mode 100644 services/iaas/v1api/model_create_volume_payload.go create mode 100644 services/iaas/v1api/model_error.go create mode 100644 services/iaas/v1api/model_get_server_log_200_response.go create mode 100644 services/iaas/v1api/model_icmp_parameters.go create mode 100644 services/iaas/v1api/model_image.go create mode 100644 services/iaas/v1api/model_image_agent.go create mode 100644 services/iaas/v1api/model_image_checksum.go create mode 100644 services/iaas/v1api/model_image_config.go create mode 100644 services/iaas/v1api/model_image_create_response.go create mode 100644 services/iaas/v1api/model_image_list_response.go create mode 100644 services/iaas/v1api/model_image_share.go create mode 100644 services/iaas/v1api/model_image_share_consumer.go create mode 100644 services/iaas/v1api/model_key_pair_list_response.go create mode 100644 services/iaas/v1api/model_keypair.go create mode 100644 services/iaas/v1api/model_machine_type.go create mode 100644 services/iaas/v1api/model_machine_type_list_response.go create mode 100644 services/iaas/v1api/model_network.go create mode 100644 services/iaas/v1api/model_network_area.go create mode 100644 services/iaas/v1api/model_network_area_ipv4.go create mode 100644 services/iaas/v1api/model_network_area_list_response.go create mode 100644 services/iaas/v1api/model_network_list_response.go create mode 100644 services/iaas/v1api/model_network_range.go create mode 100644 services/iaas/v1api/model_network_range_list_response.go create mode 100644 services/iaas/v1api/model_nic.go create mode 100644 services/iaas/v1api/model_nic_list_response.go create mode 100644 services/iaas/v1api/model_partial_update_network_area_payload.go create mode 100644 services/iaas/v1api/model_partial_update_network_payload.go create mode 100644 services/iaas/v1api/model_port_range.go create mode 100644 services/iaas/v1api/model_project.go create mode 100644 services/iaas/v1api/model_project_list_response.go create mode 100644 services/iaas/v1api/model_protocol.go create mode 100644 services/iaas/v1api/model_public_ip.go create mode 100644 services/iaas/v1api/model_public_ip_list_response.go create mode 100644 services/iaas/v1api/model_public_network.go create mode 100644 services/iaas/v1api/model_public_network_list_response.go create mode 100644 services/iaas/v1api/model_quota.go create mode 100644 services/iaas/v1api/model_quota_list.go create mode 100644 services/iaas/v1api/model_quota_list_response.go create mode 100644 services/iaas/v1api/model_request.go create mode 100644 services/iaas/v1api/model_request_resource.go create mode 100644 services/iaas/v1api/model_rescue_server_payload.go create mode 100644 services/iaas/v1api/model_resize_server_payload.go create mode 100644 services/iaas/v1api/model_resize_volume_payload.go create mode 100644 services/iaas/v1api/model_route.go create mode 100644 services/iaas/v1api/model_route_list_response.go create mode 100644 services/iaas/v1api/model_security_group.go create mode 100644 services/iaas/v1api/model_security_group_list_response.go create mode 100644 services/iaas/v1api/model_security_group_rule.go create mode 100644 services/iaas/v1api/model_security_group_rule_list_response.go create mode 100644 services/iaas/v1api/model_security_group_rule_protocol.go create mode 100644 services/iaas/v1api/model_server.go create mode 100644 services/iaas/v1api/model_server_agent.go create mode 100644 services/iaas/v1api/model_server_console_url.go create mode 100644 services/iaas/v1api/model_server_list_response.go create mode 100644 services/iaas/v1api/model_server_maintenance.go create mode 100644 services/iaas/v1api/model_server_network.go create mode 100644 services/iaas/v1api/model_server_networking.go create mode 100644 services/iaas/v1api/model_service_account_mail_list_response.go create mode 100644 services/iaas/v1api/model_set_image_share_payload.go create mode 100644 services/iaas/v1api/model_snapshot.go create mode 100644 services/iaas/v1api/model_snapshot_list_response.go create mode 100644 services/iaas/v1api/model_static_area_id.go create mode 100644 services/iaas/v1api/model_update_area_address_family.go create mode 100644 services/iaas/v1api/model_update_area_ipv4.go create mode 100644 services/iaas/v1api/model_update_attached_volume_payload.go create mode 100644 services/iaas/v1api/model_update_backup_payload.go create mode 100644 services/iaas/v1api/model_update_image_payload.go create mode 100644 services/iaas/v1api/model_update_image_share_payload.go create mode 100644 services/iaas/v1api/model_update_key_pair_payload.go create mode 100644 services/iaas/v1api/model_update_network_address_family.go create mode 100644 services/iaas/v1api/model_update_network_area_route_payload.go create mode 100644 services/iaas/v1api/model_update_network_ipv4_body.go create mode 100644 services/iaas/v1api/model_update_network_ipv6_body.go create mode 100644 services/iaas/v1api/model_update_nic_payload.go create mode 100644 services/iaas/v1api/model_update_public_ip_payload.go create mode 100644 services/iaas/v1api/model_update_security_group_payload.go create mode 100644 services/iaas/v1api/model_update_server_payload.go create mode 100644 services/iaas/v1api/model_update_snapshot_payload.go create mode 100644 services/iaas/v1api/model_update_volume_payload.go create mode 100644 services/iaas/v1api/model_volume.go create mode 100644 services/iaas/v1api/model_volume_attachment.go create mode 100644 services/iaas/v1api/model_volume_attachment_list_response.go create mode 100644 services/iaas/v1api/model_volume_encryption_parameter.go create mode 100644 services/iaas/v1api/model_volume_list_response.go create mode 100644 services/iaas/v1api/model_volume_performance_class.go create mode 100644 services/iaas/v1api/model_volume_performance_class_list_response.go create mode 100644 services/iaas/v1api/model_volume_source.go create mode 100644 services/iaas/v1api/response.go create mode 100644 services/iaas/v1api/utils.go create mode 100644 services/iaas/v2alpha1api/api_default.go create mode 100644 services/iaas/v2alpha1api/api_default_mock.go create mode 100644 services/iaas/v2alpha1api/client.go create mode 100644 services/iaas/v2alpha1api/configuration.go create mode 100644 services/iaas/v2alpha1api/model_add_routes_to_routing_table_payload.go create mode 100644 services/iaas/v2alpha1api/model_add_routing_table_to_area_payload.go create mode 100644 services/iaas/v2alpha1api/model_create_network_ipv4.go create mode 100644 services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix.go create mode 100644 services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix_length.go create mode 100644 services/iaas/v2alpha1api/model_create_network_ipv6.go create mode 100644 services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix.go create mode 100644 services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix_length.go create mode 100644 services/iaas/v2alpha1api/model_create_network_payload.go create mode 100644 services/iaas/v2alpha1api/model_destination_cidrv4.go create mode 100644 services/iaas/v2alpha1api/model_destination_cidrv6.go create mode 100644 services/iaas/v2alpha1api/model_error.go create mode 100644 services/iaas/v2alpha1api/model_network.go create mode 100644 services/iaas/v2alpha1api/model_network_ipv4.go create mode 100644 services/iaas/v2alpha1api/model_network_ipv6.go create mode 100644 services/iaas/v2alpha1api/model_network_list_response.go create mode 100644 services/iaas/v2alpha1api/model_nexthop_blackhole.go create mode 100644 services/iaas/v2alpha1api/model_nexthop_internet.go create mode 100644 services/iaas/v2alpha1api/model_nexthop_ipv4.go create mode 100644 services/iaas/v2alpha1api/model_nexthop_ipv6.go create mode 100644 services/iaas/v2alpha1api/model_partial_update_network_payload.go create mode 100644 services/iaas/v2alpha1api/model_route.go create mode 100644 services/iaas/v2alpha1api/model_route_destination.go create mode 100644 services/iaas/v2alpha1api/model_route_list_response.go create mode 100644 services/iaas/v2alpha1api/model_route_nexthop.go create mode 100644 services/iaas/v2alpha1api/model_routing_table.go create mode 100644 services/iaas/v2alpha1api/model_routing_table_list_response.go create mode 100644 services/iaas/v2alpha1api/model_update_network_ipv4_body.go create mode 100644 services/iaas/v2alpha1api/model_update_network_ipv6_body.go create mode 100644 services/iaas/v2alpha1api/model_update_route_of_routing_table_payload.go create mode 100644 services/iaas/v2alpha1api/model_update_routing_table_of_area_payload.go create mode 100644 services/iaas/v2alpha1api/response.go create mode 100644 services/iaas/v2alpha1api/utils.go create mode 100644 services/iaas/v2api/api_default.go create mode 100644 services/iaas/v2api/api_default_mock.go create mode 100644 services/iaas/v2api/client.go create mode 100644 services/iaas/v2api/configuration.go create mode 100644 services/iaas/v2api/model_add_routes_to_routing_table_payload.go create mode 100644 services/iaas/v2api/model_add_routing_table_to_area_payload.go create mode 100644 services/iaas/v2api/model_add_volume_to_server_payload.go create mode 100644 services/iaas/v2api/model_affinity_group.go create mode 100644 services/iaas/v2api/model_affinity_group_list_response.go create mode 100644 services/iaas/v2api/model_allowed_addresses_inner.go create mode 100644 services/iaas/v2api/model_area_id.go create mode 100644 services/iaas/v2api/model_availability_zone_list_response.go create mode 100644 services/iaas/v2api/model_backup.go create mode 100644 services/iaas/v2api/model_backup_list_response.go create mode 100644 services/iaas/v2api/model_backup_source.go create mode 100644 services/iaas/v2api/model_base_security_group_rule.go create mode 100644 services/iaas/v2api/model_boot_volume.go create mode 100644 services/iaas/v2api/model_boot_volume_source.go create mode 100644 services/iaas/v2api/model_create_affinity_group_payload.go create mode 100644 services/iaas/v2api/model_create_backup_payload.go create mode 100644 services/iaas/v2api/model_create_image_payload.go create mode 100644 services/iaas/v2api/model_create_isolated_network_payload.go create mode 100644 services/iaas/v2api/model_create_key_pair_payload.go create mode 100644 services/iaas/v2api/model_create_network_area_payload.go create mode 100644 services/iaas/v2api/model_create_network_area_range_payload.go create mode 100644 services/iaas/v2api/model_create_network_area_region_payload.go create mode 100644 services/iaas/v2api/model_create_network_area_route_payload.go create mode 100644 services/iaas/v2api/model_create_network_ipv4.go create mode 100644 services/iaas/v2api/model_create_network_ipv4_with_prefix.go create mode 100644 services/iaas/v2api/model_create_network_ipv4_with_prefix_length.go create mode 100644 services/iaas/v2api/model_create_network_ipv6.go create mode 100644 services/iaas/v2api/model_create_network_ipv6_with_prefix.go create mode 100644 services/iaas/v2api/model_create_network_ipv6_with_prefix_length.go create mode 100644 services/iaas/v2api/model_create_network_payload.go create mode 100644 services/iaas/v2api/model_create_nic_payload.go create mode 100644 services/iaas/v2api/model_create_protocol.go create mode 100644 services/iaas/v2api/model_create_public_ip_payload.go create mode 100644 services/iaas/v2api/model_create_security_group_payload.go create mode 100644 services/iaas/v2api/model_create_security_group_rule_payload.go create mode 100644 services/iaas/v2api/model_create_security_group_rule_protocol.go create mode 100644 services/iaas/v2api/model_create_server_networking.go create mode 100644 services/iaas/v2api/model_create_server_networking_with_nics.go create mode 100644 services/iaas/v2api/model_create_server_payload.go create mode 100644 services/iaas/v2api/model_create_server_payload_all_of_networking.go create mode 100644 services/iaas/v2api/model_create_snapshot_payload.go create mode 100644 services/iaas/v2api/model_create_volume_payload.go create mode 100644 services/iaas/v2api/model_destination_cidrv4.go create mode 100644 services/iaas/v2api/model_destination_cidrv6.go create mode 100644 services/iaas/v2api/model_error.go create mode 100644 services/iaas/v2api/model_get_server_log_200_response.go create mode 100644 services/iaas/v2api/model_icmp_parameters.go create mode 100644 services/iaas/v2api/model_image.go create mode 100644 services/iaas/v2api/model_image_agent.go create mode 100644 services/iaas/v2api/model_image_checksum.go create mode 100644 services/iaas/v2api/model_image_config.go create mode 100644 services/iaas/v2api/model_image_create_response.go create mode 100644 services/iaas/v2api/model_image_from_volume_payload.go create mode 100644 services/iaas/v2api/model_image_list_response.go create mode 100644 services/iaas/v2api/model_image_share.go create mode 100644 services/iaas/v2api/model_image_share_consumer.go create mode 100644 services/iaas/v2api/model_key_pair_list_response.go create mode 100644 services/iaas/v2api/model_keypair.go create mode 100644 services/iaas/v2api/model_machine_type.go create mode 100644 services/iaas/v2api/model_machine_type_list_response.go create mode 100644 services/iaas/v2api/model_network.go create mode 100644 services/iaas/v2api/model_network_area.go create mode 100644 services/iaas/v2api/model_network_area_list_response.go create mode 100644 services/iaas/v2api/model_network_ipv4.go create mode 100644 services/iaas/v2api/model_network_ipv6.go create mode 100644 services/iaas/v2api/model_network_list_response.go create mode 100644 services/iaas/v2api/model_network_range.go create mode 100644 services/iaas/v2api/model_network_range_list_response.go create mode 100644 services/iaas/v2api/model_nexthop_blackhole.go create mode 100644 services/iaas/v2api/model_nexthop_internet.go create mode 100644 services/iaas/v2api/model_nexthop_ipv4.go create mode 100644 services/iaas/v2api/model_nexthop_ipv6.go create mode 100644 services/iaas/v2api/model_nic.go create mode 100644 services/iaas/v2api/model_nic_list_response.go create mode 100644 services/iaas/v2api/model_partial_update_network_area_payload.go create mode 100644 services/iaas/v2api/model_partial_update_network_payload.go create mode 100644 services/iaas/v2api/model_port_range.go create mode 100644 services/iaas/v2api/model_project.go create mode 100644 services/iaas/v2api/model_project_list_response.go create mode 100644 services/iaas/v2api/model_protocol.go create mode 100644 services/iaas/v2api/model_public_ip.go create mode 100644 services/iaas/v2api/model_public_ip_list_response.go create mode 100644 services/iaas/v2api/model_public_network.go create mode 100644 services/iaas/v2api/model_public_network_list_response.go create mode 100644 services/iaas/v2api/model_quota.go create mode 100644 services/iaas/v2api/model_quota_list.go create mode 100644 services/iaas/v2api/model_quota_list_response.go create mode 100644 services/iaas/v2api/model_regional_area.go create mode 100644 services/iaas/v2api/model_regional_area_ipv4.go create mode 100644 services/iaas/v2api/model_regional_area_list_response.go create mode 100644 services/iaas/v2api/model_request.go create mode 100644 services/iaas/v2api/model_request_resource.go create mode 100644 services/iaas/v2api/model_rescue_server_payload.go create mode 100644 services/iaas/v2api/model_resize_server_payload.go create mode 100644 services/iaas/v2api/model_resize_volume_payload.go create mode 100644 services/iaas/v2api/model_route.go create mode 100644 services/iaas/v2api/model_route_destination.go create mode 100644 services/iaas/v2api/model_route_list_response.go create mode 100644 services/iaas/v2api/model_route_nexthop.go create mode 100644 services/iaas/v2api/model_routing_table.go create mode 100644 services/iaas/v2api/model_routing_table_list_response.go create mode 100644 services/iaas/v2api/model_security_group.go create mode 100644 services/iaas/v2api/model_security_group_list_response.go create mode 100644 services/iaas/v2api/model_security_group_rule.go create mode 100644 services/iaas/v2api/model_security_group_rule_list_response.go create mode 100644 services/iaas/v2api/model_security_group_rule_protocol.go create mode 100644 services/iaas/v2api/model_server.go create mode 100644 services/iaas/v2api/model_server_agent.go create mode 100644 services/iaas/v2api/model_server_console_url.go create mode 100644 services/iaas/v2api/model_server_list_response.go create mode 100644 services/iaas/v2api/model_server_maintenance.go create mode 100644 services/iaas/v2api/model_server_network.go create mode 100644 services/iaas/v2api/model_server_networking.go create mode 100644 services/iaas/v2api/model_service_account_mail_list_response.go create mode 100644 services/iaas/v2api/model_set_image_share_payload.go create mode 100644 services/iaas/v2api/model_snapshot.go create mode 100644 services/iaas/v2api/model_snapshot_list_response.go create mode 100644 services/iaas/v2api/model_static_area_id.go create mode 100644 services/iaas/v2api/model_update_attached_volume_payload.go create mode 100644 services/iaas/v2api/model_update_backup_payload.go create mode 100644 services/iaas/v2api/model_update_image_payload.go create mode 100644 services/iaas/v2api/model_update_image_share_payload.go create mode 100644 services/iaas/v2api/model_update_key_pair_payload.go create mode 100644 services/iaas/v2api/model_update_network_area_region_payload.go create mode 100644 services/iaas/v2api/model_update_network_area_route_payload.go create mode 100644 services/iaas/v2api/model_update_network_ipv4_body.go create mode 100644 services/iaas/v2api/model_update_network_ipv6_body.go create mode 100644 services/iaas/v2api/model_update_nic_payload.go create mode 100644 services/iaas/v2api/model_update_public_ip_payload.go create mode 100644 services/iaas/v2api/model_update_regional_area_ipv4.go create mode 100644 services/iaas/v2api/model_update_route_of_routing_table_payload.go create mode 100644 services/iaas/v2api/model_update_routing_table_of_area_payload.go create mode 100644 services/iaas/v2api/model_update_security_group_payload.go create mode 100644 services/iaas/v2api/model_update_server_payload.go create mode 100644 services/iaas/v2api/model_update_snapshot_payload.go create mode 100644 services/iaas/v2api/model_update_volume_payload.go create mode 100644 services/iaas/v2api/model_volume.go create mode 100644 services/iaas/v2api/model_volume_attachment.go create mode 100644 services/iaas/v2api/model_volume_attachment_list_response.go create mode 100644 services/iaas/v2api/model_volume_encryption_parameter.go create mode 100644 services/iaas/v2api/model_volume_list_response.go create mode 100644 services/iaas/v2api/model_volume_performance_class.go create mode 100644 services/iaas/v2api/model_volume_performance_class_list_response.go create mode 100644 services/iaas/v2api/model_volume_source.go create mode 100644 services/iaas/v2api/response.go create mode 100644 services/iaas/v2api/utils.go create mode 100644 services/iaas/v2beta1api/api_default.go create mode 100644 services/iaas/v2beta1api/api_default_mock.go create mode 100644 services/iaas/v2beta1api/client.go create mode 100644 services/iaas/v2beta1api/configuration.go create mode 100644 services/iaas/v2beta1api/model_add_routes_to_routing_table_payload.go create mode 100644 services/iaas/v2beta1api/model_add_routing_table_to_area_payload.go create mode 100644 services/iaas/v2beta1api/model_add_volume_to_server_payload.go create mode 100644 services/iaas/v2beta1api/model_affinity_group.go create mode 100644 services/iaas/v2beta1api/model_affinity_group_list_response.go create mode 100644 services/iaas/v2beta1api/model_allowed_addresses_inner.go create mode 100644 services/iaas/v2beta1api/model_area_id.go create mode 100644 services/iaas/v2beta1api/model_availability_zone_list_response.go create mode 100644 services/iaas/v2beta1api/model_backup.go create mode 100644 services/iaas/v2beta1api/model_backup_list_response.go create mode 100644 services/iaas/v2beta1api/model_backup_source.go create mode 100644 services/iaas/v2beta1api/model_base_security_group_rule.go create mode 100644 services/iaas/v2beta1api/model_boot_volume.go create mode 100644 services/iaas/v2beta1api/model_boot_volume_source.go create mode 100644 services/iaas/v2beta1api/model_create_affinity_group_payload.go create mode 100644 services/iaas/v2beta1api/model_create_backup_payload.go create mode 100644 services/iaas/v2beta1api/model_create_image_payload.go create mode 100644 services/iaas/v2beta1api/model_create_isolated_network_payload.go create mode 100644 services/iaas/v2beta1api/model_create_key_pair_payload.go create mode 100644 services/iaas/v2beta1api/model_create_network_area_payload.go create mode 100644 services/iaas/v2beta1api/model_create_network_area_range_payload.go create mode 100644 services/iaas/v2beta1api/model_create_network_area_route_payload.go create mode 100644 services/iaas/v2beta1api/model_create_network_ipv4.go create mode 100644 services/iaas/v2beta1api/model_create_network_ipv4_with_prefix.go create mode 100644 services/iaas/v2beta1api/model_create_network_ipv4_with_prefix_length.go create mode 100644 services/iaas/v2beta1api/model_create_network_ipv6.go create mode 100644 services/iaas/v2beta1api/model_create_network_ipv6_with_prefix.go create mode 100644 services/iaas/v2beta1api/model_create_network_ipv6_with_prefix_length.go create mode 100644 services/iaas/v2beta1api/model_create_network_payload.go create mode 100644 services/iaas/v2beta1api/model_create_nic_payload.go create mode 100644 services/iaas/v2beta1api/model_create_protocol.go create mode 100644 services/iaas/v2beta1api/model_create_public_ip_payload.go create mode 100644 services/iaas/v2beta1api/model_create_security_group_payload.go create mode 100644 services/iaas/v2beta1api/model_create_security_group_rule_payload.go create mode 100644 services/iaas/v2beta1api/model_create_security_group_rule_protocol.go create mode 100644 services/iaas/v2beta1api/model_create_server_networking.go create mode 100644 services/iaas/v2beta1api/model_create_server_networking_with_nics.go create mode 100644 services/iaas/v2beta1api/model_create_server_payload.go create mode 100644 services/iaas/v2beta1api/model_create_server_payload_all_of_networking.go create mode 100644 services/iaas/v2beta1api/model_create_volume_payload.go create mode 100644 services/iaas/v2beta1api/model_destination_cidrv4.go create mode 100644 services/iaas/v2beta1api/model_destination_cidrv6.go create mode 100644 services/iaas/v2beta1api/model_error.go create mode 100644 services/iaas/v2beta1api/model_get_server_log_200_response.go create mode 100644 services/iaas/v2beta1api/model_icmp_parameters.go create mode 100644 services/iaas/v2beta1api/model_image.go create mode 100644 services/iaas/v2beta1api/model_image_agent.go create mode 100644 services/iaas/v2beta1api/model_image_checksum.go create mode 100644 services/iaas/v2beta1api/model_image_config.go create mode 100644 services/iaas/v2beta1api/model_image_create_response.go create mode 100644 services/iaas/v2beta1api/model_image_list_response.go create mode 100644 services/iaas/v2beta1api/model_image_share.go create mode 100644 services/iaas/v2beta1api/model_image_share_consumer.go create mode 100644 services/iaas/v2beta1api/model_key_pair_list_response.go create mode 100644 services/iaas/v2beta1api/model_keypair.go create mode 100644 services/iaas/v2beta1api/model_machine_type.go create mode 100644 services/iaas/v2beta1api/model_machine_type_list_response.go create mode 100644 services/iaas/v2beta1api/model_network.go create mode 100644 services/iaas/v2beta1api/model_network_area.go create mode 100644 services/iaas/v2beta1api/model_network_area_list_response.go create mode 100644 services/iaas/v2beta1api/model_network_ipv4.go create mode 100644 services/iaas/v2beta1api/model_network_ipv6.go create mode 100644 services/iaas/v2beta1api/model_network_list_response.go create mode 100644 services/iaas/v2beta1api/model_network_range.go create mode 100644 services/iaas/v2beta1api/model_network_range_list_response.go create mode 100644 services/iaas/v2beta1api/model_nexthop_blackhole.go create mode 100644 services/iaas/v2beta1api/model_nexthop_internet.go create mode 100644 services/iaas/v2beta1api/model_nexthop_ipv4.go create mode 100644 services/iaas/v2beta1api/model_nexthop_ipv6.go create mode 100644 services/iaas/v2beta1api/model_nic.go create mode 100644 services/iaas/v2beta1api/model_nic_list_response.go create mode 100644 services/iaas/v2beta1api/model_partial_update_network_area_payload.go create mode 100644 services/iaas/v2beta1api/model_partial_update_network_payload.go create mode 100644 services/iaas/v2beta1api/model_port_range.go create mode 100644 services/iaas/v2beta1api/model_project.go create mode 100644 services/iaas/v2beta1api/model_project_list_response.go create mode 100644 services/iaas/v2beta1api/model_protocol.go create mode 100644 services/iaas/v2beta1api/model_public_ip.go create mode 100644 services/iaas/v2beta1api/model_public_ip_list_response.go create mode 100644 services/iaas/v2beta1api/model_public_network.go create mode 100644 services/iaas/v2beta1api/model_public_network_list_response.go create mode 100644 services/iaas/v2beta1api/model_quota.go create mode 100644 services/iaas/v2beta1api/model_quota_list.go create mode 100644 services/iaas/v2beta1api/model_quota_list_response.go create mode 100644 services/iaas/v2beta1api/model_regional_area.go create mode 100644 services/iaas/v2beta1api/model_regional_area_ipv4.go create mode 100644 services/iaas/v2beta1api/model_regional_area_list_response.go create mode 100644 services/iaas/v2beta1api/model_request.go create mode 100644 services/iaas/v2beta1api/model_request_resource.go create mode 100644 services/iaas/v2beta1api/model_rescue_server_payload.go create mode 100644 services/iaas/v2beta1api/model_resize_server_payload.go create mode 100644 services/iaas/v2beta1api/model_resize_volume_payload.go create mode 100644 services/iaas/v2beta1api/model_route.go create mode 100644 services/iaas/v2beta1api/model_route_destination.go create mode 100644 services/iaas/v2beta1api/model_route_list_response.go create mode 100644 services/iaas/v2beta1api/model_route_nexthop.go create mode 100644 services/iaas/v2beta1api/model_routing_table.go create mode 100644 services/iaas/v2beta1api/model_routing_table_list_response.go create mode 100644 services/iaas/v2beta1api/model_security_group.go create mode 100644 services/iaas/v2beta1api/model_security_group_list_response.go create mode 100644 services/iaas/v2beta1api/model_security_group_rule.go create mode 100644 services/iaas/v2beta1api/model_security_group_rule_list_response.go create mode 100644 services/iaas/v2beta1api/model_security_group_rule_protocol.go create mode 100644 services/iaas/v2beta1api/model_server.go create mode 100644 services/iaas/v2beta1api/model_server_agent.go create mode 100644 services/iaas/v2beta1api/model_server_console_url.go create mode 100644 services/iaas/v2beta1api/model_server_list_response.go create mode 100644 services/iaas/v2beta1api/model_server_maintenance.go create mode 100644 services/iaas/v2beta1api/model_server_network.go create mode 100644 services/iaas/v2beta1api/model_server_networking.go create mode 100644 services/iaas/v2beta1api/model_service_account_mail_list_response.go create mode 100644 services/iaas/v2beta1api/model_set_image_share_payload.go create mode 100644 services/iaas/v2beta1api/model_snapshot.go create mode 100644 services/iaas/v2beta1api/model_snapshot_list_response.go create mode 100644 services/iaas/v2beta1api/model_static_area_id.go create mode 100644 services/iaas/v2beta1api/model_update_attached_volume_payload.go create mode 100644 services/iaas/v2beta1api/model_update_image_payload.go create mode 100644 services/iaas/v2beta1api/model_update_image_share_payload.go create mode 100644 services/iaas/v2beta1api/model_update_key_pair_payload.go create mode 100644 services/iaas/v2beta1api/model_update_network_ipv4_body.go create mode 100644 services/iaas/v2beta1api/model_update_network_ipv6_body.go create mode 100644 services/iaas/v2beta1api/model_update_nic_payload.go create mode 100644 services/iaas/v2beta1api/model_update_public_ip_payload.go create mode 100644 services/iaas/v2beta1api/model_update_regional_area_ipv4.go create mode 100644 services/iaas/v2beta1api/model_update_route_of_routing_table_payload.go create mode 100644 services/iaas/v2beta1api/model_update_routing_table_of_area_payload.go create mode 100644 services/iaas/v2beta1api/model_update_server_payload.go create mode 100644 services/iaas/v2beta1api/model_update_volume_payload.go create mode 100644 services/iaas/v2beta1api/model_v2beta1_configure_network_area_region_payload.go create mode 100644 services/iaas/v2beta1api/model_v2beta1_create_snapshot_payload.go create mode 100644 services/iaas/v2beta1api/model_v2beta1_update_backup_payload.go create mode 100644 services/iaas/v2beta1api/model_v2beta1_update_network_area_region_payload.go create mode 100644 services/iaas/v2beta1api/model_v2beta1_update_route_of_area_payload.go create mode 100644 services/iaas/v2beta1api/model_v2beta1_update_security_group_payload.go create mode 100644 services/iaas/v2beta1api/model_v2beta1_update_snapshot_payload.go create mode 100644 services/iaas/v2beta1api/model_volume.go create mode 100644 services/iaas/v2beta1api/model_volume_attachment.go create mode 100644 services/iaas/v2beta1api/model_volume_attachment_list_response.go create mode 100644 services/iaas/v2beta1api/model_volume_encryption_parameter.go create mode 100644 services/iaas/v2beta1api/model_volume_list_response.go create mode 100644 services/iaas/v2beta1api/model_volume_performance_class.go create mode 100644 services/iaas/v2beta1api/model_volume_performance_class_list_response.go create mode 100644 services/iaas/v2beta1api/model_volume_source.go create mode 100644 services/iaas/v2beta1api/response.go create mode 100644 services/iaas/v2beta1api/utils.go create mode 100644 services/iaas/wait/deprecation.go diff --git a/services/iaas/api_default.go b/services/iaas/api_default.go index 8570e8531..78e08d160 100644 --- a/services/iaas/api_default.go +++ b/services/iaas/api_default.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,6 +24,7 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApi interface { /* AddNetworkToServer Create and attach a network interface from the specified network. @@ -34,11 +36,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param networkId The identifier (ID) of a STACKIT Network. @return ApiAddNetworkToServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest /* AddNetworkToServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddNetworkToServerExecute(ctx context.Context, projectId string, region string, serverId string, networkId string) error /* @@ -51,11 +56,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param nicId The identifier (ID) of a network interface. @return ApiAddNicToServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest /* AddNicToServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddNicToServerExecute(ctx context.Context, projectId string, region string, serverId string, nicId string) error /* @@ -68,11 +76,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param publicIpId The identifier (ID) of a Public IP. @return ApiAddPublicIpToServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest /* AddPublicIpToServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddPublicIpToServerExecute(ctx context.Context, projectId string, region string, serverId string, publicIpId string) error /* @@ -85,6 +96,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return ApiAddRoutesToRoutingTableRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest /* @@ -97,6 +110,7 @@ type DefaultApi interface { @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return RouteListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddRoutesToRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) /* @@ -108,6 +122,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiAddRoutingTableToAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest /* @@ -119,6 +135,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return RoutingTable + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddRoutingTableToAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTable, error) /* @@ -131,11 +148,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiAddSecurityGroupToServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest /* AddSecurityGroupToServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddSecurityGroupToServerExecute(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) error /* @@ -148,6 +168,8 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param serviceAccountMail The e-mail address of a service account. @return ApiAddServiceAccountToServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest /* @@ -160,6 +182,7 @@ type DefaultApi interface { @param serviceAccountMail The e-mail address of a service account. @return ServiceAccountMailListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddServiceAccountToServerExecute(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) /* @@ -172,6 +195,8 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiAddVolumeToServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest /* @@ -184,6 +209,7 @@ type DefaultApi interface { @param volumeId The identifier (ID) of a STACKIT Volume. @return VolumeAttachment + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ AddVolumeToServerExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) /* @@ -194,6 +220,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateAffinityGroupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest /* @@ -204,6 +232,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return AffinityGroup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateAffinityGroupExecute(ctx context.Context, projectId string, region string) (*AffinityGroup, error) /* @@ -214,6 +243,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest /* @@ -224,6 +255,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return Backup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateBackupExecute(ctx context.Context, projectId string, region string) (*Backup, error) /* @@ -234,6 +266,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateImageRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest /* @@ -244,6 +278,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return ImageCreateResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateImageExecute(ctx context.Context, projectId string, region string) (*ImageCreateResponse, error) /* @@ -254,6 +289,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateIsolatedNetworkRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateIsolatedNetwork(ctx context.Context, projectId string, region string) ApiCreateIsolatedNetworkRequest /* @@ -264,6 +301,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return Network + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateIsolatedNetworkExecute(ctx context.Context, projectId string, region string) (*Network, error) /* @@ -272,6 +310,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateKeyPairRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest /* @@ -280,6 +320,7 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return Keypair + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateKeyPairExecute(ctx context.Context) (*Keypair, error) /* @@ -290,6 +331,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateNetworkRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest /* @@ -300,6 +343,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return Network + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkExecute(ctx context.Context, projectId string, region string) (*Network, error) /* @@ -309,6 +353,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @return ApiCreateNetworkAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest /* @@ -318,6 +364,7 @@ type DefaultApi interface { @param organizationId The identifier (ID) of a STACKIT Organization. @return NetworkArea + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkAreaExecute(ctx context.Context, organizationId string) (*NetworkArea, error) /* @@ -329,6 +376,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiCreateNetworkAreaRangeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest /* @@ -340,6 +389,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return NetworkRangeListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string) (*NetworkRangeListResponse, error) /* @@ -351,6 +401,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiCreateNetworkAreaRegionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRegionRequest /* @@ -362,6 +414,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return RegionalArea + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) /* @@ -373,6 +426,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiCreateNetworkAreaRouteRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest /* @@ -384,6 +439,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return RouteListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string) (*RouteListResponse, error) /* @@ -395,6 +451,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiCreateNicRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest /* @@ -406,6 +464,7 @@ type DefaultApi interface { @param networkId The identifier (ID) of a STACKIT Network. @return NIC + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateNicExecute(ctx context.Context, projectId string, region string, networkId string) (*NIC, error) /* @@ -416,6 +475,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreatePublicIPRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest /* @@ -426,6 +487,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return PublicIp + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreatePublicIPExecute(ctx context.Context, projectId string, region string) (*PublicIp, error) /* @@ -436,6 +498,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateSecurityGroupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest /* @@ -446,6 +510,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return SecurityGroup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateSecurityGroupExecute(ctx context.Context, projectId string, region string) (*SecurityGroup, error) /* @@ -457,6 +522,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiCreateSecurityGroupRuleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest /* @@ -468,6 +535,7 @@ type DefaultApi interface { @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return SecurityGroupRule + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroupRule, error) /* @@ -478,6 +546,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest /* @@ -488,6 +558,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return Server + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateServerExecute(ctx context.Context, projectId string, region string) (*Server, error) /* @@ -498,6 +569,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateSnapshotRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateSnapshot(ctx context.Context, projectId string, region string) ApiCreateSnapshotRequest /* @@ -508,6 +581,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return Snapshot + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateSnapshotExecute(ctx context.Context, projectId string, region string) (*Snapshot, error) /* @@ -518,6 +592,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiCreateVolumeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest /* @@ -528,6 +604,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return Volume + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateVolumeExecute(ctx context.Context, projectId string, region string) (*Volume, error) /* @@ -539,11 +616,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiDeallocateServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest /* DeallocateServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeallocateServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* @@ -555,11 +635,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. @return ApiDeleteAffinityGroupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest /* DeleteAffinityGroupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteAffinityGroupExecute(ctx context.Context, projectId string, region string, affinityGroupId string) error /* @@ -571,11 +654,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiDeleteBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest /* DeleteBackupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteBackupExecute(ctx context.Context, projectId string, region string, backupId string) error /* @@ -587,11 +673,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiDeleteImageRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest /* DeleteImageExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteImageExecute(ctx context.Context, projectId string, region string, imageId string) error /* @@ -603,11 +692,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiDeleteImageShareRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest /* DeleteImageShareExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteImageShareExecute(ctx context.Context, projectId string, region string, imageId string) error /* @@ -620,11 +712,14 @@ type DefaultApi interface { @param imageId The identifier (ID) of a STACKIT Image. @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. @return ApiDeleteImageShareConsumerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest /* DeleteImageShareConsumerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteImageShareConsumerExecute(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) error /* @@ -634,11 +729,14 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param keypairName The name of an SSH keypair. @return ApiDeleteKeyPairRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest /* DeleteKeyPairExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteKeyPairExecute(ctx context.Context, keypairName string) error /* @@ -650,11 +748,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiDeleteNetworkRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest /* DeleteNetworkExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error /* @@ -665,11 +766,14 @@ type DefaultApi interface { @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. @return ApiDeleteNetworkAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest /* DeleteNetworkAreaExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) error /* @@ -682,11 +786,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param networkRangeId The identifier (ID) of a STACKIT Network Range. @return ApiDeleteNetworkAreaRangeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest /* DeleteNetworkAreaRangeExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) error /* @@ -698,11 +805,14 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiDeleteNetworkAreaRegionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiDeleteNetworkAreaRegionRequest /* DeleteNetworkAreaRegionExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) error /* @@ -715,11 +825,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param routeId The identifier (ID) of a STACKIT Route. @return ApiDeleteNetworkAreaRouteRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest /* DeleteNetworkAreaRouteExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) error /* @@ -732,11 +845,14 @@ type DefaultApi interface { @param networkId The identifier (ID) of a STACKIT Network. @param nicId The identifier (ID) of a network interface. @return ApiDeleteNicRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest /* DeleteNicExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) error /* @@ -748,11 +864,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param publicIpId The identifier (ID) of a Public IP. @return ApiDeletePublicIPRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest /* DeletePublicIPExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeletePublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) error /* @@ -766,11 +885,14 @@ type DefaultApi interface { @param routingTableId The identifier (ID) of a STACKIT Routing Table. @param routeId The identifier (ID) of a STACKIT Route. @return ApiDeleteRouteFromRoutingTableRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest /* DeleteRouteFromRoutingTableExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteRouteFromRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) error /* @@ -783,11 +905,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return ApiDeleteRoutingTableFromAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest /* DeleteRoutingTableFromAreaExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteRoutingTableFromAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) error /* @@ -799,11 +924,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiDeleteSecurityGroupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest /* DeleteSecurityGroupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) error /* @@ -816,11 +944,14 @@ type DefaultApi interface { @param securityGroupId The identifier (ID) of a STACKIT Security Group. @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. @return ApiDeleteSecurityGroupRuleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest /* DeleteSecurityGroupRuleExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) error /* @@ -832,11 +963,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiDeleteServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest /* DeleteServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* @@ -848,11 +982,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return ApiDeleteSnapshotRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiDeleteSnapshotRequest /* DeleteSnapshotExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) error /* @@ -864,11 +1001,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiDeleteVolumeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest /* DeleteVolumeExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) error /* @@ -880,6 +1020,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. @return ApiGetAffinityGroupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest /* @@ -891,6 +1033,7 @@ type DefaultApi interface { @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. @return AffinityGroup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetAffinityGroupExecute(ctx context.Context, projectId string, region string, affinityGroupId string) (*AffinityGroup, error) /* @@ -903,6 +1046,8 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiGetAttachedVolumeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest /* @@ -915,6 +1060,7 @@ type DefaultApi interface { @param volumeId The identifier (ID) of a STACKIT Volume. @return VolumeAttachment + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetAttachedVolumeExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) /* @@ -926,6 +1072,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiGetBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest /* @@ -937,6 +1085,7 @@ type DefaultApi interface { @param backupId The identifier (ID) of a STACKIT Backup. @return Backup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetBackupExecute(ctx context.Context, projectId string, region string, backupId string) (*Backup, error) /* @@ -948,6 +1097,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiGetImageRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest /* @@ -959,6 +1110,7 @@ type DefaultApi interface { @param imageId The identifier (ID) of a STACKIT Image. @return Image + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetImageExecute(ctx context.Context, projectId string, region string, imageId string) (*Image, error) /* @@ -970,6 +1122,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiGetImageShareRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest /* @@ -981,6 +1135,7 @@ type DefaultApi interface { @param imageId The identifier (ID) of a STACKIT Image. @return ImageShare + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) /* @@ -993,6 +1148,8 @@ type DefaultApi interface { @param imageId The identifier (ID) of a STACKIT Image. @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. @return ApiGetImageShareConsumerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest /* @@ -1005,6 +1162,7 @@ type DefaultApi interface { @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. @return ImageShareConsumer + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetImageShareConsumerExecute(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) (*ImageShareConsumer, error) /* @@ -1014,6 +1172,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param keypairName The name of an SSH keypair. @return ApiGetKeyPairRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest /* @@ -1023,6 +1183,7 @@ type DefaultApi interface { @param keypairName The name of an SSH keypair. @return Keypair + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) /* @@ -1034,6 +1195,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param machineType STACKIT machine type Name. @return ApiGetMachineTypeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest /* @@ -1045,6 +1208,7 @@ type DefaultApi interface { @param machineType STACKIT machine type Name. @return MachineType + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetMachineTypeExecute(ctx context.Context, projectId string, region string, machineType string) (*MachineType, error) /* @@ -1056,6 +1220,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiGetNetworkRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest /* @@ -1067,6 +1233,7 @@ type DefaultApi interface { @param networkId The identifier (ID) of a STACKIT Network. @return Network + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkExecute(ctx context.Context, projectId string, region string, networkId string) (*Network, error) /* @@ -1077,6 +1244,8 @@ type DefaultApi interface { @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. @return ApiGetNetworkAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest /* @@ -1087,6 +1256,7 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @return NetworkArea + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) /* @@ -1099,6 +1269,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param networkRangeId The identifier (ID) of a STACKIT Network Range. @return ApiGetNetworkAreaRangeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest /* @@ -1111,6 +1283,7 @@ type DefaultApi interface { @param networkRangeId The identifier (ID) of a STACKIT Network Range. @return NetworkRange + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) (*NetworkRange, error) /* @@ -1122,6 +1295,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiGetNetworkAreaRegionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiGetNetworkAreaRegionRequest /* @@ -1133,6 +1308,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return RegionalArea + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) /* @@ -1145,6 +1321,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param routeId The identifier (ID) of a STACKIT Route. @return ApiGetNetworkAreaRouteRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest /* @@ -1157,6 +1335,7 @@ type DefaultApi interface { @param routeId The identifier (ID) of a STACKIT Route. @return Route + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) (*Route, error) /* @@ -1169,6 +1348,8 @@ type DefaultApi interface { @param networkId The identifier (ID) of a STACKIT Network. @param nicId The identifier (ID) of a network interface. @return ApiGetNicRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest /* @@ -1181,6 +1362,7 @@ type DefaultApi interface { @param nicId The identifier (ID) of a network interface. @return NIC + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) (*NIC, error) /* @@ -1191,6 +1373,8 @@ type DefaultApi interface { @param organizationId The identifier (ID) of a STACKIT Organization. @param requestId The identifier (ID) of a STACKIT Request. @return ApiGetOrganizationRequestRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest /* @@ -1201,6 +1385,7 @@ type DefaultApi interface { @param requestId The identifier (ID) of a STACKIT Request. @return Request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) /* @@ -1210,6 +1395,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @return ApiGetProjectDetailsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest /* @@ -1219,6 +1406,7 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @return Project + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) /* @@ -1230,6 +1418,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param nicId The identifier (ID) of a network interface. @return ApiGetProjectNICRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest /* @@ -1241,6 +1431,7 @@ type DefaultApi interface { @param nicId The identifier (ID) of a network interface. @return NIC + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetProjectNICExecute(ctx context.Context, projectId string, region string, nicId string) (*NIC, error) /* @@ -1252,6 +1443,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param requestId The identifier (ID) of a STACKIT Request. @return ApiGetProjectRequestRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest /* @@ -1263,6 +1456,7 @@ type DefaultApi interface { @param requestId The identifier (ID) of a STACKIT Request. @return Request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetProjectRequestExecute(ctx context.Context, projectId string, region string, requestId string) (*Request, error) /* @@ -1274,6 +1468,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param publicIpId The identifier (ID) of a Public IP. @return ApiGetPublicIPRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest /* @@ -1285,6 +1481,7 @@ type DefaultApi interface { @param publicIpId The identifier (ID) of a Public IP. @return PublicIp + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetPublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) (*PublicIp, error) /* @@ -1298,6 +1495,8 @@ type DefaultApi interface { @param routingTableId The identifier (ID) of a STACKIT Routing Table. @param routeId The identifier (ID) of a STACKIT Route. @return ApiGetRouteOfRoutingTableRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest /* @@ -1311,6 +1510,7 @@ type DefaultApi interface { @param routeId The identifier (ID) of a STACKIT Route. @return Route + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) /* @@ -1323,6 +1523,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return ApiGetRoutingTableOfAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest /* @@ -1335,6 +1537,7 @@ type DefaultApi interface { @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return RoutingTable + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) /* @@ -1346,6 +1549,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiGetSecurityGroupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest /* @@ -1357,6 +1562,7 @@ type DefaultApi interface { @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return SecurityGroup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroup, error) /* @@ -1369,6 +1575,8 @@ type DefaultApi interface { @param securityGroupId The identifier (ID) of a STACKIT Security Group. @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. @return ApiGetSecurityGroupRuleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest /* @@ -1381,6 +1589,7 @@ type DefaultApi interface { @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. @return SecurityGroupRule + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) /* @@ -1392,6 +1601,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiGetServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest /* @@ -1403,6 +1614,7 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @return Server + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServerExecute(ctx context.Context, projectId string, region string, serverId string) (*Server, error) /* @@ -1414,6 +1626,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiGetServerConsoleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest /* @@ -1425,6 +1639,7 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @return ServerConsoleUrl + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServerConsoleExecute(ctx context.Context, projectId string, region string, serverId string) (*ServerConsoleUrl, error) /* @@ -1436,6 +1651,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiGetServerLogRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest /* @@ -1447,6 +1664,7 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @return GetServerLog200Response + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServerLogExecute(ctx context.Context, projectId string, region string, serverId string) (*GetServerLog200Response, error) /* @@ -1458,6 +1676,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return ApiGetSnapshotRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiGetSnapshotRequest /* @@ -1469,6 +1689,7 @@ type DefaultApi interface { @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return Snapshot + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) (*Snapshot, error) /* @@ -1480,6 +1701,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiGetVolumeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest /* @@ -1491,6 +1714,7 @@ type DefaultApi interface { @param volumeId The identifier (ID) of a STACKIT Volume. @return Volume + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) (*Volume, error) /* @@ -1502,6 +1726,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param volumePerformanceClass The name of a STACKIT Volume performance class. @return ApiGetVolumePerformanceClassRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest /* @@ -1513,6 +1739,7 @@ type DefaultApi interface { @param volumePerformanceClass The name of a STACKIT Volume performance class. @return VolumePerformanceClass + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetVolumePerformanceClassExecute(ctx context.Context, projectId string, region string, volumePerformanceClass string) (*VolumePerformanceClass, error) /* @@ -1524,6 +1751,8 @@ type DefaultApi interface { @param volumeId The identifier (ID) of a STACKIT Volume. @param region The STACKIT Region of the resources. @return ApiImageFromVolumeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ImageFromVolume(ctx context.Context, projectId string, volumeId string, region string) ApiImageFromVolumeRequest /* @@ -1535,6 +1764,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return Image + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ImageFromVolumeExecute(ctx context.Context, projectId string, volumeId string, region string) (*Image, error) /* @@ -1545,6 +1775,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListAffinityGroupsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest /* @@ -1555,6 +1787,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return AffinityGroupListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListAffinityGroupsExecute(ctx context.Context, projectId string, region string) (*AffinityGroupListResponse, error) /* @@ -1566,6 +1799,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiListAttachedVolumesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest /* @@ -1577,6 +1812,7 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @return VolumeAttachmentListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListAttachedVolumesExecute(ctx context.Context, projectId string, region string, serverId string) (*VolumeAttachmentListResponse, error) /* @@ -1586,6 +1822,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param region The STACKIT Region of the resources. @return ApiListAvailabilityZonesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest /* @@ -1595,6 +1833,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return AvailabilityZoneListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListAvailabilityZonesExecute(ctx context.Context, region string) (*AvailabilityZoneListResponse, error) /* @@ -1605,6 +1844,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListBackupsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest /* @@ -1615,6 +1856,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return BackupListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListBackupsExecute(ctx context.Context, projectId string, region string) (*BackupListResponse, error) /* @@ -1625,6 +1867,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListImagesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest /* @@ -1635,6 +1879,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return ImageListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListImagesExecute(ctx context.Context, projectId string, region string) (*ImageListResponse, error) /* @@ -1643,6 +1888,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiListKeyPairsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest /* @@ -1651,6 +1898,7 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return KeyPairListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) /* @@ -1661,6 +1909,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListMachineTypesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest /* @@ -1671,6 +1921,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return MachineTypeListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListMachineTypesExecute(ctx context.Context, projectId string, region string) (*MachineTypeListResponse, error) /* @@ -1681,6 +1932,8 @@ type DefaultApi interface { @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. @return ApiListNetworkAreaProjectsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest /* @@ -1691,6 +1944,7 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @return ProjectListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) /* @@ -1702,6 +1956,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiListNetworkAreaRangesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest /* @@ -1713,6 +1969,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return NetworkRangeListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string, region string) (*NetworkRangeListResponse, error) /* @@ -1723,6 +1980,8 @@ type DefaultApi interface { @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. @return ApiListNetworkAreaRegionsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreaRegions(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRegionsRequest /* @@ -1733,6 +1992,7 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @return RegionalAreaListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreaRegionsExecute(ctx context.Context, organizationId string, areaId string) (*RegionalAreaListResponse, error) /* @@ -1744,6 +2004,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiListNetworkAreaRoutesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest /* @@ -1755,6 +2017,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return RouteListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string, region string) (*RouteListResponse, error) /* @@ -1764,6 +2027,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @return ApiListNetworkAreasRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest /* @@ -1773,6 +2038,7 @@ type DefaultApi interface { @param organizationId The identifier (ID) of a STACKIT Organization. @return NetworkAreaListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) /* @@ -1783,6 +2049,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListNetworksRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest /* @@ -1793,6 +2061,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return NetworkListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNetworksExecute(ctx context.Context, projectId string, region string) (*NetworkListResponse, error) /* @@ -1804,6 +2073,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiListNicsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest /* @@ -1815,6 +2086,7 @@ type DefaultApi interface { @param networkId The identifier (ID) of a STACKIT Network. @return NICListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListNicsExecute(ctx context.Context, projectId string, region string, networkId string) (*NICListResponse, error) /* @@ -1825,6 +2097,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListProjectNICsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest /* @@ -1835,6 +2109,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return NICListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListProjectNICsExecute(ctx context.Context, projectId string, region string) (*NICListResponse, error) /* @@ -1843,6 +2118,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiListPublicIPRangesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest /* @@ -1851,6 +2128,7 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return PublicNetworkListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListPublicIPRangesExecute(ctx context.Context) (*PublicNetworkListResponse, error) /* @@ -1861,6 +2139,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListPublicIPsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest /* @@ -1871,6 +2151,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return PublicIpListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListPublicIPsExecute(ctx context.Context, projectId string, region string) (*PublicIpListResponse, error) /* @@ -1881,6 +2162,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListQuotasRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest /* @@ -1891,6 +2174,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return QuotaListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListQuotasExecute(ctx context.Context, projectId string, region string) (*QuotaListResponse, error) /* @@ -1903,6 +2187,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return ApiListRoutesOfRoutingTableRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest /* @@ -1915,6 +2201,7 @@ type DefaultApi interface { @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return RouteListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListRoutesOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) /* @@ -1926,6 +2213,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiListRoutingTablesOfAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest /* @@ -1937,6 +2226,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return RoutingTableListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListRoutingTablesOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTableListResponse, error) /* @@ -1948,6 +2238,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiListSecurityGroupRulesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest /* @@ -1959,6 +2251,7 @@ type DefaultApi interface { @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return SecurityGroupRuleListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListSecurityGroupRulesExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroupRuleListResponse, error) /* @@ -1969,6 +2262,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListSecurityGroupsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest /* @@ -1979,6 +2274,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return SecurityGroupListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListSecurityGroupsExecute(ctx context.Context, projectId string, region string) (*SecurityGroupListResponse, error) /* @@ -1990,6 +2286,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiListServerNICsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest /* @@ -2001,6 +2299,7 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @return NICListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListServerNICsExecute(ctx context.Context, projectId string, region string, serverId string) (*NICListResponse, error) /* @@ -2012,6 +2311,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiListServerServiceAccountsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest /* @@ -2023,6 +2324,7 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @return ServiceAccountMailListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListServerServiceAccountsExecute(ctx context.Context, projectId string, region string, serverId string) (*ServiceAccountMailListResponse, error) /* @@ -2033,6 +2335,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListServersRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest /* @@ -2043,6 +2347,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return ServerListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListServersExecute(ctx context.Context, projectId string, region string) (*ServerListResponse, error) /* @@ -2053,6 +2358,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListSnapshotsInProjectRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiListSnapshotsInProjectRequest /* @@ -2063,6 +2370,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return SnapshotListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListSnapshotsInProjectExecute(ctx context.Context, projectId string, region string) (*SnapshotListResponse, error) /* @@ -2073,6 +2381,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListVolumePerformanceClassesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest /* @@ -2083,6 +2393,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return VolumePerformanceClassListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListVolumePerformanceClassesExecute(ctx context.Context, projectId string, region string) (*VolumePerformanceClassListResponse, error) /* @@ -2093,6 +2404,8 @@ type DefaultApi interface { @param projectId The identifier (ID) of a STACKIT Project. @param region The STACKIT Region of the resources. @return ApiListVolumesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest /* @@ -2103,6 +2416,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return VolumeListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListVolumesExecute(ctx context.Context, projectId string, region string) (*VolumeListResponse, error) /* @@ -2114,11 +2428,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param networkId The identifier (ID) of a STACKIT Network. @return ApiPartialUpdateNetworkRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest /* PartialUpdateNetworkExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PartialUpdateNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error /* @@ -2129,6 +2446,8 @@ type DefaultApi interface { @param organizationId The identifier (ID) of a STACKIT Organization. @param areaId The identifier (ID) of a STACKIT Network Area. @return ApiPartialUpdateNetworkAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest /* @@ -2139,6 +2458,7 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @return NetworkArea + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PartialUpdateNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) /* @@ -2150,11 +2470,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiRebootServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest /* RebootServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RebootServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* @@ -2167,11 +2490,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param networkId The identifier (ID) of a STACKIT Network. @return ApiRemoveNetworkFromServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest /* RemoveNetworkFromServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveNetworkFromServerExecute(ctx context.Context, projectId string, region string, serverId string, networkId string) error /* @@ -2184,11 +2510,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param nicId The identifier (ID) of a network interface. @return ApiRemoveNicFromServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest /* RemoveNicFromServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveNicFromServerExecute(ctx context.Context, projectId string, region string, serverId string, nicId string) error /* @@ -2201,11 +2530,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param publicIpId The identifier (ID) of a Public IP. @return ApiRemovePublicIpFromServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest /* RemovePublicIpFromServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemovePublicIpFromServerExecute(ctx context.Context, projectId string, region string, serverId string, publicIpId string) error /* @@ -2218,11 +2550,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiRemoveSecurityGroupFromServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest /* RemoveSecurityGroupFromServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) error /* @@ -2235,6 +2570,8 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param serviceAccountMail The e-mail address of a service account. @return ApiRemoveServiceAccountFromServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest /* @@ -2247,6 +2584,7 @@ type DefaultApi interface { @param serviceAccountMail The e-mail address of a service account. @return ServiceAccountMailListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) /* @@ -2259,11 +2597,14 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiRemoveVolumeFromServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest /* RemoveVolumeFromServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RemoveVolumeFromServerExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) error /* @@ -2275,11 +2616,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiRescueServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest /* RescueServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RescueServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* @@ -2291,11 +2635,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiResizeServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest /* ResizeServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ResizeServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* @@ -2307,11 +2654,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiResizeVolumeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest /* ResizeVolumeExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ResizeVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) error /* @@ -2323,11 +2673,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiRestoreBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest /* RestoreBackupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RestoreBackupExecute(ctx context.Context, projectId string, region string, backupId string) error /* @@ -2339,6 +2692,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiSetImageShareRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest /* @@ -2350,6 +2705,7 @@ type DefaultApi interface { @param imageId The identifier (ID) of a STACKIT Image. @return ImageShare + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ SetImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) /* @@ -2361,11 +2717,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiStartServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest /* StartServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ StartServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* @@ -2377,11 +2736,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiStopServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest /* StopServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ StopServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* @@ -2393,11 +2755,14 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiUnrescueServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest /* UnrescueServerExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UnrescueServerExecute(ctx context.Context, projectId string, region string, serverId string) error /* @@ -2410,6 +2775,8 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiUpdateAttachedVolumeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest /* @@ -2422,6 +2789,7 @@ type DefaultApi interface { @param volumeId The identifier (ID) of a STACKIT Volume. @return VolumeAttachment + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateAttachedVolumeExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) /* @@ -2433,6 +2801,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param backupId The identifier (ID) of a STACKIT Backup. @return ApiUpdateBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiUpdateBackupRequest /* @@ -2444,6 +2814,7 @@ type DefaultApi interface { @param backupId The identifier (ID) of a STACKIT Backup. @return Backup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateBackupExecute(ctx context.Context, projectId string, region string, backupId string) (*Backup, error) /* @@ -2455,6 +2826,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiUpdateImageRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest /* @@ -2466,6 +2839,7 @@ type DefaultApi interface { @param imageId The identifier (ID) of a STACKIT Image. @return Image + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateImageExecute(ctx context.Context, projectId string, region string, imageId string) (*Image, error) /* @@ -2477,6 +2851,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param imageId The identifier (ID) of a STACKIT Image. @return ApiUpdateImageShareRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest /* @@ -2488,6 +2864,7 @@ type DefaultApi interface { @param imageId The identifier (ID) of a STACKIT Image. @return ImageShare + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) /* @@ -2497,6 +2874,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param keypairName The name of an SSH keypair. @return ApiUpdateKeyPairRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest /* @@ -2506,6 +2885,7 @@ type DefaultApi interface { @param keypairName The name of an SSH keypair. @return Keypair + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) /* @@ -2517,6 +2897,8 @@ type DefaultApi interface { @param areaId The identifier (ID) of a STACKIT Network Area. @param region The STACKIT Region of the resources. @return ApiUpdateNetworkAreaRegionRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiUpdateNetworkAreaRegionRequest /* @@ -2528,6 +2910,7 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @return RegionalArea + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) /* @@ -2540,6 +2923,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param routeId The identifier (ID) of a STACKIT Route. @return ApiUpdateNetworkAreaRouteRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiUpdateNetworkAreaRouteRequest /* @@ -2552,6 +2937,7 @@ type DefaultApi interface { @param routeId The identifier (ID) of a STACKIT Route. @return Route + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) (*Route, error) /* @@ -2564,6 +2950,8 @@ type DefaultApi interface { @param networkId The identifier (ID) of a STACKIT Network. @param nicId The identifier (ID) of a network interface. @return ApiUpdateNicRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest /* @@ -2576,6 +2964,7 @@ type DefaultApi interface { @param nicId The identifier (ID) of a network interface. @return NIC + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) (*NIC, error) /* @@ -2587,6 +2976,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param publicIpId The identifier (ID) of a Public IP. @return ApiUpdatePublicIPRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest /* @@ -2598,6 +2989,7 @@ type DefaultApi interface { @param publicIpId The identifier (ID) of a Public IP. @return PublicIp + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdatePublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) (*PublicIp, error) /* @@ -2611,6 +3003,8 @@ type DefaultApi interface { @param routingTableId The identifier (ID) of a STACKIT Routing Table. @param routeId The identifier (ID) of a STACKIT Route. @return ApiUpdateRouteOfRoutingTableRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest /* @@ -2624,6 +3018,7 @@ type DefaultApi interface { @param routeId The identifier (ID) of a STACKIT Route. @return Route + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) /* @@ -2636,6 +3031,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return ApiUpdateRoutingTableOfAreaRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest /* @@ -2648,6 +3045,7 @@ type DefaultApi interface { @param routingTableId The identifier (ID) of a STACKIT Routing Table. @return RoutingTable + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) /* @@ -2659,6 +3057,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return ApiUpdateSecurityGroupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiUpdateSecurityGroupRequest /* @@ -2670,6 +3070,7 @@ type DefaultApi interface { @param securityGroupId The identifier (ID) of a STACKIT Security Group. @return SecurityGroup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroup, error) /* @@ -2681,6 +3082,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param serverId The identifier (ID) of a STACKIT Server. @return ApiUpdateServerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest /* @@ -2692,6 +3095,7 @@ type DefaultApi interface { @param serverId The identifier (ID) of a STACKIT Server. @return Server + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateServerExecute(ctx context.Context, projectId string, region string, serverId string) (*Server, error) /* @@ -2703,6 +3107,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return ApiUpdateSnapshotRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiUpdateSnapshotRequest /* @@ -2714,6 +3120,7 @@ type DefaultApi interface { @param snapshotId The identifier (ID) of a STACKIT Snapshot. @return Snapshot + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) (*Snapshot, error) /* @@ -2725,6 +3132,8 @@ type DefaultApi interface { @param region The STACKIT Region of the resources. @param volumeId The identifier (ID) of a STACKIT Volume. @return ApiUpdateVolumeRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest /* @@ -2736,687 +3145,1027 @@ type DefaultApi interface { @param volumeId The identifier (ID) of a STACKIT Volume. @return Volume + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) (*Volume, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiAddNetworkToServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiAddNicToServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiAddPublicIpToServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiAddRoutesToRoutingTableRequest interface { // Request an addition of routes to a routing table. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RouteListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiAddRoutingTableToAreaRequest interface { // Request an addition of a routing table to an area. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RoutingTable, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiAddSecurityGroupToServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiAddServiceAccountToServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ServiceAccountMailListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiAddVolumeToServerRequest interface { // Request a volume attachment creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead AddVolumeToServerPayload(addVolumeToServerPayload AddVolumeToServerPayload) ApiAddVolumeToServerRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*VolumeAttachment, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateAffinityGroupRequest interface { // Request a affinity group creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*AffinityGroup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateBackupRequest interface { // Request a backup creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Backup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateImageRequest interface { // Request an image creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ImageCreateResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateIsolatedNetworkRequest interface { // Request a single isolated network creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateIsolatedNetworkPayload(createIsolatedNetworkPayload CreateIsolatedNetworkPayload) ApiCreateIsolatedNetworkRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Network, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateKeyPairRequest interface { // Request a public key import. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Keypair, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateNetworkRequest interface { // Request a network creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Network, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateNetworkAreaRequest interface { // Request an Area creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NetworkArea, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateNetworkAreaRangeRequest interface { // Request an addition of network ranges to an area. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NetworkRangeListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateNetworkAreaRegionRequest interface { // Request to add a new regional network area configuration. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateNetworkAreaRegionPayload(createNetworkAreaRegionPayload CreateNetworkAreaRegionPayload) ApiCreateNetworkAreaRegionRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RegionalArea, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateNetworkAreaRouteRequest interface { // Request an addition of routes to an area. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RouteListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateNicRequest interface { // Request a network interface creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NIC, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreatePublicIPRequest interface { // Request a public IP creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PublicIp, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateSecurityGroupRequest interface { // Request a security group creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*SecurityGroup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateSecurityGroupRuleRequest interface { // Request for a security group rule creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*SecurityGroupRule, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateServerRequest interface { // Request a server creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Server, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateSnapshotRequest interface { // Request a snapshot creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateSnapshotPayload(createSnapshotPayload CreateSnapshotPayload) ApiCreateSnapshotRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Snapshot, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateVolumeRequest interface { // Request a volume creation. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Volume, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeallocateServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteAffinityGroupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteBackupRequest interface { // Force action. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Force(force bool) ApiDeleteBackupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteImageRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteImageShareRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteImageShareConsumerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteKeyPairRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteNetworkRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteNetworkAreaRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteNetworkAreaRangeRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteNetworkAreaRegionRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteNetworkAreaRouteRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteNicRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeletePublicIPRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteRouteFromRoutingTableRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteRoutingTableFromAreaRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteSecurityGroupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteSecurityGroupRuleRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteSnapshotRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteVolumeRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetAffinityGroupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*AffinityGroup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetAttachedVolumeRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*VolumeAttachment, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetBackupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Backup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetImageRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Image, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetImageShareRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ImageShare, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetImageShareConsumerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ImageShareConsumer, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetKeyPairRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Keypair, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetMachineTypeRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*MachineType, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetNetworkRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Network, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetNetworkAreaRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NetworkArea, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetNetworkAreaRangeRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NetworkRange, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetNetworkAreaRegionRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RegionalArea, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetNetworkAreaRouteRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Route, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetNicRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NIC, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetOrganizationRequestRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Request, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetProjectDetailsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Project, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetProjectNICRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NIC, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetProjectRequestRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Request, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetPublicIPRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PublicIp, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetRouteOfRoutingTableRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Route, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetRoutingTableOfAreaRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RoutingTable, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetSecurityGroupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*SecurityGroup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetSecurityGroupRuleRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*SecurityGroupRule, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetServerRequest interface { // Show detailed information about server. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Details(details bool) ApiGetServerRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Server, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetServerConsoleRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ServerConsoleUrl, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetServerLogRequest interface { // Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Length(length int64) ApiGetServerLogRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetServerLog200Response, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetSnapshotRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Snapshot, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetVolumeRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Volume, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetVolumePerformanceClassRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*VolumePerformanceClass, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiImageFromVolumeRequest interface { // Create an image from a volume. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead ImageFromVolumePayload(imageFromVolumePayload ImageFromVolumePayload) ApiImageFromVolumeRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Image, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListAffinityGroupsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*AffinityGroupListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListAttachedVolumesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*VolumeAttachmentListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListAvailabilityZonesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*AvailabilityZoneListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListBackupsRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListBackupsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*BackupListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListImagesRequest interface { // List all Images. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead All(all bool) ApiListImagesRequest // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListImagesRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ImageListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListKeyPairsRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListKeyPairsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*KeyPairListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListMachineTypesRequest interface { // Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Filter(filter string) ApiListMachineTypesRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*MachineTypeListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListNetworkAreaProjectsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ProjectListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListNetworkAreaRangesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NetworkRangeListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListNetworkAreaRegionsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RegionalAreaListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListNetworkAreaRoutesRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RouteListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListNetworkAreasRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListNetworkAreasRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NetworkAreaListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListNetworksRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListNetworksRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NetworkListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListNicsRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListNicsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NICListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListProjectNICsRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListProjectNICsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NICListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListPublicIPRangesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PublicNetworkListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListPublicIPsRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListPublicIPsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PublicIpListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListQuotasRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*QuotaListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListRoutesOfRoutingTableRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RouteListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListRoutingTablesOfAreaRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RoutingTableListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListSecurityGroupRulesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*SecurityGroupRuleListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListSecurityGroupsRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListSecurityGroupsRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*SecurityGroupListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListServerNICsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NICListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListServerServiceAccountsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ServiceAccountMailListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListServersRequest interface { // Show detailed information about server. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Details(details bool) ApiListServersRequest // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListServersRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ServerListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListSnapshotsInProjectRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListSnapshotsInProjectRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*SnapshotListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListVolumePerformanceClassesRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*VolumePerformanceClassListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListVolumesRequest interface { // Filter resources by labels. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead LabelSelector(labelSelector string) ApiListVolumesRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*VolumeListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPartialUpdateNetworkRequest interface { // Request an update of a network. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPartialUpdateNetworkAreaRequest interface { // Request to update an Area. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NetworkArea, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRebootServerRequest interface { // Defines if it is a soft or a hard reboot. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Action(action string) ApiRebootServerRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRemoveNetworkFromServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRemoveNicFromServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRemovePublicIpFromServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRemoveSecurityGroupFromServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRemoveServiceAccountFromServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ServiceAccountMailListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRemoveVolumeFromServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRescueServerRequest interface { // Request a server rescue. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiResizeServerRequest interface { // Request a resize of a server. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiResizeVolumeRequest interface { // Request a volume resize. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRestoreBackupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiSetImageShareRequest interface { // Settings for an Image Share. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ImageShare, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiStartServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiStopServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUnrescueServerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateAttachedVolumeRequest interface { // Request a volume attachment update. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*VolumeAttachment, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateBackupRequest interface { // Request an update of a backup. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateBackupPayload(updateBackupPayload UpdateBackupPayload) ApiUpdateBackupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Backup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateImageRequest interface { // Request an update of an Image. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Image, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateImageShareRequest interface { // Update an Image Share. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ImageShare, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateKeyPairRequest interface { // Request an update of an SSH keypair. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Keypair, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateNetworkAreaRegionRequest interface { // Request an update of a regional network area. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateNetworkAreaRegionPayload(updateNetworkAreaRegionPayload UpdateNetworkAreaRegionPayload) ApiUpdateNetworkAreaRegionRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RegionalArea, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateNetworkAreaRouteRequest interface { // Request an update of a network route. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload UpdateNetworkAreaRoutePayload) ApiUpdateNetworkAreaRouteRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Route, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateNicRequest interface { // Request an update of a network interface. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*NIC, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdatePublicIPRequest interface { // Request an update of a public IP. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*PublicIp, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateRouteOfRoutingTableRequest interface { // Request an update of a route in a routing table. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Route, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateRoutingTableOfAreaRequest interface { // Request an update of a routing table. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*RoutingTable, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateSecurityGroupRequest interface { // Request an update of a security group. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateSecurityGroupPayload(updateSecurityGroupPayload UpdateSecurityGroupPayload) ApiUpdateSecurityGroupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*SecurityGroup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateServerRequest interface { // Request an update of a server. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Server, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateSnapshotRequest interface { // Request an update of a snapshot. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateSnapshotPayload(updateSnapshotPayload UpdateSnapshotPayload) ApiUpdateSnapshotRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Snapshot, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateVolumeRequest interface { // Request an update of a volume. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Volume, error) } // DefaultApiService DefaultApi service +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApiService service +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddNetworkToServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -3426,6 +4175,7 @@ type AddNetworkToServerRequest struct { networkId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddNetworkToServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -3582,7 +4332,7 @@ func (r AddNetworkToServerRequest) Execute() error { /* AddNetworkToServer: Create and attach a network interface from the specified network. -Create and attach a network interface from the specified network to the server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -3602,6 +4352,7 @@ func (a *APIClient) AddNetworkToServer(ctx context.Context, projectId string, re } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) AddNetworkToServerExecute(ctx context.Context, projectId string, region string, serverId string, networkId string) error { r := AddNetworkToServerRequest{ apiService: a.defaultApi, @@ -3614,6 +4365,7 @@ func (a *APIClient) AddNetworkToServerExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddNicToServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -3623,6 +4375,7 @@ type AddNicToServerRequest struct { nicId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddNicToServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPut @@ -3790,7 +4543,7 @@ func (r AddNicToServerRequest) Execute() error { /* AddNicToServer: Attach an existing network interface. -Attach an existing network interface to a server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -3810,6 +4563,7 @@ func (a *APIClient) AddNicToServer(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) AddNicToServerExecute(ctx context.Context, projectId string, region string, serverId string, nicId string) error { r := AddNicToServerRequest{ apiService: a.defaultApi, @@ -3822,6 +4576,7 @@ func (a *APIClient) AddNicToServerExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddPublicIpToServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -3831,6 +4586,7 @@ type AddPublicIpToServerRequest struct { publicIpId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddPublicIpToServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPut @@ -3998,7 +4754,7 @@ func (r AddPublicIpToServerRequest) Execute() error { /* AddPublicIpToServer: Associate a public IP to the server. -Associate a public IP to a server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -4018,6 +4774,7 @@ func (a *APIClient) AddPublicIpToServer(ctx context.Context, projectId string, r } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) AddPublicIpToServerExecute(ctx context.Context, projectId string, region string, serverId string, publicIpId string) error { r := AddPublicIpToServerRequest{ apiService: a.defaultApi, @@ -4030,6 +4787,7 @@ func (a *APIClient) AddPublicIpToServerExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutesToRoutingTableRequest struct { ctx context.Context apiService *DefaultApiService @@ -4041,12 +4799,13 @@ type AddRoutesToRoutingTableRequest struct { } // Request an addition of routes to a routing table. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddRoutesToRoutingTableRequest) AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest { r.addRoutesToRoutingTablePayload = &addRoutesToRoutingTablePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddRoutesToRoutingTableRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -4230,7 +4989,7 @@ func (r AddRoutesToRoutingTableRequest) Execute() (*RouteListResponse, error) { /* AddRoutesToRoutingTable: Create new routes in a routing table. -Create new routes in an existing routing table. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -4250,6 +5009,7 @@ func (a *APIClient) AddRoutesToRoutingTable(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) AddRoutesToRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) { r := AddRoutesToRoutingTableRequest{ apiService: a.defaultApi, @@ -4262,6 +5022,7 @@ func (a *APIClient) AddRoutesToRoutingTableExecute(ctx context.Context, organiza return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -4272,12 +5033,13 @@ type AddRoutingTableToAreaRequest struct { } // Request an addition of a routing table to an area. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddRoutingTableToAreaRequest) AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest { r.addRoutingTableToAreaPayload = &addRoutingTableToAreaPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddRoutingTableToAreaRequest) Execute() (*RoutingTable, error) { var ( localVarHTTPMethod = http.MethodPost @@ -4454,7 +5216,7 @@ func (r AddRoutingTableToAreaRequest) Execute() (*RoutingTable, error) { /* AddRoutingTableToArea: Create new routing table in a network area. -Create a new routing table in an existing network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -4472,6 +5234,7 @@ func (a *APIClient) AddRoutingTableToArea(ctx context.Context, organizationId st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) AddRoutingTableToAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTable, error) { r := AddRoutingTableToAreaRequest{ apiService: a.defaultApi, @@ -4483,6 +5246,7 @@ func (a *APIClient) AddRoutingTableToAreaExecute(ctx context.Context, organizati return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddSecurityGroupToServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -4492,6 +5256,7 @@ type AddSecurityGroupToServerRequest struct { securityGroupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddSecurityGroupToServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPut @@ -4659,7 +5424,7 @@ func (r AddSecurityGroupToServerRequest) Execute() error { /* AddSecurityGroupToServer: Add a server to a security group. -Add an existing server to an existing security group. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -4679,6 +5444,7 @@ func (a *APIClient) AddSecurityGroupToServer(ctx context.Context, projectId stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) AddSecurityGroupToServerExecute(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) error { r := AddSecurityGroupToServerRequest{ apiService: a.defaultApi, @@ -4691,6 +5457,7 @@ func (a *APIClient) AddSecurityGroupToServerExecute(ctx context.Context, project return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddServiceAccountToServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -4700,6 +5467,7 @@ type AddServiceAccountToServerRequest struct { serviceAccountMail string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResponse, error) { var ( localVarHTTPMethod = http.MethodPut @@ -4875,7 +5643,7 @@ func (r AddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResp /* AddServiceAccountToServer: Attach service account to a server. -Attach an additional service account to the server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -4895,6 +5663,7 @@ func (a *APIClient) AddServiceAccountToServer(ctx context.Context, projectId str } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) AddServiceAccountToServerExecute(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { r := AddServiceAccountToServerRequest{ apiService: a.defaultApi, @@ -4907,6 +5676,7 @@ func (a *APIClient) AddServiceAccountToServerExecute(ctx context.Context, projec return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -4918,12 +5688,13 @@ type AddVolumeToServerRequest struct { } // Request a volume attachment creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddVolumeToServerRequest) AddVolumeToServerPayload(addVolumeToServerPayload AddVolumeToServerPayload) ApiAddVolumeToServerRequest { r.addVolumeToServerPayload = &addVolumeToServerPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r AddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { var ( localVarHTTPMethod = http.MethodPut @@ -5104,7 +5875,7 @@ func (r AddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { /* AddVolumeToServer: Attach a volume to a server. -Attach an existing volume to an existing server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -5124,6 +5895,7 @@ func (a *APIClient) AddVolumeToServer(ctx context.Context, projectId string, reg } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) AddVolumeToServerExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) { r := AddVolumeToServerRequest{ apiService: a.defaultApi, @@ -5136,6 +5908,7 @@ func (a *APIClient) AddVolumeToServerExecute(ctx context.Context, projectId stri return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupRequest struct { ctx context.Context apiService *DefaultApiService @@ -5145,12 +5918,13 @@ type CreateAffinityGroupRequest struct { } // Request a affinity group creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateAffinityGroupRequest) CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest { r.createAffinityGroupPayload = &createAffinityGroupPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { var ( localVarHTTPMethod = http.MethodPost @@ -5309,7 +6083,7 @@ func (r CreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { /* CreateAffinityGroup: Create a new affinity group in a project. -Create a new server affinity group in the given project ID. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -5325,6 +6099,7 @@ func (a *APIClient) CreateAffinityGroup(ctx context.Context, projectId string, r } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateAffinityGroupExecute(ctx context.Context, projectId string, region string) (*AffinityGroup, error) { r := CreateAffinityGroupRequest{ apiService: a.defaultApi, @@ -5335,6 +6110,7 @@ func (a *APIClient) CreateAffinityGroupExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -5344,12 +6120,13 @@ type CreateBackupRequest struct { } // Request a backup creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { r.createBackupPayload = &createBackupPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateBackupRequest) Execute() (*Backup, error) { var ( localVarHTTPMethod = http.MethodPost @@ -5508,7 +6285,7 @@ func (r CreateBackupRequest) Execute() (*Backup, error) { /* CreateBackup: Create new Backup. -Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -5524,6 +6301,7 @@ func (a *APIClient) CreateBackup(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, region string) (*Backup, error) { r := CreateBackupRequest{ apiService: a.defaultApi, @@ -5534,6 +6312,7 @@ func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImageRequest struct { ctx context.Context apiService *DefaultApiService @@ -5543,12 +6322,13 @@ type CreateImageRequest struct { } // Request an image creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { r.createImagePayload = &createImagePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -5718,7 +6498,7 @@ func (r CreateImageRequest) Execute() (*ImageCreateResponse, error) { /* CreateImage: Create new Image. -Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -5734,6 +6514,7 @@ func (a *APIClient) CreateImage(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateImageExecute(ctx context.Context, projectId string, region string) (*ImageCreateResponse, error) { r := CreateImageRequest{ apiService: a.defaultApi, @@ -5744,6 +6525,7 @@ func (a *APIClient) CreateImageExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkRequest struct { ctx context.Context apiService *DefaultApiService @@ -5753,12 +6535,13 @@ type CreateIsolatedNetworkRequest struct { } // Request a single isolated network creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateIsolatedNetworkRequest) CreateIsolatedNetworkPayload(createIsolatedNetworkPayload CreateIsolatedNetworkPayload) ApiCreateIsolatedNetworkRequest { r.createIsolatedNetworkPayload = &createIsolatedNetworkPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateIsolatedNetworkRequest) Execute() (*Network, error) { var ( localVarHTTPMethod = http.MethodPost @@ -5928,7 +6711,7 @@ func (r CreateIsolatedNetworkRequest) Execute() (*Network, error) { /* CreateIsolatedNetwork: Create a single isolated network. -Creates an isolated network which is not connected to other networks in this project. We recommend using this endpoint only if you are fully aware of its purpose and the consequences of its execution. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -5944,6 +6727,7 @@ func (a *APIClient) CreateIsolatedNetwork(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateIsolatedNetworkExecute(ctx context.Context, projectId string, region string) (*Network, error) { r := CreateIsolatedNetworkRequest{ apiService: a.defaultApi, @@ -5954,6 +6738,7 @@ func (a *APIClient) CreateIsolatedNetworkExecute(ctx context.Context, projectId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairRequest struct { ctx context.Context apiService *DefaultApiService @@ -5961,12 +6746,13 @@ type CreateKeyPairRequest struct { } // Request a public key import. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { r.createKeyPairPayload = &createKeyPairPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateKeyPairRequest) Execute() (*Keypair, error) { var ( localVarHTTPMethod = http.MethodPost @@ -6128,7 +6914,7 @@ func (r CreateKeyPairRequest) Execute() (*Keypair, error) { /* CreateKeyPair: Import a public key. -Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiCreateKeyPairRequest @@ -6140,6 +6926,7 @@ func (a *APIClient) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateKeyPairExecute(ctx context.Context) (*Keypair, error) { r := CreateKeyPairRequest{ apiService: a.defaultApi, @@ -6148,6 +6935,7 @@ func (a *APIClient) CreateKeyPairExecute(ctx context.Context) (*Keypair, error) return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkRequest struct { ctx context.Context apiService *DefaultApiService @@ -6157,12 +6945,13 @@ type CreateNetworkRequest struct { } // Request a network creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { r.createNetworkPayload = &createNetworkPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkRequest) Execute() (*Network, error) { var ( localVarHTTPMethod = http.MethodPost @@ -6332,7 +7121,7 @@ func (r CreateNetworkRequest) Execute() (*Network, error) { /* CreateNetwork: Create new network. -Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -6348,6 +7137,7 @@ func (a *APIClient) CreateNetwork(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateNetworkExecute(ctx context.Context, projectId string, region string) (*Network, error) { r := CreateNetworkRequest{ apiService: a.defaultApi, @@ -6358,6 +7148,7 @@ func (a *APIClient) CreateNetworkExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -6366,12 +7157,13 @@ type CreateNetworkAreaRequest struct { } // Request an Area creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkAreaRequest) CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest { r.createNetworkAreaPayload = &createNetworkAreaPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkAreaRequest) Execute() (*NetworkArea, error) { var ( localVarHTTPMethod = http.MethodPost @@ -6529,7 +7321,7 @@ func (r CreateNetworkAreaRequest) Execute() (*NetworkArea, error) { /* CreateNetworkArea: Create new network area in an organization. -Create a new network area in an organization. You can specify `"preview/routingtables"="true"` as a label to enable the preview routing tables feature. This feature cannot be enabled or disabled afterwards. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -6543,6 +7335,7 @@ func (a *APIClient) CreateNetworkArea(ctx context.Context, organizationId string } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateNetworkAreaExecute(ctx context.Context, organizationId string) (*NetworkArea, error) { r := CreateNetworkAreaRequest{ apiService: a.defaultApi, @@ -6552,6 +7345,7 @@ func (a *APIClient) CreateNetworkAreaExecute(ctx context.Context, organizationId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRangeRequest struct { ctx context.Context apiService *DefaultApiService @@ -6562,12 +7356,13 @@ type CreateNetworkAreaRangeRequest struct { } // Request an addition of network ranges to an area. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkAreaRangeRequest) CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest { r.createNetworkAreaRangePayload = &createNetworkAreaRangePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -6744,7 +7539,7 @@ func (r CreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, err /* CreateNetworkAreaRange: Create new network range in a network area. -Create a new network range in an existing network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -6762,6 +7557,7 @@ func (a *APIClient) CreateNetworkAreaRange(ctx context.Context, organizationId s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string) (*NetworkRangeListResponse, error) { r := CreateNetworkAreaRangeRequest{ apiService: a.defaultApi, @@ -6773,6 +7569,7 @@ func (a *APIClient) CreateNetworkAreaRangeExecute(ctx context.Context, organizat return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRegionRequest struct { ctx context.Context apiService *DefaultApiService @@ -6783,12 +7580,13 @@ type CreateNetworkAreaRegionRequest struct { } // Request to add a new regional network area configuration. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkAreaRegionRequest) CreateNetworkAreaRegionPayload(createNetworkAreaRegionPayload CreateNetworkAreaRegionPayload) ApiCreateNetworkAreaRegionRequest { r.createNetworkAreaRegionPayload = &createNetworkAreaRegionPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { var ( localVarHTTPMethod = http.MethodPut @@ -6965,7 +7763,7 @@ func (r CreateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { /* CreateNetworkAreaRegion: Configure a region for a network area. -Configure a new region for a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -6983,6 +7781,7 @@ func (a *APIClient) CreateNetworkAreaRegion(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) { r := CreateNetworkAreaRegionRequest{ apiService: a.defaultApi, @@ -6994,6 +7793,7 @@ func (a *APIClient) CreateNetworkAreaRegionExecute(ctx context.Context, organiza return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRouteRequest struct { ctx context.Context apiService *DefaultApiService @@ -7004,12 +7804,13 @@ type CreateNetworkAreaRouteRequest struct { } // Request an addition of routes to an area. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkAreaRouteRequest) CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest { r.createNetworkAreaRoutePayload = &createNetworkAreaRoutePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodPost @@ -7186,7 +7987,7 @@ func (r CreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { /* CreateNetworkAreaRoute: Create new network routes. -Create one or several new network routes in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -7204,6 +8005,7 @@ func (a *APIClient) CreateNetworkAreaRoute(ctx context.Context, organizationId s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string) (*RouteListResponse, error) { r := CreateNetworkAreaRouteRequest{ apiService: a.defaultApi, @@ -7215,6 +8017,7 @@ func (a *APIClient) CreateNetworkAreaRouteExecute(ctx context.Context, organizat return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicRequest struct { ctx context.Context apiService *DefaultApiService @@ -7225,12 +8028,13 @@ type CreateNicRequest struct { } // Request a network interface creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { r.createNicPayload = &createNicPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateNicRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodPost @@ -7418,7 +8222,7 @@ func (r CreateNicRequest) Execute() (*NIC, error) { /* CreateNic: Create new network interface. -Create a new network interface in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -7436,6 +8240,7 @@ func (a *APIClient) CreateNic(ctx context.Context, projectId string, region stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateNicExecute(ctx context.Context, projectId string, region string, networkId string) (*NIC, error) { r := CreateNicRequest{ apiService: a.defaultApi, @@ -7447,6 +8252,7 @@ func (a *APIClient) CreateNicExecute(ctx context.Context, projectId string, regi return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPRequest struct { ctx context.Context apiService *DefaultApiService @@ -7456,12 +8262,13 @@ type CreatePublicIPRequest struct { } // Request a public IP creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { r.createPublicIPPayload = &createPublicIPPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreatePublicIPRequest) Execute() (*PublicIp, error) { var ( localVarHTTPMethod = http.MethodPost @@ -7631,7 +8438,7 @@ func (r CreatePublicIPRequest) Execute() (*PublicIp, error) { /* CreatePublicIP: Create new public IP. -Create a new public IP in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -7647,6 +8454,7 @@ func (a *APIClient) CreatePublicIP(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreatePublicIPExecute(ctx context.Context, projectId string, region string) (*PublicIp, error) { r := CreatePublicIPRequest{ apiService: a.defaultApi, @@ -7657,6 +8465,7 @@ func (a *APIClient) CreatePublicIPExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRequest struct { ctx context.Context apiService *DefaultApiService @@ -7666,12 +8475,13 @@ type CreateSecurityGroupRequest struct { } // Request a security group creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { r.createSecurityGroupPayload = &createSecurityGroupPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( localVarHTTPMethod = http.MethodPost @@ -7830,7 +8640,7 @@ func (r CreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { /* CreateSecurityGroup: Create new security group. -Create a new security group in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -7846,6 +8656,7 @@ func (a *APIClient) CreateSecurityGroup(ctx context.Context, projectId string, r } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateSecurityGroupExecute(ctx context.Context, projectId string, region string) (*SecurityGroup, error) { r := CreateSecurityGroupRequest{ apiService: a.defaultApi, @@ -7856,6 +8667,7 @@ func (a *APIClient) CreateSecurityGroupExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRuleRequest struct { ctx context.Context apiService *DefaultApiService @@ -7866,12 +8678,13 @@ type CreateSecurityGroupRuleRequest struct { } // Request for a security group rule creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { var ( localVarHTTPMethod = http.MethodPost @@ -8037,7 +8850,7 @@ func (r CreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { /* CreateSecurityGroupRule: Create new security group rule. -Create a new security group rule in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -8055,6 +8868,7 @@ func (a *APIClient) CreateSecurityGroupRule(ctx context.Context, projectId strin } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroupRule, error) { r := CreateSecurityGroupRuleRequest{ apiService: a.defaultApi, @@ -8066,6 +8880,7 @@ func (a *APIClient) CreateSecurityGroupRuleExecute(ctx context.Context, projectI return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -8075,12 +8890,13 @@ type CreateServerRequest struct { } // Request a server creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateServerRequest) CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest { r.createServerPayload = &createServerPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateServerRequest) Execute() (*Server, error) { var ( localVarHTTPMethod = http.MethodPost @@ -8239,7 +9055,7 @@ func (r CreateServerRequest) Execute() (*Server, error) { /* CreateServer: Create new server. -Create a new server in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -8255,6 +9071,7 @@ func (a *APIClient) CreateServer(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string, region string) (*Server, error) { r := CreateServerRequest{ apiService: a.defaultApi, @@ -8265,6 +9082,7 @@ func (a *APIClient) CreateServerExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotRequest struct { ctx context.Context apiService *DefaultApiService @@ -8274,12 +9092,13 @@ type CreateSnapshotRequest struct { } // Request a snapshot creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateSnapshotRequest) CreateSnapshotPayload(createSnapshotPayload CreateSnapshotPayload) ApiCreateSnapshotRequest { r.createSnapshotPayload = &createSnapshotPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateSnapshotRequest) Execute() (*Snapshot, error) { var ( localVarHTTPMethod = http.MethodPost @@ -8438,7 +9257,7 @@ func (r CreateSnapshotRequest) Execute() (*Snapshot, error) { /* CreateSnapshot: Create new Snapshot. -Create a new Snapshot from a Volume in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -8454,6 +9273,7 @@ func (a *APIClient) CreateSnapshot(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateSnapshotExecute(ctx context.Context, projectId string, region string) (*Snapshot, error) { r := CreateSnapshotRequest{ apiService: a.defaultApi, @@ -8464,6 +9284,7 @@ func (a *APIClient) CreateSnapshotExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -8473,12 +9294,13 @@ type CreateVolumeRequest struct { } // Request a volume creation. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { r.createVolumePayload = &createVolumePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateVolumeRequest) Execute() (*Volume, error) { var ( localVarHTTPMethod = http.MethodPost @@ -8637,7 +9459,7 @@ func (r CreateVolumeRequest) Execute() (*Volume, error) { /* CreateVolume: Create new volume. -Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -8653,6 +9475,7 @@ func (a *APIClient) CreateVolume(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string, region string) (*Volume, error) { r := CreateVolumeRequest{ apiService: a.defaultApi, @@ -8663,6 +9486,7 @@ func (a *APIClient) CreateVolumeExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeallocateServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -8671,6 +9495,7 @@ type DeallocateServerRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeallocateServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -8831,7 +9656,7 @@ func (r DeallocateServerRequest) Execute() error { /* DeallocateServer: Deallocate an existing server. -Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -8849,6 +9674,7 @@ func (a *APIClient) DeallocateServer(ctx context.Context, projectId string, regi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := DeallocateServerRequest{ apiService: a.defaultApi, @@ -8860,6 +9686,7 @@ func (a *APIClient) DeallocateServerExecute(ctx context.Context, projectId strin return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteAffinityGroupRequest struct { ctx context.Context apiService *DefaultApiService @@ -8868,6 +9695,7 @@ type DeleteAffinityGroupRequest struct { affinityGroupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteAffinityGroupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -9017,7 +9845,7 @@ func (r DeleteAffinityGroupRequest) Execute() error { /* DeleteAffinityGroup: Delete a affinity group in a project. -Delete a affinity group in the given project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -9035,6 +9863,7 @@ func (a *APIClient) DeleteAffinityGroup(ctx context.Context, projectId string, r } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteAffinityGroupExecute(ctx context.Context, projectId string, region string, affinityGroupId string) error { r := DeleteAffinityGroupRequest{ apiService: a.defaultApi, @@ -9046,6 +9875,7 @@ func (a *APIClient) DeleteAffinityGroupExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -9056,12 +9886,13 @@ type DeleteBackupRequest struct { } // Force action. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { r.force = &force return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteBackupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -9214,7 +10045,7 @@ func (r DeleteBackupRequest) Execute() error { /* DeleteBackup: Delete a backup. -Delete a backup that is part of the project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -9232,6 +10063,7 @@ func (a *APIClient) DeleteBackup(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteBackupExecute(ctx context.Context, projectId string, region string, backupId string) error { r := DeleteBackupRequest{ apiService: a.defaultApi, @@ -9243,6 +10075,7 @@ func (a *APIClient) DeleteBackupExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteImageRequest struct { ctx context.Context apiService *DefaultApiService @@ -9251,6 +10084,7 @@ type DeleteImageRequest struct { imageId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteImageRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -9400,7 +10234,7 @@ func (r DeleteImageRequest) Execute() error { /* DeleteImage: Delete an Image. -Delete an image that is part of the project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -9418,6 +10252,7 @@ func (a *APIClient) DeleteImage(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteImageExecute(ctx context.Context, projectId string, region string, imageId string) error { r := DeleteImageRequest{ apiService: a.defaultApi, @@ -9429,6 +10264,7 @@ func (a *APIClient) DeleteImageExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteImageShareRequest struct { ctx context.Context apiService *DefaultApiService @@ -9437,6 +10273,7 @@ type DeleteImageShareRequest struct { imageId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteImageShareRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -9586,7 +10423,7 @@ func (r DeleteImageShareRequest) Execute() error { /* DeleteImageShare: Remove image share. -Remove the image share. New scope will be local. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -9604,6 +10441,7 @@ func (a *APIClient) DeleteImageShare(ctx context.Context, projectId string, regi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteImageShareExecute(ctx context.Context, projectId string, region string, imageId string) error { r := DeleteImageShareRequest{ apiService: a.defaultApi, @@ -9615,6 +10453,7 @@ func (a *APIClient) DeleteImageShareExecute(ctx context.Context, projectId strin return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteImageShareConsumerRequest struct { ctx context.Context apiService *DefaultApiService @@ -9624,6 +10463,7 @@ type DeleteImageShareConsumerRequest struct { consumerProjectId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteImageShareConsumerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -9780,7 +10620,7 @@ func (r DeleteImageShareConsumerRequest) Execute() error { /* DeleteImageShareConsumer: Remove an image share consumer. -Remove consumer from a shared image. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -9800,6 +10640,7 @@ func (a *APIClient) DeleteImageShareConsumer(ctx context.Context, projectId stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteImageShareConsumerExecute(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) error { r := DeleteImageShareConsumerRequest{ apiService: a.defaultApi, @@ -9812,12 +10653,14 @@ func (a *APIClient) DeleteImageShareConsumerExecute(ctx context.Context, project return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteKeyPairRequest struct { ctx context.Context apiService *DefaultApiService keypairName string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteKeyPairRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -9956,7 +10799,7 @@ func (r DeleteKeyPairRequest) Execute() error { /* DeleteKeyPair: Delete an SSH keypair. -Delete an SSH keypair from a user. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param keypairName The name of an SSH keypair. @@ -9970,6 +10813,7 @@ func (a *APIClient) DeleteKeyPair(ctx context.Context, keypairName string) ApiDe } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string) error { r := DeleteKeyPairRequest{ apiService: a.defaultApi, @@ -9979,6 +10823,7 @@ func (a *APIClient) DeleteKeyPairExecute(ctx context.Context, keypairName string return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteNetworkRequest struct { ctx context.Context apiService *DefaultApiService @@ -9987,6 +10832,7 @@ type DeleteNetworkRequest struct { networkId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteNetworkRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -10147,7 +10993,7 @@ func (r DeleteNetworkRequest) Execute() error { /* DeleteNetwork: Delete network. -Delete a network. If the network is still in use, the deletion will fail. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -10165,6 +11011,7 @@ func (a *APIClient) DeleteNetwork(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error { r := DeleteNetworkRequest{ apiService: a.defaultApi, @@ -10176,6 +11023,7 @@ func (a *APIClient) DeleteNetworkExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteNetworkAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -10183,6 +11031,7 @@ type DeleteNetworkAreaRequest struct { areaId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteNetworkAreaRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -10342,7 +11191,7 @@ func (r DeleteNetworkAreaRequest) Execute() error { /* DeleteNetworkArea: Delete a network area. -Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -10358,6 +11207,7 @@ func (a *APIClient) DeleteNetworkArea(ctx context.Context, organizationId string } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) error { r := DeleteNetworkAreaRequest{ apiService: a.defaultApi, @@ -10368,6 +11218,7 @@ func (a *APIClient) DeleteNetworkAreaExecute(ctx context.Context, organizationId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteNetworkAreaRangeRequest struct { ctx context.Context apiService *DefaultApiService @@ -10377,6 +11228,7 @@ type DeleteNetworkAreaRangeRequest struct { networkRangeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteNetworkAreaRangeRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -10544,7 +11396,7 @@ func (r DeleteNetworkAreaRangeRequest) Execute() error { /* DeleteNetworkAreaRange: Delete a network range. -Delete a network range of a network area. The deletion will fail if the network range is still used. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -10564,6 +11416,7 @@ func (a *APIClient) DeleteNetworkAreaRange(ctx context.Context, organizationId s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) error { r := DeleteNetworkAreaRangeRequest{ apiService: a.defaultApi, @@ -10576,6 +11429,7 @@ func (a *APIClient) DeleteNetworkAreaRangeExecute(ctx context.Context, organizat return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteNetworkAreaRegionRequest struct { ctx context.Context apiService *DefaultApiService @@ -10584,6 +11438,7 @@ type DeleteNetworkAreaRegionRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteNetworkAreaRegionRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -10744,7 +11599,7 @@ func (r DeleteNetworkAreaRegionRequest) Execute() error { /* DeleteNetworkAreaRegion: Delete a configuration of region for a network area. -Delete a current configuration of region for a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -10762,6 +11617,7 @@ func (a *APIClient) DeleteNetworkAreaRegion(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) error { r := DeleteNetworkAreaRegionRequest{ apiService: a.defaultApi, @@ -10773,6 +11629,7 @@ func (a *APIClient) DeleteNetworkAreaRegionExecute(ctx context.Context, organiza return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteNetworkAreaRouteRequest struct { ctx context.Context apiService *DefaultApiService @@ -10782,6 +11639,7 @@ type DeleteNetworkAreaRouteRequest struct { routeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteNetworkAreaRouteRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -10938,7 +11796,7 @@ func (r DeleteNetworkAreaRouteRequest) Execute() error { /* DeleteNetworkAreaRoute: Delete a network route. -Delete a network route of a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -10958,6 +11816,7 @@ func (a *APIClient) DeleteNetworkAreaRoute(ctx context.Context, organizationId s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) error { r := DeleteNetworkAreaRouteRequest{ apiService: a.defaultApi, @@ -10970,6 +11829,7 @@ func (a *APIClient) DeleteNetworkAreaRouteExecute(ctx context.Context, organizat return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteNicRequest struct { ctx context.Context apiService *DefaultApiService @@ -10979,6 +11839,7 @@ type DeleteNicRequest struct { nicId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteNicRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -11135,7 +11996,7 @@ func (r DeleteNicRequest) Execute() error { /* DeleteNic: Delete a network interface. -Delete a network interface that is part of the project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -11155,6 +12016,7 @@ func (a *APIClient) DeleteNic(ctx context.Context, projectId string, region stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) error { r := DeleteNicRequest{ apiService: a.defaultApi, @@ -11167,6 +12029,7 @@ func (a *APIClient) DeleteNicExecute(ctx context.Context, projectId string, regi return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeletePublicIPRequest struct { ctx context.Context apiService *DefaultApiService @@ -11175,6 +12038,7 @@ type DeletePublicIPRequest struct { publicIpId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeletePublicIPRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -11324,7 +12188,7 @@ func (r DeletePublicIPRequest) Execute() error { /* DeletePublicIP: Delete a public IP. -Delete a public IP that is part of the project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -11342,6 +12206,7 @@ func (a *APIClient) DeletePublicIP(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) error { r := DeletePublicIPRequest{ apiService: a.defaultApi, @@ -11353,6 +12218,7 @@ func (a *APIClient) DeletePublicIPExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteRouteFromRoutingTableRequest struct { ctx context.Context apiService *DefaultApiService @@ -11363,6 +12229,7 @@ type DeleteRouteFromRoutingTableRequest struct { routeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteRouteFromRoutingTableRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -11526,7 +12393,7 @@ func (r DeleteRouteFromRoutingTableRequest) Execute() error { /* DeleteRouteFromRoutingTable: Delete a route in a routing table. -Delete a route in an existing routing table. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -11548,6 +12415,7 @@ func (a *APIClient) DeleteRouteFromRoutingTable(ctx context.Context, organizatio } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteRouteFromRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) error { r := DeleteRouteFromRoutingTableRequest{ apiService: a.defaultApi, @@ -11561,6 +12429,7 @@ func (a *APIClient) DeleteRouteFromRoutingTableExecute(ctx context.Context, orga return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteRoutingTableFromAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -11570,6 +12439,7 @@ type DeleteRoutingTableFromAreaRequest struct { routingTableId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteRoutingTableFromAreaRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -11726,7 +12596,7 @@ func (r DeleteRoutingTableFromAreaRequest) Execute() error { /* DeleteRoutingTableFromArea: Delete a routing table. -Delete a routing table of a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -11746,6 +12616,7 @@ func (a *APIClient) DeleteRoutingTableFromArea(ctx context.Context, organization } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteRoutingTableFromAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) error { r := DeleteRoutingTableFromAreaRequest{ apiService: a.defaultApi, @@ -11758,6 +12629,7 @@ func (a *APIClient) DeleteRoutingTableFromAreaExecute(ctx context.Context, organ return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteSecurityGroupRequest struct { ctx context.Context apiService *DefaultApiService @@ -11766,6 +12638,7 @@ type DeleteSecurityGroupRequest struct { securityGroupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteSecurityGroupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -11926,7 +12799,7 @@ func (r DeleteSecurityGroupRequest) Execute() error { /* DeleteSecurityGroup: Delete security group. -Delete a security group. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -11944,6 +12817,7 @@ func (a *APIClient) DeleteSecurityGroup(ctx context.Context, projectId string, r } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) error { r := DeleteSecurityGroupRequest{ apiService: a.defaultApi, @@ -11955,6 +12829,7 @@ func (a *APIClient) DeleteSecurityGroupExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteSecurityGroupRuleRequest struct { ctx context.Context apiService *DefaultApiService @@ -11964,6 +12839,7 @@ type DeleteSecurityGroupRuleRequest struct { securityGroupRuleId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteSecurityGroupRuleRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -12120,7 +12996,7 @@ func (r DeleteSecurityGroupRuleRequest) Execute() error { /* DeleteSecurityGroupRule: Delete security group rule. -Delete a security group rule. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -12140,6 +13016,7 @@ func (a *APIClient) DeleteSecurityGroupRule(ctx context.Context, projectId strin } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) error { r := DeleteSecurityGroupRuleRequest{ apiService: a.defaultApi, @@ -12152,6 +13029,7 @@ func (a *APIClient) DeleteSecurityGroupRuleExecute(ctx context.Context, projectI return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -12160,6 +13038,7 @@ type DeleteServerRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -12309,7 +13188,7 @@ func (r DeleteServerRequest) Execute() error { /* DeleteServer: Delete a server. -Delete a server. Volumes won't be deleted. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -12327,6 +13206,7 @@ func (a *APIClient) DeleteServer(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := DeleteServerRequest{ apiService: a.defaultApi, @@ -12338,6 +13218,7 @@ func (a *APIClient) DeleteServerExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteSnapshotRequest struct { ctx context.Context apiService *DefaultApiService @@ -12346,6 +13227,7 @@ type DeleteSnapshotRequest struct { snapshotId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteSnapshotRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -12495,7 +13377,7 @@ func (r DeleteSnapshotRequest) Execute() error { /* DeleteSnapshot: Delete a snapshot. -Delete a snapshot that is part of the project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -12513,6 +13395,7 @@ func (a *APIClient) DeleteSnapshot(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) error { r := DeleteSnapshotRequest{ apiService: a.defaultApi, @@ -12524,6 +13407,7 @@ func (a *APIClient) DeleteSnapshotExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -12532,6 +13416,7 @@ type DeleteVolumeRequest struct { volumeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteVolumeRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -12692,7 +13577,7 @@ func (r DeleteVolumeRequest) Execute() error { /* DeleteVolume: Delete a volume. -Delete a volume inside a project. The deletion will fail if the volume is still in use. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -12710,6 +13595,7 @@ func (a *APIClient) DeleteVolume(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) error { r := DeleteVolumeRequest{ apiService: a.defaultApi, @@ -12721,6 +13607,7 @@ func (a *APIClient) DeleteVolumeExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetAffinityGroupRequest struct { ctx context.Context apiService *DefaultApiService @@ -12729,6 +13616,7 @@ type GetAffinityGroupRequest struct { affinityGroupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetAffinityGroupRequest) Execute() (*AffinityGroup, error) { var ( localVarHTTPMethod = http.MethodGet @@ -12889,7 +13777,7 @@ func (r GetAffinityGroupRequest) Execute() (*AffinityGroup, error) { /* GetAffinityGroup: Get the affinity group. -Get the affinity group created in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -12907,6 +13795,7 @@ func (a *APIClient) GetAffinityGroup(ctx context.Context, projectId string, regi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetAffinityGroupExecute(ctx context.Context, projectId string, region string, affinityGroupId string) (*AffinityGroup, error) { r := GetAffinityGroupRequest{ apiService: a.defaultApi, @@ -12918,6 +13807,7 @@ func (a *APIClient) GetAffinityGroupExecute(ctx context.Context, projectId strin return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetAttachedVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -12927,6 +13817,7 @@ type GetAttachedVolumeRequest struct { volumeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { var ( localVarHTTPMethod = http.MethodGet @@ -13094,7 +13985,7 @@ func (r GetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { /* GetAttachedVolume: Get Volume Attachment details. -Get the details of an existing Volume Attachment. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -13114,6 +14005,7 @@ func (a *APIClient) GetAttachedVolume(ctx context.Context, projectId string, reg } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetAttachedVolumeExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) { r := GetAttachedVolumeRequest{ apiService: a.defaultApi, @@ -13126,6 +14018,7 @@ func (a *APIClient) GetAttachedVolumeExecute(ctx context.Context, projectId stri return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -13134,6 +14027,7 @@ type GetBackupRequest struct { backupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetBackupRequest) Execute() (*Backup, error) { var ( localVarHTTPMethod = http.MethodGet @@ -13294,7 +14188,7 @@ func (r GetBackupRequest) Execute() (*Backup, error) { /* GetBackup: Get details about a backup. -Get details about a block device backup. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -13312,6 +14206,7 @@ func (a *APIClient) GetBackup(ctx context.Context, projectId string, region stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, region string, backupId string) (*Backup, error) { r := GetBackupRequest{ apiService: a.defaultApi, @@ -13323,6 +14218,7 @@ func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, regi return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetImageRequest struct { ctx context.Context apiService *DefaultApiService @@ -13331,6 +14227,7 @@ type GetImageRequest struct { imageId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetImageRequest) Execute() (*Image, error) { var ( localVarHTTPMethod = http.MethodGet @@ -13491,7 +14388,7 @@ func (r GetImageRequest) Execute() (*Image, error) { /* GetImage: Get details about an image. -Get details about a specific Image inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -13509,6 +14406,7 @@ func (a *APIClient) GetImage(ctx context.Context, projectId string, region strin } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetImageExecute(ctx context.Context, projectId string, region string, imageId string) (*Image, error) { r := GetImageRequest{ apiService: a.defaultApi, @@ -13520,6 +14418,7 @@ func (a *APIClient) GetImageExecute(ctx context.Context, projectId string, regio return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetImageShareRequest struct { ctx context.Context apiService *DefaultApiService @@ -13528,6 +14427,7 @@ type GetImageShareRequest struct { imageId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetImageShareRequest) Execute() (*ImageShare, error) { var ( localVarHTTPMethod = http.MethodGet @@ -13688,7 +14588,7 @@ func (r GetImageShareRequest) Execute() (*ImageShare, error) { /* GetImageShare: Get share details of an image. -Get share details about an shared image. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -13706,6 +14606,7 @@ func (a *APIClient) GetImageShare(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) { r := GetImageShareRequest{ apiService: a.defaultApi, @@ -13717,6 +14618,7 @@ func (a *APIClient) GetImageShareExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetImageShareConsumerRequest struct { ctx context.Context apiService *DefaultApiService @@ -13726,6 +14628,7 @@ type GetImageShareConsumerRequest struct { consumerProjectId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { var ( localVarHTTPMethod = http.MethodGet @@ -13893,7 +14796,7 @@ func (r GetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { /* GetImageShareConsumer: Get image share consumer. -Get details about an image share consumer. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -13913,6 +14816,7 @@ func (a *APIClient) GetImageShareConsumer(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetImageShareConsumerExecute(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) (*ImageShareConsumer, error) { r := GetImageShareConsumerRequest{ apiService: a.defaultApi, @@ -13925,12 +14829,14 @@ func (a *APIClient) GetImageShareConsumerExecute(ctx context.Context, projectId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetKeyPairRequest struct { ctx context.Context apiService *DefaultApiService keypairName string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetKeyPairRequest) Execute() (*Keypair, error) { var ( localVarHTTPMethod = http.MethodGet @@ -14080,7 +14986,7 @@ func (r GetKeyPairRequest) Execute() (*Keypair, error) { /* GetKeyPair: Get SSH keypair details. -Get details about an SSH keypair. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param keypairName The name of an SSH keypair. @@ -14094,6 +15000,7 @@ func (a *APIClient) GetKeyPair(ctx context.Context, keypairName string) ApiGetKe } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { r := GetKeyPairRequest{ apiService: a.defaultApi, @@ -14103,6 +15010,7 @@ func (a *APIClient) GetKeyPairExecute(ctx context.Context, keypairName string) ( return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetMachineTypeRequest struct { ctx context.Context apiService *DefaultApiService @@ -14111,6 +15019,7 @@ type GetMachineTypeRequest struct { machineType string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetMachineTypeRequest) Execute() (*MachineType, error) { var ( localVarHTTPMethod = http.MethodGet @@ -14268,7 +15177,7 @@ func (r GetMachineTypeRequest) Execute() (*MachineType, error) { /* GetMachineType: Get details about a machine type. -Get details about a specific machine type. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -14286,6 +15195,7 @@ func (a *APIClient) GetMachineType(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetMachineTypeExecute(ctx context.Context, projectId string, region string, machineType string) (*MachineType, error) { r := GetMachineTypeRequest{ apiService: a.defaultApi, @@ -14297,6 +15207,7 @@ func (a *APIClient) GetMachineTypeExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetNetworkRequest struct { ctx context.Context apiService *DefaultApiService @@ -14305,6 +15216,7 @@ type GetNetworkRequest struct { networkId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetNetworkRequest) Execute() (*Network, error) { var ( localVarHTTPMethod = http.MethodGet @@ -14465,7 +15377,7 @@ func (r GetNetworkRequest) Execute() (*Network, error) { /* GetNetwork: Get network details. -Get details about a network of a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -14483,6 +15395,7 @@ func (a *APIClient) GetNetwork(ctx context.Context, projectId string, region str } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, region string, networkId string) (*Network, error) { r := GetNetworkRequest{ apiService: a.defaultApi, @@ -14494,6 +15407,7 @@ func (a *APIClient) GetNetworkExecute(ctx context.Context, projectId string, reg return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetNetworkAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -14501,6 +15415,7 @@ type GetNetworkAreaRequest struct { areaId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetNetworkAreaRequest) Execute() (*NetworkArea, error) { var ( localVarHTTPMethod = http.MethodGet @@ -14660,7 +15575,7 @@ func (r GetNetworkAreaRequest) Execute() (*NetworkArea, error) { /* GetNetworkArea: Get details about a network area. -Get details about a network area in an organization. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -14676,6 +15591,7 @@ func (a *APIClient) GetNetworkArea(ctx context.Context, organizationId string, a } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { r := GetNetworkAreaRequest{ apiService: a.defaultApi, @@ -14686,6 +15602,7 @@ func (a *APIClient) GetNetworkAreaExecute(ctx context.Context, organizationId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetNetworkAreaRangeRequest struct { ctx context.Context apiService *DefaultApiService @@ -14695,6 +15612,7 @@ type GetNetworkAreaRangeRequest struct { networkRangeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { var ( localVarHTTPMethod = http.MethodGet @@ -14862,7 +15780,7 @@ func (r GetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { /* GetNetworkAreaRange: Get details about a network range. -Get details about a network range in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -14882,6 +15800,7 @@ func (a *APIClient) GetNetworkAreaRange(ctx context.Context, organizationId stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetNetworkAreaRangeExecute(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) (*NetworkRange, error) { r := GetNetworkAreaRangeRequest{ apiService: a.defaultApi, @@ -14894,6 +15813,7 @@ func (a *APIClient) GetNetworkAreaRangeExecute(ctx context.Context, organization return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetNetworkAreaRegionRequest struct { ctx context.Context apiService *DefaultApiService @@ -14902,6 +15822,7 @@ type GetNetworkAreaRegionRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { var ( localVarHTTPMethod = http.MethodGet @@ -15062,7 +15983,7 @@ func (r GetNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { /* GetNetworkAreaRegion: Get details about a configured region. -Get details about a configured region in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -15080,6 +16001,7 @@ func (a *APIClient) GetNetworkAreaRegion(ctx context.Context, organizationId str } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) { r := GetNetworkAreaRegionRequest{ apiService: a.defaultApi, @@ -15091,6 +16013,7 @@ func (a *APIClient) GetNetworkAreaRegionExecute(ctx context.Context, organizatio return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetNetworkAreaRouteRequest struct { ctx context.Context apiService *DefaultApiService @@ -15100,6 +16023,7 @@ type GetNetworkAreaRouteRequest struct { routeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetNetworkAreaRouteRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodGet @@ -15267,7 +16191,7 @@ func (r GetNetworkAreaRouteRequest) Execute() (*Route, error) { /* GetNetworkAreaRoute: Get details about a network route. -Get details about a network route defined in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -15287,6 +16211,7 @@ func (a *APIClient) GetNetworkAreaRoute(ctx context.Context, organizationId stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) (*Route, error) { r := GetNetworkAreaRouteRequest{ apiService: a.defaultApi, @@ -15299,6 +16224,7 @@ func (a *APIClient) GetNetworkAreaRouteExecute(ctx context.Context, organization return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetNicRequest struct { ctx context.Context apiService *DefaultApiService @@ -15308,6 +16234,7 @@ type GetNicRequest struct { nicId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetNicRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodGet @@ -15475,7 +16402,7 @@ func (r GetNicRequest) Execute() (*NIC, error) { /* GetNic: Get details about a network interface. -Get details about a network interface inside a network. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -15495,6 +16422,7 @@ func (a *APIClient) GetNic(ctx context.Context, projectId string, region string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) (*NIC, error) { r := GetNicRequest{ apiService: a.defaultApi, @@ -15507,6 +16435,7 @@ func (a *APIClient) GetNicExecute(ctx context.Context, projectId string, region return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetOrganizationRequestRequest struct { ctx context.Context apiService *DefaultApiService @@ -15514,6 +16443,7 @@ type GetOrganizationRequestRequest struct { requestId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetOrganizationRequestRequest) Execute() (*Request, error) { var ( localVarHTTPMethod = http.MethodGet @@ -15673,7 +16603,7 @@ func (r GetOrganizationRequestRequest) Execute() (*Request, error) { /* GetOrganizationRequest: Lookup an organization request ID. -Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -15689,6 +16619,7 @@ func (a *APIClient) GetOrganizationRequest(ctx context.Context, organizationId s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetOrganizationRequestExecute(ctx context.Context, organizationId string, requestId string) (*Request, error) { r := GetOrganizationRequestRequest{ apiService: a.defaultApi, @@ -15699,12 +16630,14 @@ func (a *APIClient) GetOrganizationRequestExecute(ctx context.Context, organizat return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetProjectDetailsRequest struct { ctx context.Context apiService *DefaultApiService projectId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetProjectDetailsRequest) Execute() (*Project, error) { var ( localVarHTTPMethod = http.MethodGet @@ -15857,7 +16790,7 @@ func (r GetProjectDetailsRequest) Execute() (*Project, error) { /* GetProjectDetails: Get project details. -Get details about a STACKIT project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -15871,6 +16804,7 @@ func (a *APIClient) GetProjectDetails(ctx context.Context, projectId string) Api } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId string) (*Project, error) { r := GetProjectDetailsRequest{ apiService: a.defaultApi, @@ -15880,6 +16814,7 @@ func (a *APIClient) GetProjectDetailsExecute(ctx context.Context, projectId stri return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetProjectNICRequest struct { ctx context.Context apiService *DefaultApiService @@ -15888,6 +16823,7 @@ type GetProjectNICRequest struct { nicId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetProjectNICRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodGet @@ -16048,7 +16984,7 @@ func (r GetProjectNICRequest) Execute() (*NIC, error) { /* GetProjectNIC: Get details about a network interface of a project. -Get details about a network interface inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -16066,6 +17002,7 @@ func (a *APIClient) GetProjectNIC(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetProjectNICExecute(ctx context.Context, projectId string, region string, nicId string) (*NIC, error) { r := GetProjectNICRequest{ apiService: a.defaultApi, @@ -16077,6 +17014,7 @@ func (a *APIClient) GetProjectNICExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetProjectRequestRequest struct { ctx context.Context apiService *DefaultApiService @@ -16085,6 +17023,7 @@ type GetProjectRequestRequest struct { requestId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetProjectRequestRequest) Execute() (*Request, error) { var ( localVarHTTPMethod = http.MethodGet @@ -16245,7 +17184,7 @@ func (r GetProjectRequestRequest) Execute() (*Request, error) { /* GetProjectRequest: Lookup a project request ID. -Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -16263,6 +17202,7 @@ func (a *APIClient) GetProjectRequest(ctx context.Context, projectId string, reg } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetProjectRequestExecute(ctx context.Context, projectId string, region string, requestId string) (*Request, error) { r := GetProjectRequestRequest{ apiService: a.defaultApi, @@ -16274,6 +17214,7 @@ func (a *APIClient) GetProjectRequestExecute(ctx context.Context, projectId stri return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetPublicIPRequest struct { ctx context.Context apiService *DefaultApiService @@ -16282,6 +17223,7 @@ type GetPublicIPRequest struct { publicIpId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetPublicIPRequest) Execute() (*PublicIp, error) { var ( localVarHTTPMethod = http.MethodGet @@ -16442,7 +17384,7 @@ func (r GetPublicIPRequest) Execute() (*PublicIp, error) { /* GetPublicIP: Get details about a public IP. -Get details about a public IP inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -16460,6 +17402,7 @@ func (a *APIClient) GetPublicIP(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) (*PublicIp, error) { r := GetPublicIPRequest{ apiService: a.defaultApi, @@ -16471,6 +17414,7 @@ func (a *APIClient) GetPublicIPExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetRouteOfRoutingTableRequest struct { ctx context.Context apiService *DefaultApiService @@ -16481,6 +17425,7 @@ type GetRouteOfRoutingTableRequest struct { routeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetRouteOfRoutingTableRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodGet @@ -16655,7 +17600,7 @@ func (r GetRouteOfRoutingTableRequest) Execute() (*Route, error) { /* GetRouteOfRoutingTable: Get details about a route of a routing table. -Get details about a route defined in a routing table. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -16677,6 +17622,7 @@ func (a *APIClient) GetRouteOfRoutingTable(ctx context.Context, organizationId s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) { r := GetRouteOfRoutingTableRequest{ apiService: a.defaultApi, @@ -16690,6 +17636,7 @@ func (a *APIClient) GetRouteOfRoutingTableExecute(ctx context.Context, organizat return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetRoutingTableOfAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -16699,6 +17646,7 @@ type GetRoutingTableOfAreaRequest struct { routingTableId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { var ( localVarHTTPMethod = http.MethodGet @@ -16866,7 +17814,7 @@ func (r GetRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { /* GetRoutingTableOfArea: Get details about a routing table. -Get details about a routing table defined in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -16886,6 +17834,7 @@ func (a *APIClient) GetRoutingTableOfArea(ctx context.Context, organizationId st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) { r := GetRoutingTableOfAreaRequest{ apiService: a.defaultApi, @@ -16898,6 +17847,7 @@ func (a *APIClient) GetRoutingTableOfAreaExecute(ctx context.Context, organizati return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetSecurityGroupRequest struct { ctx context.Context apiService *DefaultApiService @@ -16906,6 +17856,7 @@ type GetSecurityGroupRequest struct { securityGroupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( localVarHTTPMethod = http.MethodGet @@ -17066,7 +18017,7 @@ func (r GetSecurityGroupRequest) Execute() (*SecurityGroup, error) { /* GetSecurityGroup: Get security group details. -Get details about a security group of a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -17084,6 +18035,7 @@ func (a *APIClient) GetSecurityGroup(ctx context.Context, projectId string, regi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroup, error) { r := GetSecurityGroupRequest{ apiService: a.defaultApi, @@ -17095,6 +18047,7 @@ func (a *APIClient) GetSecurityGroupExecute(ctx context.Context, projectId strin return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetSecurityGroupRuleRequest struct { ctx context.Context apiService *DefaultApiService @@ -17104,6 +18057,7 @@ type GetSecurityGroupRuleRequest struct { securityGroupRuleId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { var ( localVarHTTPMethod = http.MethodGet @@ -17271,7 +18225,7 @@ func (r GetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { /* GetSecurityGroupRule: Get security group rule details. -Get details about a security group rule of a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -17291,6 +18245,7 @@ func (a *APIClient) GetSecurityGroupRule(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) (*SecurityGroupRule, error) { r := GetSecurityGroupRuleRequest{ apiService: a.defaultApi, @@ -17303,6 +18258,7 @@ func (a *APIClient) GetSecurityGroupRuleExecute(ctx context.Context, projectId s return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -17313,12 +18269,13 @@ type GetServerRequest struct { } // Show detailed information about server. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetServerRequest) Details(details bool) ApiGetServerRequest { r.details = &details return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetServerRequest) Execute() (*Server, error) { var ( localVarHTTPMethod = http.MethodGet @@ -17482,7 +18439,7 @@ func (r GetServerRequest) Execute() (*Server, error) { /* GetServer: Get server details. -Get details about a server by its ID. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -17500,6 +18457,7 @@ func (a *APIClient) GetServer(ctx context.Context, projectId string, region stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, region string, serverId string) (*Server, error) { r := GetServerRequest{ apiService: a.defaultApi, @@ -17511,6 +18469,7 @@ func (a *APIClient) GetServerExecute(ctx context.Context, projectId string, regi return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServerConsoleRequest struct { ctx context.Context apiService *DefaultApiService @@ -17519,6 +18478,7 @@ type GetServerConsoleRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { var ( localVarHTTPMethod = http.MethodGet @@ -17679,7 +18639,7 @@ func (r GetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { /* GetServerConsole: Get server console. -Get a URL for server remote console. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -17697,6 +18657,7 @@ func (a *APIClient) GetServerConsole(ctx context.Context, projectId string, regi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId string, region string, serverId string) (*ServerConsoleUrl, error) { r := GetServerConsoleRequest{ apiService: a.defaultApi, @@ -17708,6 +18669,7 @@ func (a *APIClient) GetServerConsoleExecute(ctx context.Context, projectId strin return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServerLogRequest struct { ctx context.Context apiService *DefaultApiService @@ -17718,12 +18680,13 @@ type GetServerLogRequest struct { } // Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetServerLogRequest) Length(length int64) ApiGetServerLogRequest { r.length = &length return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetServerLogRequest) Execute() (*GetServerLog200Response, error) { var ( localVarHTTPMethod = http.MethodGet @@ -17887,7 +18850,7 @@ func (r GetServerLogRequest) Execute() (*GetServerLog200Response, error) { /* GetServerLog: Get server log. -Get server console log. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -17905,6 +18868,7 @@ func (a *APIClient) GetServerLog(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetServerLogExecute(ctx context.Context, projectId string, region string, serverId string) (*GetServerLog200Response, error) { r := GetServerLogRequest{ apiService: a.defaultApi, @@ -17916,6 +18880,7 @@ func (a *APIClient) GetServerLogExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetSnapshotRequest struct { ctx context.Context apiService *DefaultApiService @@ -17924,6 +18889,7 @@ type GetSnapshotRequest struct { snapshotId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetSnapshotRequest) Execute() (*Snapshot, error) { var ( localVarHTTPMethod = http.MethodGet @@ -18084,7 +19050,7 @@ func (r GetSnapshotRequest) Execute() (*Snapshot, error) { /* GetSnapshot: Get details about a snapshot. -Get details about a block device snapshot. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -18102,6 +19068,7 @@ func (a *APIClient) GetSnapshot(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) (*Snapshot, error) { r := GetSnapshotRequest{ apiService: a.defaultApi, @@ -18113,6 +19080,7 @@ func (a *APIClient) GetSnapshotExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -18121,6 +19089,7 @@ type GetVolumeRequest struct { volumeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetVolumeRequest) Execute() (*Volume, error) { var ( localVarHTTPMethod = http.MethodGet @@ -18281,7 +19250,7 @@ func (r GetVolumeRequest) Execute() (*Volume, error) { /* GetVolume: Get details about a volume. -Get details about a block device volume. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -18299,6 +19268,7 @@ func (a *APIClient) GetVolume(ctx context.Context, projectId string, region stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) (*Volume, error) { r := GetVolumeRequest{ apiService: a.defaultApi, @@ -18310,6 +19280,7 @@ func (a *APIClient) GetVolumeExecute(ctx context.Context, projectId string, regi return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetVolumePerformanceClassRequest struct { ctx context.Context apiService *DefaultApiService @@ -18318,6 +19289,7 @@ type GetVolumePerformanceClassRequest struct { volumePerformanceClass string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { var ( localVarHTTPMethod = http.MethodGet @@ -18475,7 +19447,7 @@ func (r GetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, er /* GetVolumePerformanceClass: Get details about a volume performance class. -Get details about a specific volume performance class. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -18493,6 +19465,7 @@ func (a *APIClient) GetVolumePerformanceClass(ctx context.Context, projectId str } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetVolumePerformanceClassExecute(ctx context.Context, projectId string, region string, volumePerformanceClass string) (*VolumePerformanceClass, error) { r := GetVolumePerformanceClassRequest{ apiService: a.defaultApi, @@ -18504,6 +19477,7 @@ func (a *APIClient) GetVolumePerformanceClassExecute(ctx context.Context, projec return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -18514,12 +19488,13 @@ type ImageFromVolumeRequest struct { } // Create an image from a volume. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ImageFromVolumeRequest) ImageFromVolumePayload(imageFromVolumePayload ImageFromVolumePayload) ApiImageFromVolumeRequest { r.imageFromVolumePayload = &imageFromVolumePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ImageFromVolumeRequest) Execute() (*Image, error) { var ( localVarHTTPMethod = http.MethodPost @@ -18693,7 +19668,7 @@ func (r ImageFromVolumeRequest) Execute() (*Image, error) { /* ImageFromVolume: Create an image out of a volume. -Create an image out a a volume. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -18711,6 +19686,7 @@ func (a *APIClient) ImageFromVolume(ctx context.Context, projectId string, volum } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ImageFromVolumeExecute(ctx context.Context, projectId string, volumeId string, region string) (*Image, error) { r := ImageFromVolumeRequest{ apiService: a.defaultApi, @@ -18722,6 +19698,7 @@ func (a *APIClient) ImageFromVolumeExecute(ctx context.Context, projectId string return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListAffinityGroupsRequest struct { ctx context.Context apiService *DefaultApiService @@ -18729,6 +19706,7 @@ type ListAffinityGroupsRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -18893,7 +19871,7 @@ func (r ListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) /* ListAffinityGroups: Get the affinity groups setup for a project. -Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -18909,6 +19887,7 @@ func (a *APIClient) ListAffinityGroups(ctx context.Context, projectId string, re } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListAffinityGroupsExecute(ctx context.Context, projectId string, region string) (*AffinityGroupListResponse, error) { r := ListAffinityGroupsRequest{ apiService: a.defaultApi, @@ -18919,6 +19898,7 @@ func (a *APIClient) ListAffinityGroupsExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListAttachedVolumesRequest struct { ctx context.Context apiService *DefaultApiService @@ -18927,6 +19907,7 @@ type ListAttachedVolumesRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -19087,7 +20068,7 @@ func (r ListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, er /* ListAttachedVolumes: List all volume attachments of a server. -Get a list of all volume attachments of a server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -19105,6 +20086,7 @@ func (a *APIClient) ListAttachedVolumes(ctx context.Context, projectId string, r } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId string, region string, serverId string) (*VolumeAttachmentListResponse, error) { r := ListAttachedVolumesRequest{ apiService: a.defaultApi, @@ -19116,12 +20098,14 @@ func (a *APIClient) ListAttachedVolumesExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListAvailabilityZonesRequest struct { ctx context.Context apiService *DefaultApiService region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -19268,7 +20252,7 @@ func (r ListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, /* ListAvailabilityZones: List all availability zones. -Get a list of all availability zones. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param region The STACKIT Region of the resources. @@ -19282,6 +20266,7 @@ func (a *APIClient) ListAvailabilityZones(ctx context.Context, region string) Ap } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListAvailabilityZonesExecute(ctx context.Context, region string) (*AvailabilityZoneListResponse, error) { r := ListAvailabilityZonesRequest{ apiService: a.defaultApi, @@ -19291,6 +20276,7 @@ func (a *APIClient) ListAvailabilityZonesExecute(ctx context.Context, region str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService @@ -19300,12 +20286,13 @@ type ListBackupsRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListBackupsRequest) LabelSelector(labelSelector string) ApiListBackupsRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListBackupsRequest) Execute() (*BackupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -19462,7 +20449,7 @@ func (r ListBackupsRequest) Execute() (*BackupListResponse, error) { /* ListBackups: List all backups inside a project. -Get a list of all backups inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -19478,6 +20465,7 @@ func (a *APIClient) ListBackups(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, region string) (*BackupListResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, @@ -19488,6 +20476,7 @@ func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListImagesRequest struct { ctx context.Context apiService *DefaultApiService @@ -19498,19 +20487,20 @@ type ListImagesRequest struct { } // List all Images. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListImagesRequest) All(all bool) ApiListImagesRequest { r.all = &all return r } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListImagesRequest) LabelSelector(labelSelector string) ApiListImagesRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListImagesRequest) Execute() (*ImageListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -19670,7 +20660,7 @@ func (r ListImagesRequest) Execute() (*ImageListResponse, error) { /* ListImages: List all Images inside a project. -Get a list of all images inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -19686,6 +20676,7 @@ func (a *APIClient) ListImages(ctx context.Context, projectId string, region str } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListImagesExecute(ctx context.Context, projectId string, region string) (*ImageListResponse, error) { r := ListImagesRequest{ apiService: a.defaultApi, @@ -19696,6 +20687,7 @@ func (a *APIClient) ListImagesExecute(ctx context.Context, projectId string, reg return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListKeyPairsRequest struct { ctx context.Context apiService *DefaultApiService @@ -19703,12 +20695,13 @@ type ListKeyPairsRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -19857,7 +20850,7 @@ func (r ListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { /* ListKeyPairs: List all SSH keypairs for the requesting user. -Get a list of all SSH keypairs assigned to the requesting user. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiListKeyPairsRequest @@ -19869,6 +20862,7 @@ func (a *APIClient) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListKeyPairsExecute(ctx context.Context) (*KeyPairListResponse, error) { r := ListKeyPairsRequest{ apiService: a.defaultApi, @@ -19877,6 +20871,7 @@ func (a *APIClient) ListKeyPairsExecute(ctx context.Context) (*KeyPairListRespon return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListMachineTypesRequest struct { ctx context.Context apiService *DefaultApiService @@ -19886,12 +20881,13 @@ type ListMachineTypesRequest struct { } // Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListMachineTypesRequest) Filter(filter string) ApiListMachineTypesRequest { r.filter = &filter return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -20048,7 +21044,7 @@ func (r ListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { /* ListMachineTypes: List all machine types available for a project. -Get a list of all machine type available in a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -20064,6 +21060,7 @@ func (a *APIClient) ListMachineTypes(ctx context.Context, projectId string, regi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListMachineTypesExecute(ctx context.Context, projectId string, region string) (*MachineTypeListResponse, error) { r := ListMachineTypesRequest{ apiService: a.defaultApi, @@ -20074,6 +21071,7 @@ func (a *APIClient) ListMachineTypesExecute(ctx context.Context, projectId strin return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListNetworkAreaProjectsRequest struct { ctx context.Context apiService *DefaultApiService @@ -20081,6 +21079,7 @@ type ListNetworkAreaProjectsRequest struct { areaId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -20240,7 +21239,7 @@ func (r ListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) /* ListNetworkAreaProjects: List all projects using a network area. -Get a list of all projects using a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -20256,6 +21255,7 @@ func (a *APIClient) ListNetworkAreaProjects(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListNetworkAreaProjectsExecute(ctx context.Context, organizationId string, areaId string) (*ProjectListResponse, error) { r := ListNetworkAreaProjectsRequest{ apiService: a.defaultApi, @@ -20266,6 +21266,7 @@ func (a *APIClient) ListNetworkAreaProjectsExecute(ctx context.Context, organiza return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListNetworkAreaRangesRequest struct { ctx context.Context apiService *DefaultApiService @@ -20274,6 +21275,7 @@ type ListNetworkAreaRangesRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -20434,7 +21436,7 @@ func (r ListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, erro /* ListNetworkAreaRanges: List all network ranges in a network area. -Get a list of all network ranges in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -20452,6 +21454,7 @@ func (a *APIClient) ListNetworkAreaRanges(ctx context.Context, organizationId st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListNetworkAreaRangesExecute(ctx context.Context, organizationId string, areaId string, region string) (*NetworkRangeListResponse, error) { r := ListNetworkAreaRangesRequest{ apiService: a.defaultApi, @@ -20463,6 +21466,7 @@ func (a *APIClient) ListNetworkAreaRangesExecute(ctx context.Context, organizati return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListNetworkAreaRegionsRequest struct { ctx context.Context apiService *DefaultApiService @@ -20470,6 +21474,7 @@ type ListNetworkAreaRegionsRequest struct { areaId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworkAreaRegionsRequest) Execute() (*RegionalAreaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -20629,7 +21634,7 @@ func (r ListNetworkAreaRegionsRequest) Execute() (*RegionalAreaListResponse, err /* ListNetworkAreaRegions: List all configured regions in a network area. -Get a list of all configured regions. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -20645,6 +21650,7 @@ func (a *APIClient) ListNetworkAreaRegions(ctx context.Context, organizationId s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListNetworkAreaRegionsExecute(ctx context.Context, organizationId string, areaId string) (*RegionalAreaListResponse, error) { r := ListNetworkAreaRegionsRequest{ apiService: a.defaultApi, @@ -20655,6 +21661,7 @@ func (a *APIClient) ListNetworkAreaRegionsExecute(ctx context.Context, organizat return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListNetworkAreaRoutesRequest struct { ctx context.Context apiService *DefaultApiService @@ -20665,12 +21672,13 @@ type ListNetworkAreaRoutesRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworkAreaRoutesRequest) LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -20834,7 +21842,7 @@ func (r ListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { /* ListNetworkAreaRoutes: List all network routes in a network area. -Get a list of all network routes defined in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -20852,6 +21860,7 @@ func (a *APIClient) ListNetworkAreaRoutes(ctx context.Context, organizationId st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListNetworkAreaRoutesExecute(ctx context.Context, organizationId string, areaId string, region string) (*RouteListResponse, error) { r := ListNetworkAreaRoutesRequest{ apiService: a.defaultApi, @@ -20863,6 +21872,7 @@ func (a *APIClient) ListNetworkAreaRoutesExecute(ctx context.Context, organizati return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListNetworkAreasRequest struct { ctx context.Context apiService *DefaultApiService @@ -20871,12 +21881,13 @@ type ListNetworkAreasRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -21032,7 +22043,7 @@ func (r ListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { /* ListNetworkAreas: List all network areas in an organization. -Get a list of all visible network areas defined in an organization. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -21046,6 +22057,7 @@ func (a *APIClient) ListNetworkAreas(ctx context.Context, organizationId string) } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId string) (*NetworkAreaListResponse, error) { r := ListNetworkAreasRequest{ apiService: a.defaultApi, @@ -21055,6 +22067,7 @@ func (a *APIClient) ListNetworkAreasExecute(ctx context.Context, organizationId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListNetworksRequest struct { ctx context.Context apiService *DefaultApiService @@ -21064,12 +22077,13 @@ type ListNetworksRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNetworksRequest) Execute() (*NetworkListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -21226,7 +22240,7 @@ func (r ListNetworksRequest) Execute() (*NetworkListResponse, error) { /* ListNetworks: List all networks inside a project. -Get a list of all networks inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -21242,6 +22256,7 @@ func (a *APIClient) ListNetworks(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string, region string) (*NetworkListResponse, error) { r := ListNetworksRequest{ apiService: a.defaultApi, @@ -21252,6 +22267,7 @@ func (a *APIClient) ListNetworksExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListNicsRequest struct { ctx context.Context apiService *DefaultApiService @@ -21262,12 +22278,13 @@ type ListNicsRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNicsRequest) LabelSelector(labelSelector string) ApiListNicsRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListNicsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -21431,7 +22448,7 @@ func (r ListNicsRequest) Execute() (*NICListResponse, error) { /* ListNics: List all network interfaces inside a network. -Get a list of all network interfaces inside a network. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -21449,6 +22466,7 @@ func (a *APIClient) ListNics(ctx context.Context, projectId string, region strin } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListNicsExecute(ctx context.Context, projectId string, region string, networkId string) (*NICListResponse, error) { r := ListNicsRequest{ apiService: a.defaultApi, @@ -21460,6 +22478,7 @@ func (a *APIClient) ListNicsExecute(ctx context.Context, projectId string, regio return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListProjectNICsRequest struct { ctx context.Context apiService *DefaultApiService @@ -21469,12 +22488,13 @@ type ListProjectNICsRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListProjectNICsRequest) LabelSelector(labelSelector string) ApiListProjectNICsRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListProjectNICsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -21631,7 +22651,7 @@ func (r ListProjectNICsRequest) Execute() (*NICListResponse, error) { /* ListProjectNICs: List all network interfaces inside a project. -Get a list of all network interfaces inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -21647,6 +22667,7 @@ func (a *APIClient) ListProjectNICs(ctx context.Context, projectId string, regio } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListProjectNICsExecute(ctx context.Context, projectId string, region string) (*NICListResponse, error) { r := ListProjectNICsRequest{ apiService: a.defaultApi, @@ -21657,11 +22678,13 @@ func (a *APIClient) ListProjectNICsExecute(ctx context.Context, projectId string return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListPublicIPRangesRequest struct { ctx context.Context apiService *DefaultApiService } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -21807,7 +22830,7 @@ func (r ListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) /* ListPublicIPRanges: List all public IP ranges. -Get a list of all public IP ranges that STACKIT uses. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @return ApiListPublicIPRangesRequest @@ -21819,6 +22842,7 @@ func (a *APIClient) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRange } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListPublicIPRangesExecute(ctx context.Context) (*PublicNetworkListResponse, error) { r := ListPublicIPRangesRequest{ apiService: a.defaultApi, @@ -21827,6 +22851,7 @@ func (a *APIClient) ListPublicIPRangesExecute(ctx context.Context) (*PublicNetwo return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListPublicIPsRequest struct { ctx context.Context apiService *DefaultApiService @@ -21836,12 +22861,13 @@ type ListPublicIPsRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -21998,7 +23024,7 @@ func (r ListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { /* ListPublicIPs: List all public IPs inside a project. -Get a list of all public IPs inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -22014,6 +23040,7 @@ func (a *APIClient) ListPublicIPs(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string, region string) (*PublicIpListResponse, error) { r := ListPublicIPsRequest{ apiService: a.defaultApi, @@ -22024,6 +23051,7 @@ func (a *APIClient) ListPublicIPsExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListQuotasRequest struct { ctx context.Context apiService *DefaultApiService @@ -22031,6 +23059,7 @@ type ListQuotasRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListQuotasRequest) Execute() (*QuotaListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -22184,7 +23213,7 @@ func (r ListQuotasRequest) Execute() (*QuotaListResponse, error) { /* ListQuotas: List project quotas. -List quota limits and usage for project resources. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -22200,6 +23229,7 @@ func (a *APIClient) ListQuotas(ctx context.Context, projectId string, region str } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListQuotasExecute(ctx context.Context, projectId string, region string) (*QuotaListResponse, error) { r := ListQuotasRequest{ apiService: a.defaultApi, @@ -22210,6 +23240,7 @@ func (a *APIClient) ListQuotasExecute(ctx context.Context, projectId string, reg return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRoutesOfRoutingTableRequest struct { ctx context.Context apiService *DefaultApiService @@ -22221,12 +23252,13 @@ type ListRoutesOfRoutingTableRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListRoutesOfRoutingTableRequest) LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListRoutesOfRoutingTableRequest) Execute() (*RouteListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -22397,7 +23429,7 @@ func (r ListRoutesOfRoutingTableRequest) Execute() (*RouteListResponse, error) { /* ListRoutesOfRoutingTable: List all routes in a routing table. -Get a list of all routes in a routing table. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -22417,6 +23449,7 @@ func (a *APIClient) ListRoutesOfRoutingTable(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListRoutesOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RouteListResponse, error) { r := ListRoutesOfRoutingTableRequest{ apiService: a.defaultApi, @@ -22429,6 +23462,7 @@ func (a *APIClient) ListRoutesOfRoutingTableExecute(ctx context.Context, organiz return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListRoutingTablesOfAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -22439,12 +23473,13 @@ type ListRoutingTablesOfAreaRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListRoutingTablesOfAreaRequest) LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListRoutingTablesOfAreaRequest) Execute() (*RoutingTableListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -22608,7 +23643,7 @@ func (r ListRoutingTablesOfAreaRequest) Execute() (*RoutingTableListResponse, er /* ListRoutingTablesOfArea: List all routing tables in a network area. -Get a list of all routing tables in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -22626,6 +23661,7 @@ func (a *APIClient) ListRoutingTablesOfArea(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListRoutingTablesOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string) (*RoutingTableListResponse, error) { r := ListRoutingTablesOfAreaRequest{ apiService: a.defaultApi, @@ -22637,6 +23673,7 @@ func (a *APIClient) ListRoutingTablesOfAreaExecute(ctx context.Context, organiza return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListSecurityGroupRulesRequest struct { ctx context.Context apiService *DefaultApiService @@ -22645,6 +23682,7 @@ type ListSecurityGroupRulesRequest struct { securityGroupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -22805,7 +23843,7 @@ func (r ListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse /* ListSecurityGroupRules: List all rules for a security group. -Get a list of all rules inside a security group. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -22823,6 +23861,7 @@ func (a *APIClient) ListSecurityGroupRules(ctx context.Context, projectId string } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroupRuleListResponse, error) { r := ListSecurityGroupRulesRequest{ apiService: a.defaultApi, @@ -22834,6 +23873,7 @@ func (a *APIClient) ListSecurityGroupRulesExecute(ctx context.Context, projectId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListSecurityGroupsRequest struct { ctx context.Context apiService *DefaultApiService @@ -22843,12 +23883,13 @@ type ListSecurityGroupsRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -23005,7 +24046,7 @@ func (r ListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) /* ListSecurityGroups: List all security groups inside a project. -Get a list of all security groups inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -23021,6 +24062,7 @@ func (a *APIClient) ListSecurityGroups(ctx context.Context, projectId string, re } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId string, region string) (*SecurityGroupListResponse, error) { r := ListSecurityGroupsRequest{ apiService: a.defaultApi, @@ -23031,6 +24073,7 @@ func (a *APIClient) ListSecurityGroupsExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServerNICsRequest struct { ctx context.Context apiService *DefaultApiService @@ -23039,6 +24082,7 @@ type ListServerNICsRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListServerNICsRequest) Execute() (*NICListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -23199,7 +24243,7 @@ func (r ListServerNICsRequest) Execute() (*NICListResponse, error) { /* ListServerNICs: Get all network interfaces. -Get all network interfaces attached to the server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -23217,6 +24261,7 @@ func (a *APIClient) ListServerNICs(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListServerNICsExecute(ctx context.Context, projectId string, region string, serverId string) (*NICListResponse, error) { r := ListServerNICsRequest{ apiService: a.defaultApi, @@ -23228,6 +24273,7 @@ func (a *APIClient) ListServerNICsExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServerServiceAccountsRequest struct { ctx context.Context apiService *DefaultApiService @@ -23236,6 +24282,7 @@ type ListServerServiceAccountsRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -23396,7 +24443,7 @@ func (r ListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResp /* ListServerServiceAccounts: List all service accounts of the Server. -Get the list of the service accounts of the server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -23414,6 +24461,7 @@ func (a *APIClient) ListServerServiceAccounts(ctx context.Context, projectId str } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListServerServiceAccountsExecute(ctx context.Context, projectId string, region string, serverId string) (*ServiceAccountMailListResponse, error) { r := ListServerServiceAccountsRequest{ apiService: a.defaultApi, @@ -23425,6 +24473,7 @@ func (a *APIClient) ListServerServiceAccountsExecute(ctx context.Context, projec return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListServersRequest struct { ctx context.Context apiService *DefaultApiService @@ -23435,19 +24484,20 @@ type ListServersRequest struct { } // Show detailed information about server. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListServersRequest) Details(details bool) ApiListServersRequest { r.details = &details return r } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListServersRequest) LabelSelector(labelSelector string) ApiListServersRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListServersRequest) Execute() (*ServerListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -23607,7 +24657,7 @@ func (r ListServersRequest) Execute() (*ServerListResponse, error) { /* ListServers: List all servers inside a project. -Get a list of all servers inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -23623,6 +24673,7 @@ func (a *APIClient) ListServers(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListServersExecute(ctx context.Context, projectId string, region string) (*ServerListResponse, error) { r := ListServersRequest{ apiService: a.defaultApi, @@ -23633,6 +24684,7 @@ func (a *APIClient) ListServersExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListSnapshotsInProjectRequest struct { ctx context.Context apiService *DefaultApiService @@ -23642,12 +24694,13 @@ type ListSnapshotsInProjectRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListSnapshotsInProjectRequest) LabelSelector(labelSelector string) ApiListSnapshotsInProjectRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListSnapshotsInProjectRequest) Execute() (*SnapshotListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -23804,7 +24857,7 @@ func (r ListSnapshotsInProjectRequest) Execute() (*SnapshotListResponse, error) /* ListSnapshotsInProject: List all snapshots inside a project. -Get a list of all snapshots inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -23820,6 +24873,7 @@ func (a *APIClient) ListSnapshotsInProject(ctx context.Context, projectId string } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListSnapshotsInProjectExecute(ctx context.Context, projectId string, region string) (*SnapshotListResponse, error) { r := ListSnapshotsInProjectRequest{ apiService: a.defaultApi, @@ -23830,6 +24884,7 @@ func (a *APIClient) ListSnapshotsInProjectExecute(ctx context.Context, projectId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListVolumePerformanceClassesRequest struct { ctx context.Context apiService *DefaultApiService @@ -23839,12 +24894,13 @@ type ListVolumePerformanceClassesRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListVolumePerformanceClassesRequest) LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -24001,7 +25057,7 @@ func (r ListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassL /* ListVolumePerformanceClasses: List all volume performance classes available for a project. -Get a list of all volume performance classes available inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -24017,6 +25073,7 @@ func (a *APIClient) ListVolumePerformanceClasses(ctx context.Context, projectId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListVolumePerformanceClassesExecute(ctx context.Context, projectId string, region string) (*VolumePerformanceClassListResponse, error) { r := ListVolumePerformanceClassesRequest{ apiService: a.defaultApi, @@ -24027,6 +25084,7 @@ func (a *APIClient) ListVolumePerformanceClassesExecute(ctx context.Context, pro return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListVolumesRequest struct { ctx context.Context apiService *DefaultApiService @@ -24036,12 +25094,13 @@ type ListVolumesRequest struct { } // Filter resources by labels. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListVolumesRequest) LabelSelector(labelSelector string) ApiListVolumesRequest { r.labelSelector = &labelSelector return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListVolumesRequest) Execute() (*VolumeListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -24198,7 +25257,7 @@ func (r ListVolumesRequest) Execute() (*VolumeListResponse, error) { /* ListVolumes: List all volumes inside a project. -Get a list of all volumes inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -24214,6 +25273,7 @@ func (a *APIClient) ListVolumes(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListVolumesExecute(ctx context.Context, projectId string, region string) (*VolumeListResponse, error) { r := ListVolumesRequest{ apiService: a.defaultApi, @@ -24224,6 +25284,7 @@ func (a *APIClient) ListVolumesExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkRequest struct { ctx context.Context apiService *DefaultApiService @@ -24234,12 +25295,13 @@ type PartialUpdateNetworkRequest struct { } // Request an update of a network. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PartialUpdateNetworkRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPatch @@ -24394,7 +25456,7 @@ func (r PartialUpdateNetworkRequest) Execute() error { /* PartialUpdateNetwork: Update network settings. -Update the settings of a network inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -24412,6 +25474,7 @@ func (a *APIClient) PartialUpdateNetwork(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) PartialUpdateNetworkExecute(ctx context.Context, projectId string, region string, networkId string) error { r := PartialUpdateNetworkRequest{ apiService: a.defaultApi, @@ -24423,6 +25486,7 @@ func (a *APIClient) PartialUpdateNetworkExecute(ctx context.Context, projectId s return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -24432,12 +25496,13 @@ type PartialUpdateNetworkAreaRequest struct { } // Request to update an Area. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PartialUpdateNetworkAreaRequest) PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest { r.partialUpdateNetworkAreaPayload = &partialUpdateNetworkAreaPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PartialUpdateNetworkAreaRequest) Execute() (*NetworkArea, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -24602,7 +25667,7 @@ func (r PartialUpdateNetworkAreaRequest) Execute() (*NetworkArea, error) { /* PartialUpdateNetworkArea: Update network area settings. -Update the settings of a network area in an organization. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -24618,6 +25683,7 @@ func (a *APIClient) PartialUpdateNetworkArea(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) PartialUpdateNetworkAreaExecute(ctx context.Context, organizationId string, areaId string) (*NetworkArea, error) { r := PartialUpdateNetworkAreaRequest{ apiService: a.defaultApi, @@ -24628,6 +25694,7 @@ func (a *APIClient) PartialUpdateNetworkAreaExecute(ctx context.Context, organiz return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RebootServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -24638,12 +25705,13 @@ type RebootServerRequest struct { } // Defines if it is a soft or a hard reboot. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RebootServerRequest) Action(action string) ApiRebootServerRequest { r.action = &action return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RebootServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -24807,7 +25875,7 @@ func (r RebootServerRequest) Execute() error { /* RebootServer: Reboot the server. -Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -24825,6 +25893,7 @@ func (a *APIClient) RebootServer(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RebootServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := RebootServerRequest{ apiService: a.defaultApi, @@ -24836,6 +25905,7 @@ func (a *APIClient) RebootServerExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RemoveNetworkFromServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -24845,6 +25915,7 @@ type RemoveNetworkFromServerRequest struct { networkId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RemoveNetworkFromServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -25001,7 +26072,7 @@ func (r RemoveNetworkFromServerRequest) Execute() error { /* RemoveNetworkFromServer: Detach and delete all network interfaces associated with the specified network. -Detach and delete all network interfaces associated with the specified network from the server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -25021,6 +26092,7 @@ func (a *APIClient) RemoveNetworkFromServer(ctx context.Context, projectId strin } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RemoveNetworkFromServerExecute(ctx context.Context, projectId string, region string, serverId string, networkId string) error { r := RemoveNetworkFromServerRequest{ apiService: a.defaultApi, @@ -25033,6 +26105,7 @@ func (a *APIClient) RemoveNetworkFromServerExecute(ctx context.Context, projectI return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RemoveNicFromServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -25042,6 +26115,7 @@ type RemoveNicFromServerRequest struct { nicId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RemoveNicFromServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -25198,7 +26272,7 @@ func (r RemoveNicFromServerRequest) Execute() error { /* RemoveNicFromServer: Detach a network interface. -Detach a network interface from a server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -25218,6 +26292,7 @@ func (a *APIClient) RemoveNicFromServer(ctx context.Context, projectId string, r } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RemoveNicFromServerExecute(ctx context.Context, projectId string, region string, serverId string, nicId string) error { r := RemoveNicFromServerRequest{ apiService: a.defaultApi, @@ -25230,6 +26305,7 @@ func (a *APIClient) RemoveNicFromServerExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RemovePublicIpFromServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -25239,6 +26315,7 @@ type RemovePublicIpFromServerRequest struct { publicIpId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RemovePublicIpFromServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -25406,7 +26483,7 @@ func (r RemovePublicIpFromServerRequest) Execute() error { /* RemovePublicIpFromServer: Dissociate a public IP from a server. -Dissociate a public IP on an existing server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -25426,6 +26503,7 @@ func (a *APIClient) RemovePublicIpFromServer(ctx context.Context, projectId stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RemovePublicIpFromServerExecute(ctx context.Context, projectId string, region string, serverId string, publicIpId string) error { r := RemovePublicIpFromServerRequest{ apiService: a.defaultApi, @@ -25438,6 +26516,7 @@ func (a *APIClient) RemovePublicIpFromServerExecute(ctx context.Context, project return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RemoveSecurityGroupFromServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -25447,6 +26526,7 @@ type RemoveSecurityGroupFromServerRequest struct { securityGroupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RemoveSecurityGroupFromServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -25614,7 +26694,7 @@ func (r RemoveSecurityGroupFromServerRequest) Execute() error { /* RemoveSecurityGroupFromServer: Remove a server from a security group. -Remove a server from a attached security group. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -25634,6 +26714,7 @@ func (a *APIClient) RemoveSecurityGroupFromServer(ctx context.Context, projectId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RemoveSecurityGroupFromServerExecute(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) error { r := RemoveSecurityGroupFromServerRequest{ apiService: a.defaultApi, @@ -25646,6 +26727,7 @@ func (a *APIClient) RemoveSecurityGroupFromServerExecute(ctx context.Context, pr return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RemoveServiceAccountFromServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -25655,6 +26737,7 @@ type RemoveServiceAccountFromServerRequest struct { serviceAccountMail string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailListResponse, error) { var ( localVarHTTPMethod = http.MethodDelete @@ -25830,7 +26913,7 @@ func (r RemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailLis /* RemoveServiceAccountFromServer: Detach a service account from a server. -Detach an additional service account from the server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -25850,6 +26933,7 @@ func (a *APIClient) RemoveServiceAccountFromServer(ctx context.Context, projectI } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RemoveServiceAccountFromServerExecute(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) (*ServiceAccountMailListResponse, error) { r := RemoveServiceAccountFromServerRequest{ apiService: a.defaultApi, @@ -25862,6 +26946,7 @@ func (a *APIClient) RemoveServiceAccountFromServerExecute(ctx context.Context, p return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RemoveVolumeFromServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -25871,6 +26956,7 @@ type RemoveVolumeFromServerRequest struct { volumeId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RemoveVolumeFromServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -26038,7 +27124,7 @@ func (r RemoveVolumeFromServerRequest) Execute() error { /* RemoveVolumeFromServer: Detach a volume from a server. -Detach an existing volume from an existing server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -26058,6 +27144,7 @@ func (a *APIClient) RemoveVolumeFromServer(ctx context.Context, projectId string } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RemoveVolumeFromServerExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) error { r := RemoveVolumeFromServerRequest{ apiService: a.defaultApi, @@ -26070,6 +27157,7 @@ func (a *APIClient) RemoveVolumeFromServerExecute(ctx context.Context, projectId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RescueServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -26080,12 +27168,13 @@ type RescueServerRequest struct { } // Request a server rescue. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RescueServerRequest) RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest { r.rescueServerPayload = &rescueServerPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RescueServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -26251,7 +27340,7 @@ func (r RescueServerRequest) Execute() error { /* RescueServer: Rescue an existing server. -Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -26269,6 +27358,7 @@ func (a *APIClient) RescueServer(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RescueServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := RescueServerRequest{ apiService: a.defaultApi, @@ -26280,6 +27370,7 @@ func (a *APIClient) RescueServerExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -26290,12 +27381,13 @@ type ResizeServerRequest struct { } // Request a resize of a server. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ResizeServerRequest) ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest { r.resizeServerPayload = &resizeServerPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ResizeServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -26461,7 +27553,7 @@ func (r ResizeServerRequest) Execute() error { /* ResizeServer: Resize a server. -Resize the server to the given machine type. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -26479,6 +27571,7 @@ func (a *APIClient) ResizeServer(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ResizeServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := ResizeServerRequest{ apiService: a.defaultApi, @@ -26490,6 +27583,7 @@ func (a *APIClient) ResizeServerExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -26500,12 +27594,13 @@ type ResizeVolumeRequest struct { } // Request a volume resize. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ResizeVolumeRequest) ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest { r.resizeVolumePayload = &resizeVolumePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ResizeVolumeRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -26668,7 +27763,7 @@ func (r ResizeVolumeRequest) Execute() error { /* ResizeVolume: Update the size of a volume. -Update the size of a block device volume. The new volume size must be larger than the current size. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -26686,6 +27781,7 @@ func (a *APIClient) ResizeVolume(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ResizeVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) error { r := ResizeVolumeRequest{ apiService: a.defaultApi, @@ -26697,6 +27793,7 @@ func (a *APIClient) ResizeVolumeExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -26705,6 +27802,7 @@ type RestoreBackupRequest struct { backupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RestoreBackupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -26854,7 +27952,7 @@ func (r RestoreBackupRequest) Execute() error { /* RestoreBackup: Restore Backup to the referenced source Volume. -Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -26872,6 +27970,7 @@ func (a *APIClient) RestoreBackup(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RestoreBackupExecute(ctx context.Context, projectId string, region string, backupId string) error { r := RestoreBackupRequest{ apiService: a.defaultApi, @@ -26883,6 +27982,7 @@ func (a *APIClient) RestoreBackupExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SetImageShareRequest struct { ctx context.Context apiService *DefaultApiService @@ -26893,12 +27993,13 @@ type SetImageShareRequest struct { } // Settings for an Image Share. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r SetImageShareRequest) SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest { r.setImageSharePayload = &setImageSharePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r SetImageShareRequest) Execute() (*ImageShare, error) { var ( localVarHTTPMethod = http.MethodPut @@ -27064,7 +28165,7 @@ func (r SetImageShareRequest) Execute() (*ImageShare, error) { /* SetImageShare: Set image share. -Set share of an Image. New Options will replace existing settings. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -27082,6 +28183,7 @@ func (a *APIClient) SetImageShare(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) SetImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) { r := SetImageShareRequest{ apiService: a.defaultApi, @@ -27093,6 +28195,7 @@ func (a *APIClient) SetImageShareExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StartServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -27101,6 +28204,7 @@ type StartServerRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r StartServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -27261,7 +28365,7 @@ func (r StartServerRequest) Execute() error { /* StartServer: Boot up a server. -Start an existing server or allocates the server if deallocated. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -27279,6 +28383,7 @@ func (a *APIClient) StartServer(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) StartServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := StartServerRequest{ apiService: a.defaultApi, @@ -27290,6 +28395,7 @@ func (a *APIClient) StartServerExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StopServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -27298,6 +28404,7 @@ type StopServerRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r StopServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -27458,7 +28565,7 @@ func (r StopServerRequest) Execute() error { /* StopServer: Stop an existing server. -Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -27476,6 +28583,7 @@ func (a *APIClient) StopServer(ctx context.Context, projectId string, region str } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) StopServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := StopServerRequest{ apiService: a.defaultApi, @@ -27487,6 +28595,7 @@ func (a *APIClient) StopServerExecute(ctx context.Context, projectId string, reg return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UnrescueServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -27495,6 +28604,7 @@ type UnrescueServerRequest struct { serverId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UnrescueServerRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -27655,7 +28765,7 @@ func (r UnrescueServerRequest) Execute() error { /* UnrescueServer: Unrescue an existing server. -Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -27673,6 +28783,7 @@ func (a *APIClient) UnrescueServer(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UnrescueServerExecute(ctx context.Context, projectId string, region string, serverId string) error { r := UnrescueServerRequest{ apiService: a.defaultApi, @@ -27684,6 +28795,7 @@ func (a *APIClient) UnrescueServerExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -27695,12 +28807,13 @@ type UpdateAttachedVolumeRequest struct { } // Request a volume attachment update. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateAttachedVolumeRequest) UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest { r.updateAttachedVolumePayload = &updateAttachedVolumePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -27873,7 +28986,7 @@ func (r UpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { /* UpdateAttachedVolume: Update Volume Attachment Parameters. -Update the properties of an existing Volume Attachment. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -27893,6 +29006,7 @@ func (a *APIClient) UpdateAttachedVolume(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateAttachedVolumeExecute(ctx context.Context, projectId string, region string, serverId string, volumeId string) (*VolumeAttachment, error) { r := UpdateAttachedVolumeRequest{ apiService: a.defaultApi, @@ -27905,6 +29019,7 @@ func (a *APIClient) UpdateAttachedVolumeExecute(ctx context.Context, projectId s return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -27915,12 +29030,13 @@ type UpdateBackupRequest struct { } // Request an update of a backup. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateBackupRequest) UpdateBackupPayload(updateBackupPayload UpdateBackupPayload) ApiUpdateBackupRequest { r.updateBackupPayload = &updateBackupPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateBackupRequest) Execute() (*Backup, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -28086,7 +29202,7 @@ func (r UpdateBackupRequest) Execute() (*Backup, error) { /* UpdateBackup: Update information of a backup. -Update name or labels of the backup. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -28104,6 +29220,7 @@ func (a *APIClient) UpdateBackup(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateBackupExecute(ctx context.Context, projectId string, region string, backupId string) (*Backup, error) { r := UpdateBackupRequest{ apiService: a.defaultApi, @@ -28115,6 +29232,7 @@ func (a *APIClient) UpdateBackupExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageRequest struct { ctx context.Context apiService *DefaultApiService @@ -28125,12 +29243,13 @@ type UpdateImageRequest struct { } // Request an update of an Image. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateImageRequest) UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest { r.updateImagePayload = &updateImagePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateImageRequest) Execute() (*Image, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -28296,7 +29415,7 @@ func (r UpdateImageRequest) Execute() (*Image, error) { /* UpdateImage: Update Image Parameters. -Update the properties of an existing Image inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -28314,6 +29433,7 @@ func (a *APIClient) UpdateImage(ctx context.Context, projectId string, region st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateImageExecute(ctx context.Context, projectId string, region string, imageId string) (*Image, error) { r := UpdateImageRequest{ apiService: a.defaultApi, @@ -28325,6 +29445,7 @@ func (a *APIClient) UpdateImageExecute(ctx context.Context, projectId string, re return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageShareRequest struct { ctx context.Context apiService *DefaultApiService @@ -28335,12 +29456,13 @@ type UpdateImageShareRequest struct { } // Update an Image Share. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateImageShareRequest) UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest { r.updateImageSharePayload = &updateImageSharePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateImageShareRequest) Execute() (*ImageShare, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -28506,7 +29628,7 @@ func (r UpdateImageShareRequest) Execute() (*ImageShare, error) { /* UpdateImageShare: Update image share. -Update share of an Image. Projects will be appended to existing list. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -28524,6 +29646,7 @@ func (a *APIClient) UpdateImageShare(ctx context.Context, projectId string, regi } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateImageShareExecute(ctx context.Context, projectId string, region string, imageId string) (*ImageShare, error) { r := UpdateImageShareRequest{ apiService: a.defaultApi, @@ -28535,6 +29658,7 @@ func (a *APIClient) UpdateImageShareExecute(ctx context.Context, projectId strin return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateKeyPairRequest struct { ctx context.Context apiService *DefaultApiService @@ -28543,12 +29667,13 @@ type UpdateKeyPairRequest struct { } // Request an update of an SSH keypair. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateKeyPairRequest) UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest { r.updateKeyPairPayload = &updateKeyPairPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -28703,7 +29828,7 @@ func (r UpdateKeyPairRequest) Execute() (*Keypair, error) { /* UpdateKeyPair: Update information of an SSH keypair. -Update labels of the SSH keypair. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param keypairName The name of an SSH keypair. @@ -28717,6 +29842,7 @@ func (a *APIClient) UpdateKeyPair(ctx context.Context, keypairName string) ApiUp } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateKeyPairExecute(ctx context.Context, keypairName string) (*Keypair, error) { r := UpdateKeyPairRequest{ apiService: a.defaultApi, @@ -28726,6 +29852,7 @@ func (a *APIClient) UpdateKeyPairExecute(ctx context.Context, keypairName string return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRegionRequest struct { ctx context.Context apiService *DefaultApiService @@ -28736,12 +29863,13 @@ type UpdateNetworkAreaRegionRequest struct { } // Request an update of a regional network area. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateNetworkAreaRegionRequest) UpdateNetworkAreaRegionPayload(updateNetworkAreaRegionPayload UpdateNetworkAreaRegionPayload) ApiUpdateNetworkAreaRegionRequest { r.updateNetworkAreaRegionPayload = &updateNetworkAreaRegionPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -28918,7 +30046,7 @@ func (r UpdateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { /* UpdateNetworkAreaRegion: Update a region for a network area. -Update a new region for a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -28936,6 +30064,7 @@ func (a *APIClient) UpdateNetworkAreaRegion(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateNetworkAreaRegionExecute(ctx context.Context, organizationId string, areaId string, region string) (*RegionalArea, error) { r := UpdateNetworkAreaRegionRequest{ apiService: a.defaultApi, @@ -28947,6 +30076,7 @@ func (a *APIClient) UpdateNetworkAreaRegionExecute(ctx context.Context, organiza return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRouteRequest struct { ctx context.Context apiService *DefaultApiService @@ -28958,12 +30088,13 @@ type UpdateNetworkAreaRouteRequest struct { } // Request an update of a network route. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateNetworkAreaRouteRequest) UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload UpdateNetworkAreaRoutePayload) ApiUpdateNetworkAreaRouteRequest { r.updateNetworkAreaRoutePayload = &updateNetworkAreaRoutePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateNetworkAreaRouteRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -29136,7 +30267,7 @@ func (r UpdateNetworkAreaRouteRequest) Execute() (*Route, error) { /* UpdateNetworkAreaRoute: Update a network route. -Update a network route defined in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -29156,6 +30287,7 @@ func (a *APIClient) UpdateNetworkAreaRoute(ctx context.Context, organizationId s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateNetworkAreaRouteExecute(ctx context.Context, organizationId string, areaId string, region string, routeId string) (*Route, error) { r := UpdateNetworkAreaRouteRequest{ apiService: a.defaultApi, @@ -29168,6 +30300,7 @@ func (a *APIClient) UpdateNetworkAreaRouteExecute(ctx context.Context, organizat return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicRequest struct { ctx context.Context apiService *DefaultApiService @@ -29179,12 +30312,13 @@ type UpdateNicRequest struct { } // Request an update of a network interface. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateNicRequest) UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest { r.updateNicPayload = &updateNicPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateNicRequest) Execute() (*NIC, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -29368,7 +30502,7 @@ func (r UpdateNicRequest) Execute() (*NIC, error) { /* UpdateNic: Update a network interface. -Update the properties of an existing network interface inside a network. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -29388,6 +30522,7 @@ func (a *APIClient) UpdateNic(ctx context.Context, projectId string, region stri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateNicExecute(ctx context.Context, projectId string, region string, networkId string, nicId string) (*NIC, error) { r := UpdateNicRequest{ apiService: a.defaultApi, @@ -29400,6 +30535,7 @@ func (a *APIClient) UpdateNicExecute(ctx context.Context, projectId string, regi return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPRequest struct { ctx context.Context apiService *DefaultApiService @@ -29410,12 +30546,13 @@ type UpdatePublicIPRequest struct { } // Request an update of a public IP. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { r.updatePublicIPPayload = &updatePublicIPPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -29581,7 +30718,7 @@ func (r UpdatePublicIPRequest) Execute() (*PublicIp, error) { /* UpdatePublicIP: Update a public IP. -Update the properties of an existing public IP inside a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -29599,6 +30736,7 @@ func (a *APIClient) UpdatePublicIP(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdatePublicIPExecute(ctx context.Context, projectId string, region string, publicIpId string) (*PublicIp, error) { r := UpdatePublicIPRequest{ apiService: a.defaultApi, @@ -29610,6 +30748,7 @@ func (a *APIClient) UpdatePublicIPExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRouteOfRoutingTableRequest struct { ctx context.Context apiService *DefaultApiService @@ -29622,12 +30761,13 @@ type UpdateRouteOfRoutingTableRequest struct { } // Request an update of a route in a routing table. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateRouteOfRoutingTableRequest) UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest { r.updateRouteOfRoutingTablePayload = &updateRouteOfRoutingTablePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateRouteOfRoutingTableRequest) Execute() (*Route, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -29807,7 +30947,7 @@ func (r UpdateRouteOfRoutingTableRequest) Execute() (*Route, error) { /* UpdateRouteOfRoutingTable: Update a route of a routing table. -Update a route defined in a routing table. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -29829,6 +30969,7 @@ func (a *APIClient) UpdateRouteOfRoutingTable(ctx context.Context, organizationI } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateRouteOfRoutingTableExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) (*Route, error) { r := UpdateRouteOfRoutingTableRequest{ apiService: a.defaultApi, @@ -29842,6 +30983,7 @@ func (a *APIClient) UpdateRouteOfRoutingTableExecute(ctx context.Context, organi return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaRequest struct { ctx context.Context apiService *DefaultApiService @@ -29853,12 +30995,13 @@ type UpdateRoutingTableOfAreaRequest struct { } // Request an update of a routing table. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateRoutingTableOfAreaRequest) UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest { r.updateRoutingTableOfAreaPayload = &updateRoutingTableOfAreaPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -30031,7 +31174,7 @@ func (r UpdateRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { /* UpdateRoutingTableOfArea: Update a routing table. -Update a routing table defined in a network area. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param organizationId The identifier (ID) of a STACKIT Organization. @@ -30051,6 +31194,7 @@ func (a *APIClient) UpdateRoutingTableOfArea(ctx context.Context, organizationId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateRoutingTableOfAreaExecute(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) (*RoutingTable, error) { r := UpdateRoutingTableOfAreaRequest{ apiService: a.defaultApi, @@ -30063,6 +31207,7 @@ func (a *APIClient) UpdateRoutingTableOfAreaExecute(ctx context.Context, organiz return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupRequest struct { ctx context.Context apiService *DefaultApiService @@ -30073,12 +31218,13 @@ type UpdateSecurityGroupRequest struct { } // Request an update of a security group. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateSecurityGroupRequest) UpdateSecurityGroupPayload(updateSecurityGroupPayload UpdateSecurityGroupPayload) ApiUpdateSecurityGroupRequest { r.updateSecurityGroupPayload = &updateSecurityGroupPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -30244,7 +31390,7 @@ func (r UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { /* UpdateSecurityGroup: Update information of a security group. -Update labels of the security group. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -30262,6 +31408,7 @@ func (a *APIClient) UpdateSecurityGroup(ctx context.Context, projectId string, r } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateSecurityGroupExecute(ctx context.Context, projectId string, region string, securityGroupId string) (*SecurityGroup, error) { r := UpdateSecurityGroupRequest{ apiService: a.defaultApi, @@ -30273,6 +31420,7 @@ func (a *APIClient) UpdateSecurityGroupExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerRequest struct { ctx context.Context apiService *DefaultApiService @@ -30283,12 +31431,13 @@ type UpdateServerRequest struct { } // Request an update of a server. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateServerRequest) UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest { r.updateServerPayload = &updateServerPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateServerRequest) Execute() (*Server, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -30454,7 +31603,7 @@ func (r UpdateServerRequest) Execute() (*Server, error) { /* UpdateServer: Update information of a server. -Update name or labels of the server. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -30472,6 +31621,7 @@ func (a *APIClient) UpdateServer(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateServerExecute(ctx context.Context, projectId string, region string, serverId string) (*Server, error) { r := UpdateServerRequest{ apiService: a.defaultApi, @@ -30483,6 +31633,7 @@ func (a *APIClient) UpdateServerExecute(ctx context.Context, projectId string, r return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSnapshotRequest struct { ctx context.Context apiService *DefaultApiService @@ -30493,12 +31644,13 @@ type UpdateSnapshotRequest struct { } // Request an update of a snapshot. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateSnapshotRequest) UpdateSnapshotPayload(updateSnapshotPayload UpdateSnapshotPayload) ApiUpdateSnapshotRequest { r.updateSnapshotPayload = &updateSnapshotPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateSnapshotRequest) Execute() (*Snapshot, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -30664,7 +31816,7 @@ func (r UpdateSnapshotRequest) Execute() (*Snapshot, error) { /* UpdateSnapshot: Update information of the snapshot. -Update information like name or labels of the snapshot. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -30682,6 +31834,7 @@ func (a *APIClient) UpdateSnapshot(ctx context.Context, projectId string, region } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateSnapshotExecute(ctx context.Context, projectId string, region string, snapshotId string) (*Snapshot, error) { r := UpdateSnapshotRequest{ apiService: a.defaultApi, @@ -30693,6 +31846,7 @@ func (a *APIClient) UpdateSnapshotExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumeRequest struct { ctx context.Context apiService *DefaultApiService @@ -30703,12 +31857,13 @@ type UpdateVolumeRequest struct { } // Request an update of a volume. - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateVolumeRequest) UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest { r.updateVolumePayload = &updateVolumePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateVolumeRequest) Execute() (*Volume, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -30874,7 +32029,7 @@ func (r UpdateVolumeRequest) Execute() (*Volume, error) { /* UpdateVolume: Update information of a volume. -Update name, description or labels of the volume. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId The identifier (ID) of a STACKIT Project. @@ -30892,6 +32047,7 @@ func (a *APIClient) UpdateVolume(ctx context.Context, projectId string, region s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateVolumeExecute(ctx context.Context, projectId string, region string, volumeId string) (*Volume, error) { r := UpdateVolumeRequest{ apiService: a.defaultApi, diff --git a/services/iaas/client.go b/services/iaas/client.go index 3311006ab..47881419b 100644 --- a/services/iaas/client.go +++ b/services/iaas/client.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -44,18 +45,21 @@ var ( // APIClient manages communication with the STACKIT IaaS API API v2 // In most cases there should be only one, shared, APIClient. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { cfg *config.Configuration common service // Reuse a single struct instead of allocating one for each service on the heap. defaultApi *DefaultApiService } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type service struct { client DefaultApi } // NewAPIClient creates a new API client. // Optionally receives configuration options +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { cfg := NewConfiguration() @@ -147,6 +151,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func ParameterValueToString(obj interface{}, key string) string { if reflect.TypeOf(obj).Kind() != reflect.Ptr { return fmt.Sprintf("%v", obj) @@ -285,6 +290,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (c *APIClient) GetConfig() *config.Configuration { return c.cfg } @@ -595,6 +601,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time diff --git a/services/iaas/configuration.go b/services/iaas/configuration.go index 25d2f4f2d..0dce4d983 100644 --- a/services/iaas/configuration.go +++ b/services/iaas/configuration.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -15,6 +16,7 @@ import ( ) // NewConfiguration returns a new Configuration object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfiguration() *config.Configuration { cfg := &config.Configuration{ DefaultHeader: make(map[string]string), diff --git a/services/iaas/go.mod b/services/iaas/go.mod index 39c30c2aa..9efd5dda0 100644 --- a/services/iaas/go.mod +++ b/services/iaas/go.mod @@ -4,8 +4,8 @@ go 1.21 require ( github.com/google/go-cmp v0.7.0 - github.com/stackitcloud/stackit-sdk-go/core v0.21.1 - github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.18.5 + github.com/stackitcloud/stackit-sdk-go/core v0.22.0 + github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.19.0 ) require ( diff --git a/services/iaas/go.sum b/services/iaas/go.sum index ff632f94e..e22f1019a 100644 --- a/services/iaas/go.sum +++ b/services/iaas/go.sum @@ -4,7 +4,7 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= -github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.18.5 h1:MZ5aTO2NQ1Jecmi67ByGskve5nKXHl91fE+z+vFjxt4= -github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.18.5/go.mod h1:CJLmdqWvJm5/3+lXPDKu8k4WXs2UG8euGoqQX5xE79k= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= +github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.19.0 h1:OcjYHjTsKLlOz8GF2owYdJK0cUqGGzjHRQLYUH0vMnQ= +github.com/stackitcloud/stackit-sdk-go/services/resourcemanager v0.19.0/go.mod h1:jiPIzF8lcm5Dx0TkDK2CBgeRBHSRUqwyX+z/zqo1bes= diff --git a/services/iaas/model_add_routes_to_routing_table_payload.go b/services/iaas/model_add_routes_to_routing_table_payload.go index 7a6536f1e..82e518ebb 100644 --- a/services/iaas/model_add_routes_to_routing_table_payload.go +++ b/services/iaas/model_add_routes_to_routing_table_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &AddRoutesToRoutingTablePayload{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutesToRoutingTablePayloadGetItemsAttributeType = *[]Route + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutesToRoutingTablePayloadGetItemsArgType = []Route + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutesToRoutingTablePayloadGetItemsRetType = []Route +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutesToRoutingTablePayloadGetItemsAttributeTypeOk(arg AddRoutesToRoutingTablePayloadGetItemsAttributeType) (ret AddRoutesToRoutingTablePayloadGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getAddRoutesToRoutingTablePayloadGetItemsAttributeTypeOk(arg AddRoutesToRou return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutesToRoutingTablePayloadGetItemsAttributeType(arg *AddRoutesToRoutingTablePayloadGetItemsAttributeType, val AddRoutesToRoutingTablePayloadGetItemsRetType) { *arg = &val } // AddRoutesToRoutingTablePayload Object represents a request to add network routes. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutesToRoutingTablePayload struct { // A list of routes. // REQUIRED Items AddRoutesToRoutingTablePayloadGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _AddRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload // NewAddRoutesToRoutingTablePayload instantiates a new AddRoutesToRoutingTablePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAddRoutesToRoutingTablePayload(items AddRoutesToRoutingTablePayloadGetItemsArgType) *AddRoutesToRoutingTablePayload { this := AddRoutesToRoutingTablePayload{} setAddRoutesToRoutingTablePayloadGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewAddRoutesToRoutingTablePayload(items AddRoutesToRoutingTablePayloadGetIt // NewAddRoutesToRoutingTablePayloadWithDefaults instantiates a new AddRoutesToRoutingTablePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAddRoutesToRoutingTablePayloadWithDefaults() *AddRoutesToRoutingTablePayload { this := AddRoutesToRoutingTablePayload{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutesToRoutingTablePayload) GetItems() (ret AddRoutesToRoutingTablePayloadGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *AddRoutesToRoutingTablePayload) GetItems() (ret AddRoutesToRoutingTable // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutesToRoutingTablePayload) GetItemsOk() (ret AddRoutesToRoutingTablePayloadGetItemsRetType, ok bool) { return getAddRoutesToRoutingTablePayloadGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutesToRoutingTablePayload) SetItems(v AddRoutesToRoutingTablePayloadGetItemsRetType) { setAddRoutesToRoutingTablePayloadGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o AddRoutesToRoutingTablePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getAddRoutesToRoutingTablePayloadGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o AddRoutesToRoutingTablePayload) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableAddRoutesToRoutingTablePayload struct { value *AddRoutesToRoutingTablePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddRoutesToRoutingTablePayload) Get() *AddRoutesToRoutingTablePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddRoutesToRoutingTablePayload) Set(val *AddRoutesToRoutingTablePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddRoutesToRoutingTablePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddRoutesToRoutingTablePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableAddRoutesToRoutingTablePayload(val *AddRoutesToRoutingTablePayload) *NullableAddRoutesToRoutingTablePayload { return &NullableAddRoutesToRoutingTablePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddRoutesToRoutingTablePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_add_routing_table_to_area_payload.go b/services/iaas/model_add_routing_table_to_area_payload.go index 172f06058..f42e2b513 100644 --- a/services/iaas/model_add_routing_table_to_area_payload.go +++ b/services/iaas/model_add_routing_table_to_area_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &AddRoutingTableToAreaPayload{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadGetCreatedAtAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetCreatedAtAttributeType) (ret AddRoutingTableToAreaPayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getAddRoutingTableToAreaPayloadGetCreatedAtAttributeTypeOk(arg AddRoutingTa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadGetCreatedAtAttributeType(arg *AddRoutingTableToAreaPayloadGetCreatedAtAttributeType, val AddRoutingTableToAreaPayloadGetCreatedAtRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setAddRoutingTableToAreaPayloadGetCreatedAtAttributeType(arg *AddRoutingTab */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetDefaultAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetDefaultArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetDefaultRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadgetDefaultAttributeTypeOk(arg AddRoutingTableToAreaPayloadgetDefaultAttributeType) (ret AddRoutingTableToAreaPayloadgetDefaultRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getAddRoutingTableToAreaPayloadgetDefaultAttributeTypeOk(arg AddRoutingTabl return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadgetDefaultAttributeType(arg *AddRoutingTableToAreaPayloadgetDefaultAttributeType, val AddRoutingTableToAreaPayloadgetDefaultRetType) { *arg = &val } @@ -63,8 +78,10 @@ func setAddRoutingTableToAreaPayloadgetDefaultAttributeType(arg *AddRoutingTable */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadGetDescriptionAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetDescriptionAttributeType) (ret AddRoutingTableToAreaPayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +89,15 @@ func getAddRoutingTableToAreaPayloadGetDescriptionAttributeTypeOk(arg AddRouting return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadGetDescriptionAttributeType(arg *AddRoutingTableToAreaPayloadGetDescriptionAttributeType, val AddRoutingTableToAreaPayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetDescriptionRetType = string /* @@ -84,10 +105,16 @@ type AddRoutingTableToAreaPayloadGetDescriptionRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetDynamicRoutesArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetDynamicRoutesRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeTypeOk(arg AddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType) (ret AddRoutingTableToAreaPayloadgetDynamicRoutesRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +122,7 @@ func getAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeTypeOk(arg AddRouti return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType(arg *AddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType, val AddRoutingTableToAreaPayloadgetDynamicRoutesRetType) { *arg = &val } @@ -104,8 +132,10 @@ func setAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType(arg *AddRoutin */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadGetIdAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetIdAttributeType) (ret AddRoutingTableToAreaPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +143,15 @@ func getAddRoutingTableToAreaPayloadGetIdAttributeTypeOk(arg AddRoutingTableToAr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadGetIdAttributeType(arg *AddRoutingTableToAreaPayloadGetIdAttributeType, val AddRoutingTableToAreaPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetIdRetType = string /* @@ -125,10 +159,16 @@ type AddRoutingTableToAreaPayloadGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadGetLabelsAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetLabelsAttributeType) (ret AddRoutingTableToAreaPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -136,6 +176,7 @@ func getAddRoutingTableToAreaPayloadGetLabelsAttributeTypeOk(arg AddRoutingTable return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadGetLabelsAttributeType(arg *AddRoutingTableToAreaPayloadGetLabelsAttributeType, val AddRoutingTableToAreaPayloadGetLabelsRetType) { *arg = &val } @@ -145,8 +186,10 @@ func setAddRoutingTableToAreaPayloadGetLabelsAttributeType(arg *AddRoutingTableT */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadGetNameAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetNameAttributeType) (ret AddRoutingTableToAreaPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -154,11 +197,15 @@ func getAddRoutingTableToAreaPayloadGetNameAttributeTypeOk(arg AddRoutingTableTo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadGetNameAttributeType(arg *AddRoutingTableToAreaPayloadGetNameAttributeType, val AddRoutingTableToAreaPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetNameRetType = string /* @@ -166,10 +213,16 @@ type AddRoutingTableToAreaPayloadGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetSystemRoutesAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetSystemRoutesArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadgetSystemRoutesRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadgetSystemRoutesAttributeTypeOk(arg AddRoutingTableToAreaPayloadgetSystemRoutesAttributeType) (ret AddRoutingTableToAreaPayloadgetSystemRoutesRetType, ok bool) { if arg == nil { return ret, false @@ -177,6 +230,7 @@ func getAddRoutingTableToAreaPayloadgetSystemRoutesAttributeTypeOk(arg AddRoutin return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadgetSystemRoutesAttributeType(arg *AddRoutingTableToAreaPayloadgetSystemRoutesAttributeType, val AddRoutingTableToAreaPayloadgetSystemRoutesRetType) { *arg = &val } @@ -186,10 +240,16 @@ func setAddRoutingTableToAreaPayloadgetSystemRoutesAttributeType(arg *AddRouting */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddRoutingTableToAreaPayloadGetUpdatedAtAttributeTypeOk(arg AddRoutingTableToAreaPayloadGetUpdatedAtAttributeType) (ret AddRoutingTableToAreaPayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +257,13 @@ func getAddRoutingTableToAreaPayloadGetUpdatedAtAttributeTypeOk(arg AddRoutingTa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddRoutingTableToAreaPayloadGetUpdatedAtAttributeType(arg *AddRoutingTableToAreaPayloadGetUpdatedAtAttributeType, val AddRoutingTableToAreaPayloadGetUpdatedAtRetType) { *arg = &val } // AddRoutingTableToAreaPayload An object representing a routing table. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddRoutingTableToAreaPayload struct { // Date-time when resource was created. CreatedAt AddRoutingTableToAreaPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -213,7 +275,7 @@ type AddRoutingTableToAreaPayload struct { DynamicRoutes AddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType `json:"dynamicRoutes,omitempty"` // Universally Unique Identifier (UUID). Id AddRoutingTableToAreaPayloadGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels AddRoutingTableToAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED @@ -224,12 +286,14 @@ type AddRoutingTableToAreaPayload struct { UpdatedAt AddRoutingTableToAreaPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _AddRoutingTableToAreaPayload AddRoutingTableToAreaPayload // NewAddRoutingTableToAreaPayload instantiates a new AddRoutingTableToAreaPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAddRoutingTableToAreaPayload(name AddRoutingTableToAreaPayloadGetNameArgType) *AddRoutingTableToAreaPayload { this := AddRoutingTableToAreaPayload{} setAddRoutingTableToAreaPayloadGetNameAttributeType(&this.Name, name) @@ -239,6 +303,7 @@ func NewAddRoutingTableToAreaPayload(name AddRoutingTableToAreaPayloadGetNameArg // NewAddRoutingTableToAreaPayloadWithDefaults instantiates a new AddRoutingTableToAreaPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAddRoutingTableToAreaPayloadWithDefaults() *AddRoutingTableToAreaPayload { this := AddRoutingTableToAreaPayload{} var dynamicRoutes bool = true @@ -249,6 +314,7 @@ func NewAddRoutingTableToAreaPayloadWithDefaults() *AddRoutingTableToAreaPayload } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetCreatedAt() (res AddRoutingTableToAreaPayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -256,22 +322,26 @@ func (o *AddRoutingTableToAreaPayload) GetCreatedAt() (res AddRoutingTableToArea // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetCreatedAtOk() (ret AddRoutingTableToAreaPayloadGetCreatedAtRetType, ok bool) { return getAddRoutingTableToAreaPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetCreatedAt(v AddRoutingTableToAreaPayloadGetCreatedAtRetType) { setAddRoutingTableToAreaPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDefault returns the Default field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetDefault() (res AddRoutingTableToAreaPayloadgetDefaultRetType) { res, _ = o.GetDefaultOk() return @@ -279,22 +349,26 @@ func (o *AddRoutingTableToAreaPayload) GetDefault() (res AddRoutingTableToAreaPa // GetDefaultOk returns a tuple with the Default field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetDefaultOk() (ret AddRoutingTableToAreaPayloadgetDefaultRetType, ok bool) { return getAddRoutingTableToAreaPayloadgetDefaultAttributeTypeOk(o.Default) } // HasDefault returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) HasDefault() bool { _, ok := o.GetDefaultOk() return ok } // SetDefault gets a reference to the given bool and assigns it to the Default field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetDefault(v AddRoutingTableToAreaPayloadgetDefaultRetType) { setAddRoutingTableToAreaPayloadgetDefaultAttributeType(&o.Default, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetDescription() (res AddRoutingTableToAreaPayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -302,22 +376,26 @@ func (o *AddRoutingTableToAreaPayload) GetDescription() (res AddRoutingTableToAr // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetDescriptionOk() (ret AddRoutingTableToAreaPayloadGetDescriptionRetType, ok bool) { return getAddRoutingTableToAreaPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetDescription(v AddRoutingTableToAreaPayloadGetDescriptionRetType) { setAddRoutingTableToAreaPayloadGetDescriptionAttributeType(&o.Description, v) } // GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetDynamicRoutes() (res AddRoutingTableToAreaPayloadgetDynamicRoutesRetType) { res, _ = o.GetDynamicRoutesOk() return @@ -325,22 +403,26 @@ func (o *AddRoutingTableToAreaPayload) GetDynamicRoutes() (res AddRoutingTableTo // GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetDynamicRoutesOk() (ret AddRoutingTableToAreaPayloadgetDynamicRoutesRetType, ok bool) { return getAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeTypeOk(o.DynamicRoutes) } // HasDynamicRoutes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) HasDynamicRoutes() bool { _, ok := o.GetDynamicRoutesOk() return ok } // SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetDynamicRoutes(v AddRoutingTableToAreaPayloadgetDynamicRoutesRetType) { setAddRoutingTableToAreaPayloadgetDynamicRoutesAttributeType(&o.DynamicRoutes, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetId() (res AddRoutingTableToAreaPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -348,22 +430,26 @@ func (o *AddRoutingTableToAreaPayload) GetId() (res AddRoutingTableToAreaPayload // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetIdOk() (ret AddRoutingTableToAreaPayloadGetIdRetType, ok bool) { return getAddRoutingTableToAreaPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetId(v AddRoutingTableToAreaPayloadGetIdRetType) { setAddRoutingTableToAreaPayloadGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetLabels() (res AddRoutingTableToAreaPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -371,22 +457,26 @@ func (o *AddRoutingTableToAreaPayload) GetLabels() (res AddRoutingTableToAreaPay // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetLabelsOk() (ret AddRoutingTableToAreaPayloadGetLabelsRetType, ok bool) { return getAddRoutingTableToAreaPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetLabels(v AddRoutingTableToAreaPayloadGetLabelsRetType) { setAddRoutingTableToAreaPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetName() (ret AddRoutingTableToAreaPayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -394,16 +484,19 @@ func (o *AddRoutingTableToAreaPayload) GetName() (ret AddRoutingTableToAreaPaylo // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetNameOk() (ret AddRoutingTableToAreaPayloadGetNameRetType, ok bool) { return getAddRoutingTableToAreaPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetName(v AddRoutingTableToAreaPayloadGetNameRetType) { setAddRoutingTableToAreaPayloadGetNameAttributeType(&o.Name, v) } // GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetSystemRoutes() (res AddRoutingTableToAreaPayloadgetSystemRoutesRetType) { res, _ = o.GetSystemRoutesOk() return @@ -411,22 +504,26 @@ func (o *AddRoutingTableToAreaPayload) GetSystemRoutes() (res AddRoutingTableToA // GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetSystemRoutesOk() (ret AddRoutingTableToAreaPayloadgetSystemRoutesRetType, ok bool) { return getAddRoutingTableToAreaPayloadgetSystemRoutesAttributeTypeOk(o.SystemRoutes) } // HasSystemRoutes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) HasSystemRoutes() bool { _, ok := o.GetSystemRoutesOk() return ok } // SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetSystemRoutes(v AddRoutingTableToAreaPayloadgetSystemRoutesRetType) { setAddRoutingTableToAreaPayloadgetSystemRoutesAttributeType(&o.SystemRoutes, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetUpdatedAt() (res AddRoutingTableToAreaPayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -434,21 +531,25 @@ func (o *AddRoutingTableToAreaPayload) GetUpdatedAt() (res AddRoutingTableToArea // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) GetUpdatedAtOk() (ret AddRoutingTableToAreaPayloadGetUpdatedAtRetType, ok bool) { return getAddRoutingTableToAreaPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddRoutingTableToAreaPayload) SetUpdatedAt(v AddRoutingTableToAreaPayloadGetUpdatedAtRetType) { setAddRoutingTableToAreaPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o AddRoutingTableToAreaPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getAddRoutingTableToAreaPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -481,37 +582,45 @@ func (o AddRoutingTableToAreaPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableAddRoutingTableToAreaPayload struct { value *AddRoutingTableToAreaPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddRoutingTableToAreaPayload) Get() *AddRoutingTableToAreaPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddRoutingTableToAreaPayload) Set(val *AddRoutingTableToAreaPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddRoutingTableToAreaPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddRoutingTableToAreaPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableAddRoutingTableToAreaPayload(val *AddRoutingTableToAreaPayload) *NullableAddRoutingTableToAreaPayload { return &NullableAddRoutingTableToAreaPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddRoutingTableToAreaPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_add_volume_to_server_payload.go b/services/iaas/model_add_volume_to_server_payload.go index 7e6912c57..57d74fb0d 100644 --- a/services/iaas/model_add_volume_to_server_payload.go +++ b/services/iaas/model_add_volume_to_server_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &AddVolumeToServerPayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadgetDeleteOnTerminationArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadgetDeleteOnTerminationRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(arg AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType) (ret AddVolumeToServerPayloadgetDeleteOnTerminationRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(arg AddVol return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddVolumeToServerPayloadgetDeleteOnTerminationAttributeType(arg *AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType, val AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setAddVolumeToServerPayloadgetDeleteOnTerminationAttributeType(arg *AddVolu */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadGetServerIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(arg AddVolumeToServerPayloadGetServerIdAttributeType) (ret AddVolumeToServerPayloadGetServerIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(arg AddVolumeToServer return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddVolumeToServerPayloadGetServerIdAttributeType(arg *AddVolumeToServerPayloadGetServerIdAttributeType, val AddVolumeToServerPayloadGetServerIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadGetServerIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadGetServerIdRetType = string /* @@ -63,8 +77,10 @@ type AddVolumeToServerPayloadGetServerIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadGetVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(arg AddVolumeToServerPayloadGetVolumeIdAttributeType) (ret AddVolumeToServerPayloadGetVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(arg AddVolumeToServer return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAddVolumeToServerPayloadGetVolumeIdAttributeType(arg *AddVolumeToServerPayloadGetVolumeIdAttributeType, val AddVolumeToServerPayloadGetVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadGetVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayloadGetVolumeIdRetType = string // AddVolumeToServerPayload Object that represents a Volume attachment to a server. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AddVolumeToServerPayload struct { // Delete the volume during the termination of the server. Defaults to false. DeleteOnTermination AddVolumeToServerPayloadgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` @@ -93,6 +114,7 @@ type AddVolumeToServerPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAddVolumeToServerPayload() *AddVolumeToServerPayload { this := AddVolumeToServerPayload{} return &this @@ -101,12 +123,14 @@ func NewAddVolumeToServerPayload() *AddVolumeToServerPayload { // NewAddVolumeToServerPayloadWithDefaults instantiates a new AddVolumeToServerPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAddVolumeToServerPayloadWithDefaults() *AddVolumeToServerPayload { this := AddVolumeToServerPayload{} return &this } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) GetDeleteOnTermination() (res AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { res, _ = o.GetDeleteOnTerminationOk() return @@ -114,22 +138,26 @@ func (o *AddVolumeToServerPayload) GetDeleteOnTermination() (res AddVolumeToServ // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) GetDeleteOnTerminationOk() (ret AddVolumeToServerPayloadgetDeleteOnTerminationRetType, ok bool) { return getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) HasDeleteOnTermination() bool { _, ok := o.GetDeleteOnTerminationOk() return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) SetDeleteOnTermination(v AddVolumeToServerPayloadgetDeleteOnTerminationRetType) { setAddVolumeToServerPayloadgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) GetServerId() (res AddVolumeToServerPayloadGetServerIdRetType) { res, _ = o.GetServerIdOk() return @@ -137,22 +165,26 @@ func (o *AddVolumeToServerPayload) GetServerId() (res AddVolumeToServerPayloadGe // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) GetServerIdOk() (ret AddVolumeToServerPayloadGetServerIdRetType, ok bool) { return getAddVolumeToServerPayloadGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) HasServerId() bool { _, ok := o.GetServerIdOk() return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) SetServerId(v AddVolumeToServerPayloadGetServerIdRetType) { setAddVolumeToServerPayloadGetServerIdAttributeType(&o.ServerId, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) GetVolumeId() (res AddVolumeToServerPayloadGetVolumeIdRetType) { res, _ = o.GetVolumeIdOk() return @@ -160,21 +192,25 @@ func (o *AddVolumeToServerPayload) GetVolumeId() (res AddVolumeToServerPayloadGe // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) GetVolumeIdOk() (ret AddVolumeToServerPayloadGetVolumeIdRetType, ok bool) { return getAddVolumeToServerPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) HasVolumeId() bool { _, ok := o.GetVolumeIdOk() return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AddVolumeToServerPayload) SetVolumeId(v AddVolumeToServerPayloadGetVolumeIdRetType) { setAddVolumeToServerPayloadGetVolumeIdAttributeType(&o.VolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o AddVolumeToServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getAddVolumeToServerPayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { @@ -189,37 +225,45 @@ func (o AddVolumeToServerPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableAddVolumeToServerPayload struct { value *AddVolumeToServerPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddVolumeToServerPayload) Get() *AddVolumeToServerPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddVolumeToServerPayload) Set(val *AddVolumeToServerPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddVolumeToServerPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddVolumeToServerPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableAddVolumeToServerPayload(val *AddVolumeToServerPayload) *NullableAddVolumeToServerPayload { return &NullableAddVolumeToServerPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAddVolumeToServerPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAddVolumeToServerPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_affinity_group.go b/services/iaas/model_affinity_group.go index 4f6603f73..c4ee75da9 100644 --- a/services/iaas/model_affinity_group.go +++ b/services/iaas/model_affinity_group.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &AffinityGroup{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAffinityGroupGetIdAttributeTypeOk(arg AffinityGroupGetIdAttributeType) (ret AffinityGroupGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getAffinityGroupGetIdAttributeTypeOk(arg AffinityGroupGetIdAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAffinityGroupGetIdAttributeType(arg *AffinityGroupGetIdAttributeType, val AffinityGroupGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetIdRetType = string /* @@ -43,10 +50,16 @@ type AffinityGroupGetIdRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetMembersAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetMembersArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetMembersRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAffinityGroupGetMembersAttributeTypeOk(arg AffinityGroupGetMembersAttributeType) (ret AffinityGroupGetMembersRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getAffinityGroupGetMembersAttributeTypeOk(arg AffinityGroupGetMembersAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAffinityGroupGetMembersAttributeType(arg *AffinityGroupGetMembersAttributeType, val AffinityGroupGetMembersRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setAffinityGroupGetMembersAttributeType(arg *AffinityGroupGetMembersAttribu */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAffinityGroupGetNameAttributeTypeOk(arg AffinityGroupGetNameAttributeType) (ret AffinityGroupGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getAffinityGroupGetNameAttributeTypeOk(arg AffinityGroupGetNameAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAffinityGroupGetNameAttributeType(arg *AffinityGroupGetNameAttributeType, val AffinityGroupGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetNameRetType = string /* @@ -84,8 +104,10 @@ type AffinityGroupGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetPolicyAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAffinityGroupGetPolicyAttributeTypeOk(arg AffinityGroupGetPolicyAttributeType) (ret AffinityGroupGetPolicyRetType, ok bool) { if arg == nil { return ret, false @@ -93,14 +115,19 @@ func getAffinityGroupGetPolicyAttributeTypeOk(arg AffinityGroupGetPolicyAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAffinityGroupGetPolicyAttributeType(arg *AffinityGroupGetPolicyAttributeType, val AffinityGroupGetPolicyRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetPolicyArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupGetPolicyRetType = string // AffinityGroup Definition of an affinity group. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroup struct { // Universally Unique Identifier (UUID). Id AffinityGroupGetIdAttributeType `json:"id,omitempty"` @@ -114,12 +141,14 @@ type AffinityGroup struct { Policy AffinityGroupGetPolicyAttributeType `json:"policy" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _AffinityGroup AffinityGroup // NewAffinityGroup instantiates a new AffinityGroup object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAffinityGroup(name AffinityGroupGetNameArgType, policy AffinityGroupGetPolicyArgType) *AffinityGroup { this := AffinityGroup{} setAffinityGroupGetNameAttributeType(&this.Name, name) @@ -130,12 +159,14 @@ func NewAffinityGroup(name AffinityGroupGetNameArgType, policy AffinityGroupGetP // NewAffinityGroupWithDefaults instantiates a new AffinityGroup object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAffinityGroupWithDefaults() *AffinityGroup { this := AffinityGroup{} return &this } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) GetId() (res AffinityGroupGetIdRetType) { res, _ = o.GetIdOk() return @@ -143,22 +174,26 @@ func (o *AffinityGroup) GetId() (res AffinityGroupGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) GetIdOk() (ret AffinityGroupGetIdRetType, ok bool) { return getAffinityGroupGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) SetId(v AffinityGroupGetIdRetType) { setAffinityGroupGetIdAttributeType(&o.Id, v) } // GetMembers returns the Members field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) GetMembers() (res AffinityGroupGetMembersRetType) { res, _ = o.GetMembersOk() return @@ -166,22 +201,26 @@ func (o *AffinityGroup) GetMembers() (res AffinityGroupGetMembersRetType) { // GetMembersOk returns a tuple with the Members field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) GetMembersOk() (ret AffinityGroupGetMembersRetType, ok bool) { return getAffinityGroupGetMembersAttributeTypeOk(o.Members) } // HasMembers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) HasMembers() bool { _, ok := o.GetMembersOk() return ok } // SetMembers gets a reference to the given []string and assigns it to the Members field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) SetMembers(v AffinityGroupGetMembersRetType) { setAffinityGroupGetMembersAttributeType(&o.Members, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) GetName() (ret AffinityGroupGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -189,16 +228,19 @@ func (o *AffinityGroup) GetName() (ret AffinityGroupGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) GetNameOk() (ret AffinityGroupGetNameRetType, ok bool) { return getAffinityGroupGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) SetName(v AffinityGroupGetNameRetType) { setAffinityGroupGetNameAttributeType(&o.Name, v) } // GetPolicy returns the Policy field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) GetPolicy() (ret AffinityGroupGetPolicyRetType) { ret, _ = o.GetPolicyOk() return ret @@ -206,15 +248,18 @@ func (o *AffinityGroup) GetPolicy() (ret AffinityGroupGetPolicyRetType) { // GetPolicyOk returns a tuple with the Policy field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) GetPolicyOk() (ret AffinityGroupGetPolicyRetType, ok bool) { return getAffinityGroupGetPolicyAttributeTypeOk(o.Policy) } // SetPolicy sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroup) SetPolicy(v AffinityGroupGetPolicyRetType) { setAffinityGroupGetPolicyAttributeType(&o.Policy, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o AffinityGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getAffinityGroupGetIdAttributeTypeOk(o.Id); ok { @@ -232,37 +277,45 @@ func (o AffinityGroup) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableAffinityGroup struct { value *AffinityGroup isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAffinityGroup) Get() *AffinityGroup { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAffinityGroup) Set(val *AffinityGroup) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAffinityGroup) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAffinityGroup) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableAffinityGroup(val *AffinityGroup) *NullableAffinityGroup { return &NullableAffinityGroup{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAffinityGroup) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAffinityGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_affinity_group_list_response.go b/services/iaas/model_affinity_group_list_response.go index d41616c35..f4ce91416 100644 --- a/services/iaas/model_affinity_group_list_response.go +++ b/services/iaas/model_affinity_group_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &AffinityGroupListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupListResponseGetItemsAttributeType = *[]AffinityGroup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupListResponseGetItemsArgType = []AffinityGroup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupListResponseGetItemsRetType = []AffinityGroup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAffinityGroupListResponseGetItemsAttributeTypeOk(arg AffinityGroupListResponseGetItemsAttributeType) (ret AffinityGroupListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getAffinityGroupListResponseGetItemsAttributeTypeOk(arg AffinityGroupListRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAffinityGroupListResponseGetItemsAttributeType(arg *AffinityGroupListResponseGetItemsAttributeType, val AffinityGroupListResponseGetItemsRetType) { *arg = &val } // AffinityGroupListResponse Response object for affinity group list request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AffinityGroupListResponse struct { // A list of affinity groups. // REQUIRED Items AffinityGroupListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _AffinityGroupListResponse AffinityGroupListResponse // NewAffinityGroupListResponse instantiates a new AffinityGroupListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAffinityGroupListResponse(items AffinityGroupListResponseGetItemsArgType) *AffinityGroupListResponse { this := AffinityGroupListResponse{} setAffinityGroupListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewAffinityGroupListResponse(items AffinityGroupListResponseGetItemsArgType // NewAffinityGroupListResponseWithDefaults instantiates a new AffinityGroupListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAffinityGroupListResponseWithDefaults() *AffinityGroupListResponse { this := AffinityGroupListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroupListResponse) GetItems() (ret AffinityGroupListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *AffinityGroupListResponse) GetItems() (ret AffinityGroupListResponseGet // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroupListResponse) GetItemsOk() (ret AffinityGroupListResponseGetItemsRetType, ok bool) { return getAffinityGroupListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AffinityGroupListResponse) SetItems(v AffinityGroupListResponseGetItemsRetType) { setAffinityGroupListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o AffinityGroupListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getAffinityGroupListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o AffinityGroupListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableAffinityGroupListResponse struct { value *AffinityGroupListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAffinityGroupListResponse) Get() *AffinityGroupListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAffinityGroupListResponse) Set(val *AffinityGroupListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAffinityGroupListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAffinityGroupListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableAffinityGroupListResponse(val *AffinityGroupListResponse) *NullableAffinityGroupListResponse { return &NullableAffinityGroupListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAffinityGroupListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAffinityGroupListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_allowed_addresses_inner.go b/services/iaas/model_allowed_addresses_inner.go index 88a3f1206..f7c5b25af 100644 --- a/services/iaas/model_allowed_addresses_inner.go +++ b/services/iaas/model_allowed_addresses_inner.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -17,11 +18,13 @@ import ( ) // AllowedAddressesInner - struct for AllowedAddressesInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AllowedAddressesInner struct { String *string } // stringAsAllowedAddressesInner is a convenience function that returns string wrapped in AllowedAddressesInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func StringAsAllowedAddressesInner(v *string) AllowedAddressesInner { return AllowedAddressesInner{ String: v, @@ -29,6 +32,7 @@ func StringAsAllowedAddressesInner(v *string) AllowedAddressesInner { } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *AllowedAddressesInner) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -81,6 +85,7 @@ func (dst *AllowedAddressesInner) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src AllowedAddressesInner) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.String != nil { return json.Marshal(&src.String) } @@ -89,6 +94,7 @@ func (src AllowedAddressesInner) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *AllowedAddressesInner) GetActualInstance() interface{} { if obj == nil { return nil @@ -101,37 +107,45 @@ func (obj *AllowedAddressesInner) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableAllowedAddressesInner struct { value *AllowedAddressesInner isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAllowedAddressesInner) Get() *AllowedAddressesInner { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAllowedAddressesInner) Set(val *AllowedAddressesInner) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAllowedAddressesInner) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAllowedAddressesInner) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableAllowedAddressesInner(val *AllowedAddressesInner) *NullableAllowedAddressesInner { return &NullableAllowedAddressesInner{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAllowedAddressesInner) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAllowedAddressesInner) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_area_id.go b/services/iaas/model_area_id.go index 62a8537c9..acc0763d1 100644 --- a/services/iaas/model_area_id.go +++ b/services/iaas/model_area_id.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -17,12 +18,14 @@ import ( ) // AreaId - The identifier (ID) of an area. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AreaId struct { StaticAreaID *StaticAreaID String *string } // StaticAreaIDAsAreaId is a convenience function that returns StaticAreaID wrapped in AreaId +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func StaticAreaIDAsAreaId(v *StaticAreaID) AreaId { return AreaId{ StaticAreaID: v, @@ -30,6 +33,7 @@ func StaticAreaIDAsAreaId(v *StaticAreaID) AreaId { } // stringAsAreaId is a convenience function that returns string wrapped in AreaId +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func StringAsAreaId(v *string) AreaId { return AreaId{ String: v, @@ -37,6 +41,7 @@ func StringAsAreaId(v *string) AreaId { } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *AreaId) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -85,6 +90,7 @@ func (dst *AreaId) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src AreaId) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.StaticAreaID != nil { return json.Marshal(&src.StaticAreaID) } @@ -97,6 +103,7 @@ func (src AreaId) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *AreaId) GetActualInstance() interface{} { if obj == nil { return nil @@ -113,37 +120,45 @@ func (obj *AreaId) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableAreaId struct { value *AreaId isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAreaId) Get() *AreaId { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAreaId) Set(val *AreaId) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAreaId) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAreaId) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableAreaId(val *AreaId) *NullableAreaId { return &NullableAreaId{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAreaId) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAreaId) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_availability_zone_list_response.go b/services/iaas/model_availability_zone_list_response.go index 7adf0be64..21901bddb 100644 --- a/services/iaas/model_availability_zone_list_response.go +++ b/services/iaas/model_availability_zone_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &AvailabilityZoneListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AvailabilityZoneListResponseGetItemsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AvailabilityZoneListResponseGetItemsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AvailabilityZoneListResponseGetItemsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getAvailabilityZoneListResponseGetItemsAttributeTypeOk(arg AvailabilityZoneListResponseGetItemsAttributeType) (ret AvailabilityZoneListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getAvailabilityZoneListResponseGetItemsAttributeTypeOk(arg AvailabilityZone return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setAvailabilityZoneListResponseGetItemsAttributeType(arg *AvailabilityZoneListResponseGetItemsAttributeType, val AvailabilityZoneListResponseGetItemsRetType) { *arg = &val } // AvailabilityZoneListResponse Availability Zone list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type AvailabilityZoneListResponse struct { // A list of availability zones. // REQUIRED Items AvailabilityZoneListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _AvailabilityZoneListResponse AvailabilityZoneListResponse // NewAvailabilityZoneListResponse instantiates a new AvailabilityZoneListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAvailabilityZoneListResponse(items AvailabilityZoneListResponseGetItemsArgType) *AvailabilityZoneListResponse { this := AvailabilityZoneListResponse{} setAvailabilityZoneListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewAvailabilityZoneListResponse(items AvailabilityZoneListResponseGetItemsA // NewAvailabilityZoneListResponseWithDefaults instantiates a new AvailabilityZoneListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAvailabilityZoneListResponseWithDefaults() *AvailabilityZoneListResponse { this := AvailabilityZoneListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AvailabilityZoneListResponse) GetItems() (ret AvailabilityZoneListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *AvailabilityZoneListResponse) GetItems() (ret AvailabilityZoneListRespo // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AvailabilityZoneListResponse) GetItemsOk() (ret AvailabilityZoneListResponseGetItemsRetType, ok bool) { return getAvailabilityZoneListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *AvailabilityZoneListResponse) SetItems(v AvailabilityZoneListResponseGetItemsRetType) { setAvailabilityZoneListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o AvailabilityZoneListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getAvailabilityZoneListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o AvailabilityZoneListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableAvailabilityZoneListResponse struct { value *AvailabilityZoneListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAvailabilityZoneListResponse) Get() *AvailabilityZoneListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAvailabilityZoneListResponse) Set(val *AvailabilityZoneListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAvailabilityZoneListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAvailabilityZoneListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableAvailabilityZoneListResponse(val *AvailabilityZoneListResponse) *NullableAvailabilityZoneListResponse { return &NullableAvailabilityZoneListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableAvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableAvailabilityZoneListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_backup.go b/services/iaas/model_backup.go index 23286ee14..43c12e7a5 100644 --- a/services/iaas/model_backup.go +++ b/services/iaas/model_backup.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &Backup{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetAvailabilityZoneAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetAvailabilityZoneAttributeTypeOk(arg BackupGetAvailabilityZoneAttributeType) (ret BackupGetAvailabilityZoneRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getBackupGetAvailabilityZoneAttributeTypeOk(arg BackupGetAvailabilityZoneAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetAvailabilityZoneAttributeType(arg *BackupGetAvailabilityZoneAttributeType, val BackupGetAvailabilityZoneRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetAvailabilityZoneArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetAvailabilityZoneRetType = string /* @@ -44,10 +51,16 @@ type BackupGetAvailabilityZoneRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetCreatedAtAttributeTypeOk(arg BackupGetCreatedAtAttributeType) (ret BackupGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getBackupGetCreatedAtAttributeTypeOk(arg BackupGetCreatedAtAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetCreatedAtAttributeType(arg *BackupGetCreatedAtAttributeType, val BackupGetCreatedAtRetType) { *arg = &val } @@ -64,10 +78,16 @@ func setBackupGetCreatedAtAttributeType(arg *BackupGetCreatedAtAttributeType, va */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupgetEncryptedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupgetEncryptedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupgetEncryptedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupgetEncryptedAttributeTypeOk(arg BackupgetEncryptedAttributeType) (ret BackupgetEncryptedRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getBackupgetEncryptedAttributeTypeOk(arg BackupgetEncryptedAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupgetEncryptedAttributeType(arg *BackupgetEncryptedAttributeType, val BackupgetEncryptedRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setBackupgetEncryptedAttributeType(arg *BackupgetEncryptedAttributeType, va */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetIdAttributeType(arg *BackupGetIdAttributeType, val BackupGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetIdRetType = string /* @@ -105,10 +132,16 @@ type BackupGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetLabelsAttributeTypeOk(arg BackupGetLabelsAttributeType) (ret BackupGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getBackupGetLabelsAttributeTypeOk(arg BackupGetLabelsAttributeType) (ret Ba return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetLabelsAttributeType(arg *BackupGetLabelsAttributeType, val BackupGetLabelsRetType) { *arg = &val } @@ -125,8 +159,10 @@ func setBackupGetLabelsAttributeType(arg *BackupGetLabelsAttributeType, val Back */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret BackupGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -134,11 +170,15 @@ func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret Backup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetNameAttributeType(arg *BackupGetNameAttributeType, val BackupGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetNameRetType = string /* @@ -146,10 +186,16 @@ type BackupGetNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret BackupGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -157,6 +203,7 @@ func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret Backup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetSizeAttributeType(arg *BackupGetSizeAttributeType, val BackupGetSizeRetType) { *arg = &val } @@ -166,8 +213,10 @@ func setBackupGetSizeAttributeType(arg *BackupGetSizeAttributeType, val BackupGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSnapshotIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetSnapshotIdAttributeTypeOk(arg BackupGetSnapshotIdAttributeType) (ret BackupGetSnapshotIdRetType, ok bool) { if arg == nil { return ret, false @@ -175,11 +224,15 @@ func getBackupGetSnapshotIdAttributeTypeOk(arg BackupGetSnapshotIdAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetSnapshotIdAttributeType(arg *BackupGetSnapshotIdAttributeType, val BackupGetSnapshotIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSnapshotIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSnapshotIdRetType = string /* @@ -187,8 +240,10 @@ type BackupGetSnapshotIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetStatusAttributeTypeOk(arg BackupGetStatusAttributeType) (ret BackupGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -196,11 +251,15 @@ func getBackupGetStatusAttributeTypeOk(arg BackupGetStatusAttributeType) (ret Ba return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetStatusAttributeType(arg *BackupGetStatusAttributeType, val BackupGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetStatusRetType = string /* @@ -208,10 +267,16 @@ type BackupGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetUpdatedAtAttributeTypeOk(arg BackupGetUpdatedAtAttributeType) (ret BackupGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -219,6 +284,7 @@ func getBackupGetUpdatedAtAttributeTypeOk(arg BackupGetUpdatedAtAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetUpdatedAtAttributeType(arg *BackupGetUpdatedAtAttributeType, val BackupGetUpdatedAtRetType) { *arg = &val } @@ -228,8 +294,10 @@ func setBackupGetUpdatedAtAttributeType(arg *BackupGetUpdatedAtAttributeType, va */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetVolumeIdAttributeTypeOk(arg BackupGetVolumeIdAttributeType) (ret BackupGetVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -237,14 +305,19 @@ func getBackupGetVolumeIdAttributeTypeOk(arg BackupGetVolumeIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetVolumeIdAttributeType(arg *BackupGetVolumeIdAttributeType, val BackupGetVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetVolumeIdRetType = string // Backup Object that represents a backup. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Backup struct { // Object that represents an availability zone. AvailabilityZone BackupGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` @@ -254,7 +327,7 @@ type Backup struct { Encrypted BackupgetEncryptedAttributeType `json:"encrypted,omitempty"` // Universally Unique Identifier (UUID). Id BackupGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels BackupGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name BackupGetNameAttributeType `json:"name,omitempty"` @@ -274,6 +347,7 @@ type Backup struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackup() *Backup { this := Backup{} return &this @@ -282,12 +356,14 @@ func NewBackup() *Backup { // NewBackupWithDefaults instantiates a new Backup object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupWithDefaults() *Backup { this := Backup{} return &this } // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetAvailabilityZone() (res BackupGetAvailabilityZoneRetType) { res, _ = o.GetAvailabilityZoneOk() return @@ -295,22 +371,26 @@ func (o *Backup) GetAvailabilityZone() (res BackupGetAvailabilityZoneRetType) { // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetAvailabilityZoneOk() (ret BackupGetAvailabilityZoneRetType, ok bool) { return getBackupGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // HasAvailabilityZone returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasAvailabilityZone() bool { _, ok := o.GetAvailabilityZoneOk() return ok } // SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetAvailabilityZone(v BackupGetAvailabilityZoneRetType) { setBackupGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetCreatedAt() (res BackupGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -318,22 +398,26 @@ func (o *Backup) GetCreatedAt() (res BackupGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetCreatedAtOk() (ret BackupGetCreatedAtRetType, ok bool) { return getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetCreatedAt(v BackupGetCreatedAtRetType) { setBackupGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetEncrypted returns the Encrypted field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetEncrypted() (res BackupgetEncryptedRetType) { res, _ = o.GetEncryptedOk() return @@ -341,22 +425,26 @@ func (o *Backup) GetEncrypted() (res BackupgetEncryptedRetType) { // GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetEncryptedOk() (ret BackupgetEncryptedRetType, ok bool) { return getBackupgetEncryptedAttributeTypeOk(o.Encrypted) } // HasEncrypted returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasEncrypted() bool { _, ok := o.GetEncryptedOk() return ok } // SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetEncrypted(v BackupgetEncryptedRetType) { setBackupgetEncryptedAttributeType(&o.Encrypted, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetId() (res BackupGetIdRetType) { res, _ = o.GetIdOk() return @@ -364,22 +452,26 @@ func (o *Backup) GetId() (res BackupGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetIdOk() (ret BackupGetIdRetType, ok bool) { return getBackupGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetId(v BackupGetIdRetType) { setBackupGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetLabels() (res BackupGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -387,22 +479,26 @@ func (o *Backup) GetLabels() (res BackupGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetLabelsOk() (ret BackupGetLabelsRetType, ok bool) { return getBackupGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetLabels(v BackupGetLabelsRetType) { setBackupGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetName() (res BackupGetNameRetType) { res, _ = o.GetNameOk() return @@ -410,22 +506,26 @@ func (o *Backup) GetName() (res BackupGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetNameOk() (ret BackupGetNameRetType, ok bool) { return getBackupGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetName(v BackupGetNameRetType) { setBackupGetNameAttributeType(&o.Name, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetSize() (res BackupGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -433,22 +533,26 @@ func (o *Backup) GetSize() (res BackupGetSizeRetType) { // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetSizeOk() (ret BackupGetSizeRetType, ok bool) { return getBackupGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetSize(v BackupGetSizeRetType) { setBackupGetSizeAttributeType(&o.Size, v) } // GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetSnapshotId() (res BackupGetSnapshotIdRetType) { res, _ = o.GetSnapshotIdOk() return @@ -456,22 +560,26 @@ func (o *Backup) GetSnapshotId() (res BackupGetSnapshotIdRetType) { // GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetSnapshotIdOk() (ret BackupGetSnapshotIdRetType, ok bool) { return getBackupGetSnapshotIdAttributeTypeOk(o.SnapshotId) } // HasSnapshotId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasSnapshotId() bool { _, ok := o.GetSnapshotIdOk() return ok } // SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetSnapshotId(v BackupGetSnapshotIdRetType) { setBackupGetSnapshotIdAttributeType(&o.SnapshotId, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetStatus() (res BackupGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -479,22 +587,26 @@ func (o *Backup) GetStatus() (res BackupGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetStatusOk() (ret BackupGetStatusRetType, ok bool) { return getBackupGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetStatus(v BackupGetStatusRetType) { setBackupGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetUpdatedAt() (res BackupGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -502,22 +614,26 @@ func (o *Backup) GetUpdatedAt() (res BackupGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetUpdatedAtOk() (ret BackupGetUpdatedAtRetType, ok bool) { return getBackupGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetUpdatedAt(v BackupGetUpdatedAtRetType) { setBackupGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetVolumeId() (res BackupGetVolumeIdRetType) { res, _ = o.GetVolumeIdOk() return @@ -525,21 +641,25 @@ func (o *Backup) GetVolumeId() (res BackupGetVolumeIdRetType) { // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetVolumeIdOk() (ret BackupGetVolumeIdRetType, ok bool) { return getBackupGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasVolumeId() bool { _, ok := o.GetVolumeIdOk() return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetVolumeId(v BackupGetVolumeIdRetType) { setBackupGetVolumeIdAttributeType(&o.VolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Backup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { @@ -578,37 +698,45 @@ func (o Backup) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackup struct { value *Backup isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackup) Get() *Backup { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackup) Set(val *Backup) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackup) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackup) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackup(val *Backup) *NullableBackup { return &NullableBackup{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackup) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_backup_list_response.go b/services/iaas/model_backup_list_response.go index 9ff60691d..47422a847 100644 --- a/services/iaas/model_backup_list_response.go +++ b/services/iaas/model_backup_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &BackupListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListResponseGetItemsAttributeType = *[]Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListResponseGetItemsArgType = []Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListResponseGetItemsRetType = []Backup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupListResponseGetItemsAttributeTypeOk(arg BackupListResponseGetItemsAttributeType) (ret BackupListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getBackupListResponseGetItemsAttributeTypeOk(arg BackupListResponseGetItems return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupListResponseGetItemsAttributeType(arg *BackupListResponseGetItemsAttributeType, val BackupListResponseGetItemsRetType) { *arg = &val } // BackupListResponse Backup list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupListResponse struct { // A list containing backup objects. // REQUIRED Items BackupListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _BackupListResponse BackupListResponse // NewBackupListResponse instantiates a new BackupListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupListResponse(items BackupListResponseGetItemsArgType) *BackupListResponse { this := BackupListResponse{} setBackupListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewBackupListResponse(items BackupListResponseGetItemsArgType) *BackupListR // NewBackupListResponseWithDefaults instantiates a new BackupListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupListResponseWithDefaults() *BackupListResponse { this := BackupListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupListResponse) GetItems() (ret BackupListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *BackupListResponse) GetItems() (ret BackupListResponseGetItemsRetType) // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupListResponse) GetItemsOk() (ret BackupListResponseGetItemsRetType, ok bool) { return getBackupListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupListResponse) SetItems(v BackupListResponseGetItemsRetType) { setBackupListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o BackupListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupListResponse struct { value *BackupListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupListResponse) Get() *BackupListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupListResponse) Set(val *BackupListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupListResponse(val *BackupListResponse) *NullableBackupListResponse { return &NullableBackupListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_backup_source.go b/services/iaas/model_backup_source.go index 8b1b4188d..d3094606f 100644 --- a/services/iaas/model_backup_source.go +++ b/services/iaas/model_backup_source.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BackupSource{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSourceGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupSourceGetIdAttributeTypeOk(arg BackupSourceGetIdAttributeType) (ret BackupSourceGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBackupSourceGetIdAttributeTypeOk(arg BackupSourceGetIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupSourceGetIdAttributeType(arg *BackupSourceGetIdAttributeType, val BackupSourceGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSourceGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSourceGetIdRetType = string /* @@ -43,8 +50,10 @@ type BackupSourceGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSourceGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupSourceGetTypeAttributeTypeOk(arg BackupSourceGetTypeAttributeType) (ret BackupSourceGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getBackupSourceGetTypeAttributeTypeOk(arg BackupSourceGetTypeAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupSourceGetTypeAttributeType(arg *BackupSourceGetTypeAttributeType, val BackupSourceGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSourceGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSourceGetTypeRetType = string // BackupSource The source object of a backup. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSource struct { // Universally Unique Identifier (UUID). // REQUIRED @@ -69,12 +83,14 @@ type BackupSource struct { Type BackupSourceGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _BackupSource BackupSource // NewBackupSource instantiates a new BackupSource object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupSource(id BackupSourceGetIdArgType, types BackupSourceGetTypeArgType) *BackupSource { this := BackupSource{} setBackupSourceGetIdAttributeType(&this.Id, id) @@ -85,12 +101,14 @@ func NewBackupSource(id BackupSourceGetIdArgType, types BackupSourceGetTypeArgTy // NewBackupSourceWithDefaults instantiates a new BackupSource object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupSourceWithDefaults() *BackupSource { this := BackupSource{} return &this } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSource) GetId() (ret BackupSourceGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -98,16 +116,19 @@ func (o *BackupSource) GetId() (ret BackupSourceGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSource) GetIdOk() (ret BackupSourceGetIdRetType, ok bool) { return getBackupSourceGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSource) SetId(v BackupSourceGetIdRetType) { setBackupSourceGetIdAttributeType(&o.Id, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSource) GetType() (ret BackupSourceGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -115,15 +136,18 @@ func (o *BackupSource) GetType() (ret BackupSourceGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSource) GetTypeOk() (ret BackupSourceGetTypeRetType, ok bool) { return getBackupSourceGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSource) SetType(v BackupSourceGetTypeRetType) { setBackupSourceGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupSource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupSourceGetIdAttributeTypeOk(o.Id); ok { @@ -135,37 +159,45 @@ func (o BackupSource) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupSource struct { value *BackupSource isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupSource) Get() *BackupSource { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupSource) Set(val *BackupSource) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupSource) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupSource) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupSource(val *BackupSource) *NullableBackupSource { return &NullableBackupSource{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupSource) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupSource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_base_security_group_rule.go b/services/iaas/model_base_security_group_rule.go index 990b8db62..590f95bec 100644 --- a/services/iaas/model_base_security_group_rule.go +++ b/services/iaas/model_base_security_group_rule.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &BaseSecurityGroupRule{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetCreatedAtAttributeTypeOk(arg BaseSecurityGroupRuleGetCreatedAtAttributeType) (ret BaseSecurityGroupRuleGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getBaseSecurityGroupRuleGetCreatedAtAttributeTypeOk(arg BaseSecurityGroupRu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetCreatedAtAttributeType(arg *BaseSecurityGroupRuleGetCreatedAtAttributeType, val BaseSecurityGroupRuleGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setBaseSecurityGroupRuleGetCreatedAtAttributeType(arg *BaseSecurityGroupRul */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(arg BaseSecurityGroupRuleGetDescriptionAttributeType) (ret BaseSecurityGroupRuleGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(arg BaseSecurityGroup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetDescriptionAttributeType(arg *BaseSecurityGroupRuleGetDescriptionAttributeType, val BaseSecurityGroupRuleGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetDescriptionRetType = string /* @@ -64,8 +78,10 @@ type BaseSecurityGroupRuleGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetDirectionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(arg BaseSecurityGroupRuleGetDirectionAttributeType) (ret BaseSecurityGroupRuleGetDirectionRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(arg BaseSecurityGroupRu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetDirectionAttributeType(arg *BaseSecurityGroupRuleGetDirectionAttributeType, val BaseSecurityGroupRuleGetDirectionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetDirectionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetDirectionRetType = string /* @@ -85,8 +105,10 @@ type BaseSecurityGroupRuleGetDirectionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetEthertypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(arg BaseSecurityGroupRuleGetEthertypeAttributeType) (ret BaseSecurityGroupRuleGetEthertypeRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +116,15 @@ func getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(arg BaseSecurityGroupRu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetEthertypeAttributeType(arg *BaseSecurityGroupRuleGetEthertypeAttributeType, val BaseSecurityGroupRuleGetEthertypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetEthertypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetEthertypeRetType = string /* @@ -106,10 +132,16 @@ type BaseSecurityGroupRuleGetEthertypeRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIcmpParametersAttributeType = *ICMPParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIcmpParametersArgType = ICMPParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIcmpParametersRetType = ICMPParameters +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(arg BaseSecurityGroupRuleGetIcmpParametersAttributeType) (ret BaseSecurityGroupRuleGetIcmpParametersRetType, ok bool) { if arg == nil { return ret, false @@ -117,6 +149,7 @@ func getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(arg BaseSecurityGr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetIcmpParametersAttributeType(arg *BaseSecurityGroupRuleGetIcmpParametersAttributeType, val BaseSecurityGroupRuleGetIcmpParametersRetType) { *arg = &val } @@ -126,8 +159,10 @@ func setBaseSecurityGroupRuleGetIcmpParametersAttributeType(arg *BaseSecurityGro */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetIdAttributeTypeOk(arg BaseSecurityGroupRuleGetIdAttributeType) (ret BaseSecurityGroupRuleGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +170,15 @@ func getBaseSecurityGroupRuleGetIdAttributeTypeOk(arg BaseSecurityGroupRuleGetId return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetIdAttributeType(arg *BaseSecurityGroupRuleGetIdAttributeType, val BaseSecurityGroupRuleGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIdRetType = string /* @@ -147,8 +186,10 @@ type BaseSecurityGroupRuleGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIpRangeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(arg BaseSecurityGroupRuleGetIpRangeAttributeType) (ret BaseSecurityGroupRuleGetIpRangeRetType, ok bool) { if arg == nil { return ret, false @@ -156,11 +197,15 @@ func getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(arg BaseSecurityGroupRule return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetIpRangeAttributeType(arg *BaseSecurityGroupRuleGetIpRangeAttributeType, val BaseSecurityGroupRuleGetIpRangeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIpRangeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetIpRangeRetType = string /* @@ -168,10 +213,16 @@ type BaseSecurityGroupRuleGetIpRangeRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetPortRangeAttributeType = *PortRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetPortRangeArgType = PortRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetPortRangeRetType = PortRange +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(arg BaseSecurityGroupRuleGetPortRangeAttributeType) (ret BaseSecurityGroupRuleGetPortRangeRetType, ok bool) { if arg == nil { return ret, false @@ -179,6 +230,7 @@ func getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(arg BaseSecurityGroupRu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetPortRangeAttributeType(arg *BaseSecurityGroupRuleGetPortRangeAttributeType, val BaseSecurityGroupRuleGetPortRangeRetType) { *arg = &val } @@ -188,8 +240,10 @@ func setBaseSecurityGroupRuleGetPortRangeAttributeType(arg *BaseSecurityGroupRul */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(arg BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType) (ret BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +251,15 @@ func getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(arg BaseSec return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(arg *BaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType, val BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetRemoteSecurityGroupIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType = string /* @@ -209,8 +267,10 @@ type BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetSecurityGroupIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(arg BaseSecurityGroupRuleGetSecurityGroupIdAttributeType) (ret BaseSecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { if arg == nil { return ret, false @@ -218,11 +278,15 @@ func getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(arg BaseSecurityG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetSecurityGroupIdAttributeType(arg *BaseSecurityGroupRuleGetSecurityGroupIdAttributeType, val BaseSecurityGroupRuleGetSecurityGroupIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetSecurityGroupIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetSecurityGroupIdRetType = string /* @@ -230,10 +294,16 @@ type BaseSecurityGroupRuleGetSecurityGroupIdRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRuleGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBaseSecurityGroupRuleGetUpdatedAtAttributeTypeOk(arg BaseSecurityGroupRuleGetUpdatedAtAttributeType) (ret BaseSecurityGroupRuleGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -241,11 +311,13 @@ func getBaseSecurityGroupRuleGetUpdatedAtAttributeTypeOk(arg BaseSecurityGroupRu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBaseSecurityGroupRuleGetUpdatedAtAttributeType(arg *BaseSecurityGroupRuleGetUpdatedAtAttributeType, val BaseSecurityGroupRuleGetUpdatedAtRetType) { *arg = &val } // BaseSecurityGroupRule The base schema for a security group rule. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BaseSecurityGroupRule struct { // Date-time when resource was created. CreatedAt BaseSecurityGroupRuleGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -270,12 +342,14 @@ type BaseSecurityGroupRule struct { UpdatedAt BaseSecurityGroupRuleGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _BaseSecurityGroupRule BaseSecurityGroupRule // NewBaseSecurityGroupRule instantiates a new BaseSecurityGroupRule object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBaseSecurityGroupRule(direction BaseSecurityGroupRuleGetDirectionArgType) *BaseSecurityGroupRule { this := BaseSecurityGroupRule{} setBaseSecurityGroupRuleGetDirectionAttributeType(&this.Direction, direction) @@ -285,6 +359,7 @@ func NewBaseSecurityGroupRule(direction BaseSecurityGroupRuleGetDirectionArgType // NewBaseSecurityGroupRuleWithDefaults instantiates a new BaseSecurityGroupRule object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBaseSecurityGroupRuleWithDefaults() *BaseSecurityGroupRule { this := BaseSecurityGroupRule{} var ethertype string = "IPv4" @@ -293,6 +368,7 @@ func NewBaseSecurityGroupRuleWithDefaults() *BaseSecurityGroupRule { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetCreatedAt() (res BaseSecurityGroupRuleGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -300,22 +376,26 @@ func (o *BaseSecurityGroupRule) GetCreatedAt() (res BaseSecurityGroupRuleGetCrea // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetCreatedAtOk() (ret BaseSecurityGroupRuleGetCreatedAtRetType, ok bool) { return getBaseSecurityGroupRuleGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetCreatedAt(v BaseSecurityGroupRuleGetCreatedAtRetType) { setBaseSecurityGroupRuleGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetDescription() (res BaseSecurityGroupRuleGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -323,22 +403,26 @@ func (o *BaseSecurityGroupRule) GetDescription() (res BaseSecurityGroupRuleGetDe // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetDescriptionOk() (ret BaseSecurityGroupRuleGetDescriptionRetType, ok bool) { return getBaseSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetDescription(v BaseSecurityGroupRuleGetDescriptionRetType) { setBaseSecurityGroupRuleGetDescriptionAttributeType(&o.Description, v) } // GetDirection returns the Direction field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetDirection() (ret BaseSecurityGroupRuleGetDirectionRetType) { ret, _ = o.GetDirectionOk() return ret @@ -346,16 +430,19 @@ func (o *BaseSecurityGroupRule) GetDirection() (ret BaseSecurityGroupRuleGetDire // GetDirectionOk returns a tuple with the Direction field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetDirectionOk() (ret BaseSecurityGroupRuleGetDirectionRetType, ok bool) { return getBaseSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction) } // SetDirection sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetDirection(v BaseSecurityGroupRuleGetDirectionRetType) { setBaseSecurityGroupRuleGetDirectionAttributeType(&o.Direction, v) } // GetEthertype returns the Ethertype field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetEthertype() (res BaseSecurityGroupRuleGetEthertypeRetType) { res, _ = o.GetEthertypeOk() return @@ -363,22 +450,26 @@ func (o *BaseSecurityGroupRule) GetEthertype() (res BaseSecurityGroupRuleGetEthe // GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetEthertypeOk() (ret BaseSecurityGroupRuleGetEthertypeRetType, ok bool) { return getBaseSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype) } // HasEthertype returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasEthertype() bool { _, ok := o.GetEthertypeOk() return ok } // SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetEthertype(v BaseSecurityGroupRuleGetEthertypeRetType) { setBaseSecurityGroupRuleGetEthertypeAttributeType(&o.Ethertype, v) } // GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetIcmpParameters() (res BaseSecurityGroupRuleGetIcmpParametersRetType) { res, _ = o.GetIcmpParametersOk() return @@ -386,22 +477,26 @@ func (o *BaseSecurityGroupRule) GetIcmpParameters() (res BaseSecurityGroupRuleGe // GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (ret BaseSecurityGroupRuleGetIcmpParametersRetType, ok bool) { return getBaseSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters) } // HasIcmpParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasIcmpParameters() bool { _, ok := o.GetIcmpParametersOk() return ok } // SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetIcmpParameters(v BaseSecurityGroupRuleGetIcmpParametersRetType) { setBaseSecurityGroupRuleGetIcmpParametersAttributeType(&o.IcmpParameters, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetId() (res BaseSecurityGroupRuleGetIdRetType) { res, _ = o.GetIdOk() return @@ -409,22 +504,26 @@ func (o *BaseSecurityGroupRule) GetId() (res BaseSecurityGroupRuleGetIdRetType) // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetIdOk() (ret BaseSecurityGroupRuleGetIdRetType, ok bool) { return getBaseSecurityGroupRuleGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetId(v BaseSecurityGroupRuleGetIdRetType) { setBaseSecurityGroupRuleGetIdAttributeType(&o.Id, v) } // GetIpRange returns the IpRange field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetIpRange() (res BaseSecurityGroupRuleGetIpRangeRetType) { res, _ = o.GetIpRangeOk() return @@ -432,22 +531,26 @@ func (o *BaseSecurityGroupRule) GetIpRange() (res BaseSecurityGroupRuleGetIpRang // GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetIpRangeOk() (ret BaseSecurityGroupRuleGetIpRangeRetType, ok bool) { return getBaseSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange) } // HasIpRange returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasIpRange() bool { _, ok := o.GetIpRangeOk() return ok } // SetIpRange gets a reference to the given string and assigns it to the IpRange field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetIpRange(v BaseSecurityGroupRuleGetIpRangeRetType) { setBaseSecurityGroupRuleGetIpRangeAttributeType(&o.IpRange, v) } // GetPortRange returns the PortRange field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetPortRange() (res BaseSecurityGroupRuleGetPortRangeRetType) { res, _ = o.GetPortRangeOk() return @@ -455,22 +558,26 @@ func (o *BaseSecurityGroupRule) GetPortRange() (res BaseSecurityGroupRuleGetPort // GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetPortRangeOk() (ret BaseSecurityGroupRuleGetPortRangeRetType, ok bool) { return getBaseSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange) } // HasPortRange returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasPortRange() bool { _, ok := o.GetPortRangeOk() return ok } // SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetPortRange(v BaseSecurityGroupRuleGetPortRangeRetType) { setBaseSecurityGroupRuleGetPortRangeAttributeType(&o.PortRange, v) } // GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() (res BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { res, _ = o.GetRemoteSecurityGroupIdOk() return @@ -478,22 +585,26 @@ func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() (res BaseSecurityGrou // GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (ret BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { return getBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) } // HasRemoteSecurityGroupId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasRemoteSecurityGroupId() bool { _, ok := o.GetRemoteSecurityGroupIdOk() return ok } // SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetRemoteSecurityGroupId(v BaseSecurityGroupRuleGetRemoteSecurityGroupIdRetType) { setBaseSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) } // GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetSecurityGroupId() (res BaseSecurityGroupRuleGetSecurityGroupIdRetType) { res, _ = o.GetSecurityGroupIdOk() return @@ -501,22 +612,26 @@ func (o *BaseSecurityGroupRule) GetSecurityGroupId() (res BaseSecurityGroupRuleG // GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (ret BaseSecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { return getBaseSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) } // HasSecurityGroupId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasSecurityGroupId() bool { _, ok := o.GetSecurityGroupIdOk() return ok } // SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetSecurityGroupId(v BaseSecurityGroupRuleGetSecurityGroupIdRetType) { setBaseSecurityGroupRuleGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetUpdatedAt() (res BaseSecurityGroupRuleGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -524,21 +639,25 @@ func (o *BaseSecurityGroupRule) GetUpdatedAt() (res BaseSecurityGroupRuleGetUpda // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) GetUpdatedAtOk() (ret BaseSecurityGroupRuleGetUpdatedAtRetType, ok bool) { return getBaseSecurityGroupRuleGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BaseSecurityGroupRule) SetUpdatedAt(v BaseSecurityGroupRuleGetUpdatedAtRetType) { setBaseSecurityGroupRuleGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BaseSecurityGroupRule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBaseSecurityGroupRuleGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -577,37 +696,45 @@ func (o BaseSecurityGroupRule) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBaseSecurityGroupRule struct { value *BaseSecurityGroupRule isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBaseSecurityGroupRule) Get() *BaseSecurityGroupRule { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBaseSecurityGroupRule) Set(val *BaseSecurityGroupRule) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBaseSecurityGroupRule) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBaseSecurityGroupRule) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBaseSecurityGroupRule(val *BaseSecurityGroupRule) *NullableBaseSecurityGroupRule { return &NullableBaseSecurityGroupRule{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBaseSecurityGroupRule) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBaseSecurityGroupRule) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_boot_volume.go b/services/iaas/model_boot_volume.go index 699936a2c..ad0feac6e 100644 --- a/services/iaas/model_boot_volume.go +++ b/services/iaas/model_boot_volume.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &BootVolume{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumegetDeleteOnTerminationAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumegetDeleteOnTerminationArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumegetDeleteOnTerminationRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBootVolumegetDeleteOnTerminationAttributeTypeOk(arg BootVolumegetDeleteOnTerminationAttributeType) (ret BootVolumegetDeleteOnTerminationRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getBootVolumegetDeleteOnTerminationAttributeTypeOk(arg BootVolumegetDeleteO return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBootVolumegetDeleteOnTerminationAttributeType(arg *BootVolumegetDeleteOnTerminationAttributeType, val BootVolumegetDeleteOnTerminationRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setBootVolumegetDeleteOnTerminationAttributeType(arg *BootVolumegetDeleteOn */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBootVolumeGetIdAttributeTypeOk(arg BootVolumeGetIdAttributeType) (ret BootVolumeGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getBootVolumeGetIdAttributeTypeOk(arg BootVolumeGetIdAttributeType) (ret Bo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBootVolumeGetIdAttributeType(arg *BootVolumeGetIdAttributeType, val BootVolumeGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetIdRetType = string /* @@ -63,8 +77,10 @@ type BootVolumeGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetPerformanceClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBootVolumeGetPerformanceClassAttributeTypeOk(arg BootVolumeGetPerformanceClassAttributeType) (ret BootVolumeGetPerformanceClassRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getBootVolumeGetPerformanceClassAttributeTypeOk(arg BootVolumeGetPerformanc return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBootVolumeGetPerformanceClassAttributeType(arg *BootVolumeGetPerformanceClassAttributeType, val BootVolumeGetPerformanceClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetPerformanceClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetPerformanceClassRetType = string /* @@ -84,10 +104,16 @@ type BootVolumeGetPerformanceClassRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBootVolumeGetSizeAttributeTypeOk(arg BootVolumeGetSizeAttributeType) (ret BootVolumeGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +121,7 @@ func getBootVolumeGetSizeAttributeTypeOk(arg BootVolumeGetSizeAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBootVolumeGetSizeAttributeType(arg *BootVolumeGetSizeAttributeType, val BootVolumeGetSizeRetType) { *arg = &val } @@ -104,10 +131,16 @@ func setBootVolumeGetSizeAttributeType(arg *BootVolumeGetSizeAttributeType, val */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetSourceAttributeType = *BootVolumeSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetSourceArgType = BootVolumeSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeGetSourceRetType = BootVolumeSource +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBootVolumeGetSourceAttributeTypeOk(arg BootVolumeGetSourceAttributeType) (ret BootVolumeGetSourceRetType, ok bool) { if arg == nil { return ret, false @@ -115,11 +148,13 @@ func getBootVolumeGetSourceAttributeTypeOk(arg BootVolumeGetSourceAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBootVolumeGetSourceAttributeType(arg *BootVolumeGetSourceAttributeType, val BootVolumeGetSourceRetType) { *arg = &val } // BootVolume The boot device for the server. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolume struct { // Delete the volume during the termination of the server. Defaults to false. DeleteOnTermination BootVolumegetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` @@ -136,6 +171,7 @@ type BootVolume struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBootVolume() *BootVolume { this := BootVolume{} return &this @@ -144,12 +180,14 @@ func NewBootVolume() *BootVolume { // NewBootVolumeWithDefaults instantiates a new BootVolume object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBootVolumeWithDefaults() *BootVolume { this := BootVolume{} return &this } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetDeleteOnTermination() (res BootVolumegetDeleteOnTerminationRetType) { res, _ = o.GetDeleteOnTerminationOk() return @@ -157,22 +195,26 @@ func (o *BootVolume) GetDeleteOnTermination() (res BootVolumegetDeleteOnTerminat // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetDeleteOnTerminationOk() (ret BootVolumegetDeleteOnTerminationRetType, ok bool) { return getBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) HasDeleteOnTermination() bool { _, ok := o.GetDeleteOnTerminationOk() return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) SetDeleteOnTermination(v BootVolumegetDeleteOnTerminationRetType) { setBootVolumegetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetId() (res BootVolumeGetIdRetType) { res, _ = o.GetIdOk() return @@ -180,22 +222,26 @@ func (o *BootVolume) GetId() (res BootVolumeGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetIdOk() (ret BootVolumeGetIdRetType, ok bool) { return getBootVolumeGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) SetId(v BootVolumeGetIdRetType) { setBootVolumeGetIdAttributeType(&o.Id, v) } // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetPerformanceClass() (res BootVolumeGetPerformanceClassRetType) { res, _ = o.GetPerformanceClassOk() return @@ -203,22 +249,26 @@ func (o *BootVolume) GetPerformanceClass() (res BootVolumeGetPerformanceClassRet // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetPerformanceClassOk() (ret BootVolumeGetPerformanceClassRetType, ok bool) { return getBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) } // HasPerformanceClass returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) HasPerformanceClass() bool { _, ok := o.GetPerformanceClassOk() return ok } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) SetPerformanceClass(v BootVolumeGetPerformanceClassRetType) { setBootVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetSize() (res BootVolumeGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -226,22 +276,26 @@ func (o *BootVolume) GetSize() (res BootVolumeGetSizeRetType) { // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetSizeOk() (ret BootVolumeGetSizeRetType, ok bool) { return getBootVolumeGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) SetSize(v BootVolumeGetSizeRetType) { setBootVolumeGetSizeAttributeType(&o.Size, v) } // GetSource returns the Source field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetSource() (res BootVolumeGetSourceRetType) { res, _ = o.GetSourceOk() return @@ -249,21 +303,25 @@ func (o *BootVolume) GetSource() (res BootVolumeGetSourceRetType) { // GetSourceOk returns a tuple with the Source field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) GetSourceOk() (ret BootVolumeGetSourceRetType, ok bool) { return getBootVolumeGetSourceAttributeTypeOk(o.Source) } // HasSource returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) HasSource() bool { _, ok := o.GetSourceOk() return ok } // SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolume) SetSource(v BootVolumeGetSourceRetType) { setBootVolumeGetSourceAttributeType(&o.Source, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BootVolume) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { @@ -284,37 +342,45 @@ func (o BootVolume) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBootVolume struct { value *BootVolume isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBootVolume) Get() *BootVolume { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBootVolume) Set(val *BootVolume) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBootVolume) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBootVolume) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBootVolume(val *BootVolume) *NullableBootVolume { return &NullableBootVolume{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBootVolume) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBootVolume) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_boot_volume_source.go b/services/iaas/model_boot_volume_source.go index aa5051a36..93842aa4a 100644 --- a/services/iaas/model_boot_volume_source.go +++ b/services/iaas/model_boot_volume_source.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BootVolumeSource{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeSourceGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBootVolumeSourceGetIdAttributeTypeOk(arg BootVolumeSourceGetIdAttributeType) (ret BootVolumeSourceGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBootVolumeSourceGetIdAttributeTypeOk(arg BootVolumeSourceGetIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBootVolumeSourceGetIdAttributeType(arg *BootVolumeSourceGetIdAttributeType, val BootVolumeSourceGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeSourceGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeSourceGetIdRetType = string /* @@ -43,8 +50,10 @@ type BootVolumeSourceGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeSourceGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBootVolumeSourceGetTypeAttributeTypeOk(arg BootVolumeSourceGetTypeAttributeType) (ret BootVolumeSourceGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getBootVolumeSourceGetTypeAttributeTypeOk(arg BootVolumeSourceGetTypeAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBootVolumeSourceGetTypeAttributeType(arg *BootVolumeSourceGetTypeAttributeType, val BootVolumeSourceGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeSourceGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeSourceGetTypeRetType = string // BootVolumeSource struct for BootVolumeSource +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BootVolumeSource struct { // Universally Unique Identifier (UUID). // REQUIRED @@ -69,12 +83,14 @@ type BootVolumeSource struct { Type BootVolumeSourceGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _BootVolumeSource BootVolumeSource // NewBootVolumeSource instantiates a new BootVolumeSource object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBootVolumeSource(id BootVolumeSourceGetIdArgType, types BootVolumeSourceGetTypeArgType) *BootVolumeSource { this := BootVolumeSource{} setBootVolumeSourceGetIdAttributeType(&this.Id, id) @@ -85,12 +101,14 @@ func NewBootVolumeSource(id BootVolumeSourceGetIdArgType, types BootVolumeSource // NewBootVolumeSourceWithDefaults instantiates a new BootVolumeSource object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBootVolumeSourceWithDefaults() *BootVolumeSource { this := BootVolumeSource{} return &this } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolumeSource) GetId() (ret BootVolumeSourceGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -98,16 +116,19 @@ func (o *BootVolumeSource) GetId() (ret BootVolumeSourceGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolumeSource) GetIdOk() (ret BootVolumeSourceGetIdRetType, ok bool) { return getBootVolumeSourceGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolumeSource) SetId(v BootVolumeSourceGetIdRetType) { setBootVolumeSourceGetIdAttributeType(&o.Id, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolumeSource) GetType() (ret BootVolumeSourceGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -115,15 +136,18 @@ func (o *BootVolumeSource) GetType() (ret BootVolumeSourceGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolumeSource) GetTypeOk() (ret BootVolumeSourceGetTypeRetType, ok bool) { return getBootVolumeSourceGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BootVolumeSource) SetType(v BootVolumeSourceGetTypeRetType) { setBootVolumeSourceGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BootVolumeSource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBootVolumeSourceGetIdAttributeTypeOk(o.Id); ok { @@ -135,37 +159,45 @@ func (o BootVolumeSource) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBootVolumeSource struct { value *BootVolumeSource isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBootVolumeSource) Get() *BootVolumeSource { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBootVolumeSource) Set(val *BootVolumeSource) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBootVolumeSource) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBootVolumeSource) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBootVolumeSource(val *BootVolumeSource) *NullableBootVolumeSource { return &NullableBootVolumeSource{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBootVolumeSource) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBootVolumeSource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_affinity_group_payload.go b/services/iaas/model_create_affinity_group_payload.go index c44fcbaf1..856655855 100644 --- a/services/iaas/model_create_affinity_group_payload.go +++ b/services/iaas/model_create_affinity_group_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateAffinityGroupPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateAffinityGroupPayloadGetIdAttributeTypeOk(arg CreateAffinityGroupPayloadGetIdAttributeType) (ret CreateAffinityGroupPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getCreateAffinityGroupPayloadGetIdAttributeTypeOk(arg CreateAffinityGroupPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateAffinityGroupPayloadGetIdAttributeType(arg *CreateAffinityGroupPayloadGetIdAttributeType, val CreateAffinityGroupPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetIdRetType = string /* @@ -43,10 +50,16 @@ type CreateAffinityGroupPayloadGetIdRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetMembersAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetMembersArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetMembersRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(arg CreateAffinityGroupPayloadGetMembersAttributeType) (ret CreateAffinityGroupPayloadGetMembersRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(arg CreateAffinityGr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateAffinityGroupPayloadGetMembersAttributeType(arg *CreateAffinityGroupPayloadGetMembersAttributeType, val CreateAffinityGroupPayloadGetMembersRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setCreateAffinityGroupPayloadGetMembersAttributeType(arg *CreateAffinityGro */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateAffinityGroupPayloadGetNameAttributeTypeOk(arg CreateAffinityGroupPayloadGetNameAttributeType) (ret CreateAffinityGroupPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getCreateAffinityGroupPayloadGetNameAttributeTypeOk(arg CreateAffinityGroup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateAffinityGroupPayloadGetNameAttributeType(arg *CreateAffinityGroupPayloadGetNameAttributeType, val CreateAffinityGroupPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetNameRetType = string /* @@ -84,8 +104,10 @@ type CreateAffinityGroupPayloadGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetPolicyAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(arg CreateAffinityGroupPayloadGetPolicyAttributeType) (ret CreateAffinityGroupPayloadGetPolicyRetType, ok bool) { if arg == nil { return ret, false @@ -93,14 +115,19 @@ func getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(arg CreateAffinityGro return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateAffinityGroupPayloadGetPolicyAttributeType(arg *CreateAffinityGroupPayloadGetPolicyAttributeType, val CreateAffinityGroupPayloadGetPolicyRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetPolicyArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayloadGetPolicyRetType = string // CreateAffinityGroupPayload Definition of an affinity group. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateAffinityGroupPayload struct { // Universally Unique Identifier (UUID). Id CreateAffinityGroupPayloadGetIdAttributeType `json:"id,omitempty"` @@ -114,12 +141,14 @@ type CreateAffinityGroupPayload struct { Policy CreateAffinityGroupPayloadGetPolicyAttributeType `json:"policy" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateAffinityGroupPayload CreateAffinityGroupPayload // NewCreateAffinityGroupPayload instantiates a new CreateAffinityGroupPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateAffinityGroupPayload(name CreateAffinityGroupPayloadGetNameArgType, policy CreateAffinityGroupPayloadGetPolicyArgType) *CreateAffinityGroupPayload { this := CreateAffinityGroupPayload{} setCreateAffinityGroupPayloadGetNameAttributeType(&this.Name, name) @@ -130,12 +159,14 @@ func NewCreateAffinityGroupPayload(name CreateAffinityGroupPayloadGetNameArgType // NewCreateAffinityGroupPayloadWithDefaults instantiates a new CreateAffinityGroupPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateAffinityGroupPayloadWithDefaults() *CreateAffinityGroupPayload { this := CreateAffinityGroupPayload{} return &this } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) GetId() (res CreateAffinityGroupPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -143,22 +174,26 @@ func (o *CreateAffinityGroupPayload) GetId() (res CreateAffinityGroupPayloadGetI // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) GetIdOk() (ret CreateAffinityGroupPayloadGetIdRetType, ok bool) { return getCreateAffinityGroupPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) SetId(v CreateAffinityGroupPayloadGetIdRetType) { setCreateAffinityGroupPayloadGetIdAttributeType(&o.Id, v) } // GetMembers returns the Members field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) GetMembers() (res CreateAffinityGroupPayloadGetMembersRetType) { res, _ = o.GetMembersOk() return @@ -166,22 +201,26 @@ func (o *CreateAffinityGroupPayload) GetMembers() (res CreateAffinityGroupPayloa // GetMembersOk returns a tuple with the Members field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) GetMembersOk() (ret CreateAffinityGroupPayloadGetMembersRetType, ok bool) { return getCreateAffinityGroupPayloadGetMembersAttributeTypeOk(o.Members) } // HasMembers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) HasMembers() bool { _, ok := o.GetMembersOk() return ok } // SetMembers gets a reference to the given []string and assigns it to the Members field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) SetMembers(v CreateAffinityGroupPayloadGetMembersRetType) { setCreateAffinityGroupPayloadGetMembersAttributeType(&o.Members, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) GetName() (ret CreateAffinityGroupPayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -189,16 +228,19 @@ func (o *CreateAffinityGroupPayload) GetName() (ret CreateAffinityGroupPayloadGe // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) GetNameOk() (ret CreateAffinityGroupPayloadGetNameRetType, ok bool) { return getCreateAffinityGroupPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) SetName(v CreateAffinityGroupPayloadGetNameRetType) { setCreateAffinityGroupPayloadGetNameAttributeType(&o.Name, v) } // GetPolicy returns the Policy field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) GetPolicy() (ret CreateAffinityGroupPayloadGetPolicyRetType) { ret, _ = o.GetPolicyOk() return ret @@ -206,15 +248,18 @@ func (o *CreateAffinityGroupPayload) GetPolicy() (ret CreateAffinityGroupPayload // GetPolicyOk returns a tuple with the Policy field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) GetPolicyOk() (ret CreateAffinityGroupPayloadGetPolicyRetType, ok bool) { return getCreateAffinityGroupPayloadGetPolicyAttributeTypeOk(o.Policy) } // SetPolicy sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateAffinityGroupPayload) SetPolicy(v CreateAffinityGroupPayloadGetPolicyRetType) { setCreateAffinityGroupPayloadGetPolicyAttributeType(&o.Policy, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateAffinityGroupPayloadGetIdAttributeTypeOk(o.Id); ok { @@ -232,37 +277,45 @@ func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateAffinityGroupPayload struct { value *CreateAffinityGroupPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateAffinityGroupPayload) Get() *CreateAffinityGroupPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateAffinityGroupPayload) Set(val *CreateAffinityGroupPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateAffinityGroupPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateAffinityGroupPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateAffinityGroupPayload(val *CreateAffinityGroupPayload) *NullableCreateAffinityGroupPayload { return &NullableCreateAffinityGroupPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateAffinityGroupPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_backup_payload.go b/services/iaas/model_create_backup_payload.go index a532660b4..f885f5b5b 100644 --- a/services/iaas/model_create_backup_payload.go +++ b/services/iaas/model_create_backup_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateBackupPayload{} */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupPayloadGetLabelsAttributeTypeOk(arg CreateBackupPayloadGetLabelsAttributeType) (ret CreateBackupPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateBackupPayloadGetLabelsAttributeTypeOk(arg CreateBackupPayloadGetLa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupPayloadGetLabelsAttributeType(arg *CreateBackupPayloadGetLabelsAttributeType, val CreateBackupPayloadGetLabelsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setCreateBackupPayloadGetLabelsAttributeType(arg *CreateBackupPayloadGetLab */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupPayloadGetNameAttributeTypeOk(arg CreateBackupPayloadGetNameAttributeType) (ret CreateBackupPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getCreateBackupPayloadGetNameAttributeTypeOk(arg CreateBackupPayloadGetName return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupPayloadGetNameAttributeType(arg *CreateBackupPayloadGetNameAttributeType, val CreateBackupPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetNameRetType = string /* @@ -63,10 +77,16 @@ type CreateBackupPayloadGetNameRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetSourceAttributeType = *BackupSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetSourceArgType = BackupSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetSourceRetType = BackupSource +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupPayloadGetSourceAttributeTypeOk(arg CreateBackupPayloadGetSourceAttributeType) (ret CreateBackupPayloadGetSourceRetType, ok bool) { if arg == nil { return ret, false @@ -74,13 +94,15 @@ func getCreateBackupPayloadGetSourceAttributeTypeOk(arg CreateBackupPayloadGetSo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupPayloadGetSourceAttributeType(arg *CreateBackupPayloadGetSourceAttributeType, val CreateBackupPayloadGetSourceRetType) { *arg = &val } // CreateBackupPayload Object that represents a backup create request body. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayload struct { - // 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. + // 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. Labels CreateBackupPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name CreateBackupPayloadGetNameAttributeType `json:"name,omitempty"` @@ -88,12 +110,14 @@ type CreateBackupPayload struct { Source CreateBackupPayloadGetSourceAttributeType `json:"source" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateBackupPayload CreateBackupPayload // NewCreateBackupPayload instantiates a new CreateBackupPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateBackupPayload(source CreateBackupPayloadGetSourceArgType) *CreateBackupPayload { this := CreateBackupPayload{} setCreateBackupPayloadGetSourceAttributeType(&this.Source, source) @@ -103,12 +127,14 @@ func NewCreateBackupPayload(source CreateBackupPayloadGetSourceArgType) *CreateB // NewCreateBackupPayloadWithDefaults instantiates a new CreateBackupPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { this := CreateBackupPayload{} return &this } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetLabels() (res CreateBackupPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -116,22 +142,26 @@ func (o *CreateBackupPayload) GetLabels() (res CreateBackupPayloadGetLabelsRetTy // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetLabelsOk() (ret CreateBackupPayloadGetLabelsRetType, ok bool) { return getCreateBackupPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) SetLabels(v CreateBackupPayloadGetLabelsRetType) { setCreateBackupPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetName() (res CreateBackupPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -139,22 +169,26 @@ func (o *CreateBackupPayload) GetName() (res CreateBackupPayloadGetNameRetType) // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetNameOk() (ret CreateBackupPayloadGetNameRetType, ok bool) { return getCreateBackupPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) SetName(v CreateBackupPayloadGetNameRetType) { setCreateBackupPayloadGetNameAttributeType(&o.Name, v) } // GetSource returns the Source field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetSource() (ret CreateBackupPayloadGetSourceRetType) { ret, _ = o.GetSourceOk() return ret @@ -162,15 +196,18 @@ func (o *CreateBackupPayload) GetSource() (ret CreateBackupPayloadGetSourceRetTy // GetSourceOk returns a tuple with the Source field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetSourceOk() (ret CreateBackupPayloadGetSourceRetType, ok bool) { return getCreateBackupPayloadGetSourceAttributeTypeOk(o.Source) } // SetSource sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) SetSource(v CreateBackupPayloadGetSourceRetType) { setCreateBackupPayloadGetSourceAttributeType(&o.Source, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateBackupPayloadGetLabelsAttributeTypeOk(o.Labels); ok { @@ -185,37 +222,45 @@ func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateBackupPayload struct { value *CreateBackupPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupPayload) Get() *CreateBackupPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateBackupPayload) Set(val *CreateBackupPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateBackupPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateBackupPayload(val *CreateBackupPayload) *NullableCreateBackupPayload { return &NullableCreateBackupPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateBackupPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_image_payload.go b/services/iaas/model_create_image_payload.go index 1b3e0ae3d..72143da24 100644 --- a/services/iaas/model_create_image_payload.go +++ b/services/iaas/model_create_image_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &CreateImagePayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetAgentAttributeType = *ImageAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetAgentArgType = ImageAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetAgentRetType = ImageAgent +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetAgentAttributeTypeOk(arg CreateImagePayloadGetAgentAttributeType) (ret CreateImagePayloadGetAgentRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getCreateImagePayloadGetAgentAttributeTypeOk(arg CreateImagePayloadGetAgent return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetAgentAttributeType(arg *CreateImagePayloadGetAgentAttributeType, val CreateImagePayloadGetAgentRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setCreateImagePayloadGetAgentAttributeType(arg *CreateImagePayloadGetAgentA */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetChecksumAttributeType = *ImageChecksum + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetChecksumArgType = ImageChecksum + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetChecksumRetType = ImageChecksum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetChecksumAttributeTypeOk(arg CreateImagePayloadGetChecksumAttributeType) (ret CreateImagePayloadGetChecksumRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getCreateImagePayloadGetChecksumAttributeTypeOk(arg CreateImagePayloadGetCh return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetChecksumAttributeType(arg *CreateImagePayloadGetChecksumAttributeType, val CreateImagePayloadGetChecksumRetType) { *arg = &val } @@ -63,10 +78,16 @@ func setCreateImagePayloadGetChecksumAttributeType(arg *CreateImagePayloadGetChe */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetConfigAttributeType = *ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetConfigArgType = ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetConfigRetType = ImageConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetConfigAttributeTypeOk(arg CreateImagePayloadGetConfigAttributeType) (ret CreateImagePayloadGetConfigRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +95,7 @@ func getCreateImagePayloadGetConfigAttributeTypeOk(arg CreateImagePayloadGetConf return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetConfigAttributeType(arg *CreateImagePayloadGetConfigAttributeType, val CreateImagePayloadGetConfigRetType) { *arg = &val } @@ -83,10 +105,16 @@ func setCreateImagePayloadGetConfigAttributeType(arg *CreateImagePayloadGetConfi */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetCreatedAtAttributeTypeOk(arg CreateImagePayloadGetCreatedAtAttributeType) (ret CreateImagePayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -94,6 +122,7 @@ func getCreateImagePayloadGetCreatedAtAttributeTypeOk(arg CreateImagePayloadGetC return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetCreatedAtAttributeType(arg *CreateImagePayloadGetCreatedAtAttributeType, val CreateImagePayloadGetCreatedAtRetType) { *arg = &val } @@ -103,8 +132,10 @@ func setCreateImagePayloadGetCreatedAtAttributeType(arg *CreateImagePayloadGetCr */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetDiskFormatAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetDiskFormatAttributeTypeOk(arg CreateImagePayloadGetDiskFormatAttributeType) (ret CreateImagePayloadGetDiskFormatRetType, ok bool) { if arg == nil { return ret, false @@ -112,11 +143,15 @@ func getCreateImagePayloadGetDiskFormatAttributeTypeOk(arg CreateImagePayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetDiskFormatAttributeType(arg *CreateImagePayloadGetDiskFormatAttributeType, val CreateImagePayloadGetDiskFormatRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetDiskFormatArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetDiskFormatRetType = string /* @@ -124,8 +159,10 @@ type CreateImagePayloadGetDiskFormatRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetIdAttributeTypeOk(arg CreateImagePayloadGetIdAttributeType) (ret CreateImagePayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -133,11 +170,15 @@ func getCreateImagePayloadGetIdAttributeTypeOk(arg CreateImagePayloadGetIdAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetIdAttributeType(arg *CreateImagePayloadGetIdAttributeType, val CreateImagePayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetIdRetType = string /* @@ -145,10 +186,16 @@ type CreateImagePayloadGetIdRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetImportProgressAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetImportProgressArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetImportProgressRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetImportProgressAttributeTypeOk(arg CreateImagePayloadGetImportProgressAttributeType) (ret CreateImagePayloadGetImportProgressRetType, ok bool) { if arg == nil { return ret, false @@ -156,6 +203,7 @@ func getCreateImagePayloadGetImportProgressAttributeTypeOk(arg CreateImagePayloa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetImportProgressAttributeType(arg *CreateImagePayloadGetImportProgressAttributeType, val CreateImagePayloadGetImportProgressRetType) { *arg = &val } @@ -165,10 +213,16 @@ func setCreateImagePayloadGetImportProgressAttributeType(arg *CreateImagePayload */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetLabelsAttributeTypeOk(arg CreateImagePayloadGetLabelsAttributeType) (ret CreateImagePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -176,6 +230,7 @@ func getCreateImagePayloadGetLabelsAttributeTypeOk(arg CreateImagePayloadGetLabe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetLabelsAttributeType(arg *CreateImagePayloadGetLabelsAttributeType, val CreateImagePayloadGetLabelsRetType) { *arg = &val } @@ -185,10 +240,16 @@ func setCreateImagePayloadGetLabelsAttributeType(arg *CreateImagePayloadGetLabel */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetMinDiskSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetMinDiskSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetMinDiskSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(arg CreateImagePayloadGetMinDiskSizeAttributeType) (ret CreateImagePayloadGetMinDiskSizeRetType, ok bool) { if arg == nil { return ret, false @@ -196,6 +257,7 @@ func getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(arg CreateImagePayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetMinDiskSizeAttributeType(arg *CreateImagePayloadGetMinDiskSizeAttributeType, val CreateImagePayloadGetMinDiskSizeRetType) { *arg = &val } @@ -205,10 +267,16 @@ func setCreateImagePayloadGetMinDiskSizeAttributeType(arg *CreateImagePayloadGet */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetMinRamAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetMinRamArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetMinRamRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetMinRamAttributeTypeOk(arg CreateImagePayloadGetMinRamAttributeType) (ret CreateImagePayloadGetMinRamRetType, ok bool) { if arg == nil { return ret, false @@ -216,6 +284,7 @@ func getCreateImagePayloadGetMinRamAttributeTypeOk(arg CreateImagePayloadGetMinR return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetMinRamAttributeType(arg *CreateImagePayloadGetMinRamAttributeType, val CreateImagePayloadGetMinRamRetType) { *arg = &val } @@ -225,8 +294,10 @@ func setCreateImagePayloadGetMinRamAttributeType(arg *CreateImagePayloadGetMinRa */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetNameAttributeTypeOk(arg CreateImagePayloadGetNameAttributeType) (ret CreateImagePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -234,11 +305,15 @@ func getCreateImagePayloadGetNameAttributeTypeOk(arg CreateImagePayloadGetNameAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetNameAttributeType(arg *CreateImagePayloadGetNameAttributeType, val CreateImagePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetNameRetType = string /* @@ -246,8 +321,10 @@ type CreateImagePayloadGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetOwnerAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetOwnerAttributeTypeOk(arg CreateImagePayloadGetOwnerAttributeType) (ret CreateImagePayloadGetOwnerRetType, ok bool) { if arg == nil { return ret, false @@ -255,11 +332,15 @@ func getCreateImagePayloadGetOwnerAttributeTypeOk(arg CreateImagePayloadGetOwner return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetOwnerAttributeType(arg *CreateImagePayloadGetOwnerAttributeType, val CreateImagePayloadGetOwnerRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetOwnerArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetOwnerRetType = string /* @@ -267,10 +348,16 @@ type CreateImagePayloadGetOwnerRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadgetProtectedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadgetProtectedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadgetProtectedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadgetProtectedAttributeTypeOk(arg CreateImagePayloadgetProtectedAttributeType) (ret CreateImagePayloadgetProtectedRetType, ok bool) { if arg == nil { return ret, false @@ -278,6 +365,7 @@ func getCreateImagePayloadgetProtectedAttributeTypeOk(arg CreateImagePayloadgetP return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadgetProtectedAttributeType(arg *CreateImagePayloadgetProtectedAttributeType, val CreateImagePayloadgetProtectedRetType) { *arg = &val } @@ -287,8 +375,10 @@ func setCreateImagePayloadgetProtectedAttributeType(arg *CreateImagePayloadgetPr */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetScopeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetScopeAttributeTypeOk(arg CreateImagePayloadGetScopeAttributeType) (ret CreateImagePayloadGetScopeRetType, ok bool) { if arg == nil { return ret, false @@ -296,11 +386,15 @@ func getCreateImagePayloadGetScopeAttributeTypeOk(arg CreateImagePayloadGetScope return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetScopeAttributeType(arg *CreateImagePayloadGetScopeAttributeType, val CreateImagePayloadGetScopeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetScopeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetScopeRetType = string /* @@ -308,10 +402,16 @@ type CreateImagePayloadGetScopeRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetSizeAttributeTypeOk(arg CreateImagePayloadGetSizeAttributeType) (ret CreateImagePayloadGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -319,6 +419,7 @@ func getCreateImagePayloadGetSizeAttributeTypeOk(arg CreateImagePayloadGetSizeAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetSizeAttributeType(arg *CreateImagePayloadGetSizeAttributeType, val CreateImagePayloadGetSizeRetType) { *arg = &val } @@ -328,8 +429,10 @@ func setCreateImagePayloadGetSizeAttributeType(arg *CreateImagePayloadGetSizeAtt */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetStatusAttributeTypeOk(arg CreateImagePayloadGetStatusAttributeType) (ret CreateImagePayloadGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -337,11 +440,15 @@ func getCreateImagePayloadGetStatusAttributeTypeOk(arg CreateImagePayloadGetStat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetStatusAttributeType(arg *CreateImagePayloadGetStatusAttributeType, val CreateImagePayloadGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetStatusRetType = string /* @@ -349,10 +456,16 @@ type CreateImagePayloadGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateImagePayloadGetUpdatedAtAttributeTypeOk(arg CreateImagePayloadGetUpdatedAtAttributeType) (ret CreateImagePayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -360,11 +473,13 @@ func getCreateImagePayloadGetUpdatedAtAttributeTypeOk(arg CreateImagePayloadGetU return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateImagePayloadGetUpdatedAtAttributeType(arg *CreateImagePayloadGetUpdatedAtAttributeType, val CreateImagePayloadGetUpdatedAtRetType) { *arg = &val } // CreateImagePayload Object that represents an Image and its parameters. Used for Creating and returning (get/list). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateImagePayload struct { Agent CreateImagePayloadGetAgentAttributeType `json:"agent,omitempty"` Checksum CreateImagePayloadGetChecksumAttributeType `json:"checksum,omitempty"` @@ -378,7 +493,7 @@ type CreateImagePayload struct { Id CreateImagePayloadGetIdAttributeType `json:"id,omitempty"` // Indicates Image Import Progress in percent. ImportProgress CreateImagePayloadGetImportProgressAttributeType `json:"importProgress,omitempty"` - // 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. + // 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. Labels CreateImagePayloadGetLabelsAttributeType `json:"labels,omitempty"` // Size in Gigabyte. MinDiskSize CreateImagePayloadGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` @@ -401,12 +516,14 @@ type CreateImagePayload struct { UpdatedAt CreateImagePayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateImagePayload CreateImagePayload // NewCreateImagePayload instantiates a new CreateImagePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateImagePayload(diskFormat CreateImagePayloadGetDiskFormatArgType, name CreateImagePayloadGetNameArgType) *CreateImagePayload { this := CreateImagePayload{} setCreateImagePayloadGetDiskFormatAttributeType(&this.DiskFormat, diskFormat) @@ -417,12 +534,14 @@ func NewCreateImagePayload(diskFormat CreateImagePayloadGetDiskFormatArgType, na // NewCreateImagePayloadWithDefaults instantiates a new CreateImagePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateImagePayloadWithDefaults() *CreateImagePayload { this := CreateImagePayload{} return &this } // GetAgent returns the Agent field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetAgent() (res CreateImagePayloadGetAgentRetType) { res, _ = o.GetAgentOk() return @@ -430,22 +549,26 @@ func (o *CreateImagePayload) GetAgent() (res CreateImagePayloadGetAgentRetType) // GetAgentOk returns a tuple with the Agent field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetAgentOk() (ret CreateImagePayloadGetAgentRetType, ok bool) { return getCreateImagePayloadGetAgentAttributeTypeOk(o.Agent) } // HasAgent returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasAgent() bool { _, ok := o.GetAgentOk() return ok } // SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetAgent(v CreateImagePayloadGetAgentRetType) { setCreateImagePayloadGetAgentAttributeType(&o.Agent, v) } // GetChecksum returns the Checksum field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetChecksum() (res CreateImagePayloadGetChecksumRetType) { res, _ = o.GetChecksumOk() return @@ -453,22 +576,26 @@ func (o *CreateImagePayload) GetChecksum() (res CreateImagePayloadGetChecksumRet // GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetChecksumOk() (ret CreateImagePayloadGetChecksumRetType, ok bool) { return getCreateImagePayloadGetChecksumAttributeTypeOk(o.Checksum) } // HasChecksum returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasChecksum() bool { _, ok := o.GetChecksumOk() return ok } // SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetChecksum(v CreateImagePayloadGetChecksumRetType) { setCreateImagePayloadGetChecksumAttributeType(&o.Checksum, v) } // GetConfig returns the Config field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetConfig() (res CreateImagePayloadGetConfigRetType) { res, _ = o.GetConfigOk() return @@ -476,22 +603,26 @@ func (o *CreateImagePayload) GetConfig() (res CreateImagePayloadGetConfigRetType // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetConfigOk() (ret CreateImagePayloadGetConfigRetType, ok bool) { return getCreateImagePayloadGetConfigAttributeTypeOk(o.Config) } // HasConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasConfig() bool { _, ok := o.GetConfigOk() return ok } // SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetConfig(v CreateImagePayloadGetConfigRetType) { setCreateImagePayloadGetConfigAttributeType(&o.Config, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetCreatedAt() (res CreateImagePayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -499,22 +630,26 @@ func (o *CreateImagePayload) GetCreatedAt() (res CreateImagePayloadGetCreatedAtR // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetCreatedAtOk() (ret CreateImagePayloadGetCreatedAtRetType, ok bool) { return getCreateImagePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetCreatedAt(v CreateImagePayloadGetCreatedAtRetType) { setCreateImagePayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDiskFormat returns the DiskFormat field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetDiskFormat() (ret CreateImagePayloadGetDiskFormatRetType) { ret, _ = o.GetDiskFormatOk() return ret @@ -522,16 +657,19 @@ func (o *CreateImagePayload) GetDiskFormat() (ret CreateImagePayloadGetDiskForma // GetDiskFormatOk returns a tuple with the DiskFormat field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetDiskFormatOk() (ret CreateImagePayloadGetDiskFormatRetType, ok bool) { return getCreateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat) } // SetDiskFormat sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetDiskFormat(v CreateImagePayloadGetDiskFormatRetType) { setCreateImagePayloadGetDiskFormatAttributeType(&o.DiskFormat, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetId() (res CreateImagePayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -539,22 +677,26 @@ func (o *CreateImagePayload) GetId() (res CreateImagePayloadGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetIdOk() (ret CreateImagePayloadGetIdRetType, ok bool) { return getCreateImagePayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetId(v CreateImagePayloadGetIdRetType) { setCreateImagePayloadGetIdAttributeType(&o.Id, v) } // GetImportProgress returns the ImportProgress field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetImportProgress() (res CreateImagePayloadGetImportProgressRetType) { res, _ = o.GetImportProgressOk() return @@ -562,22 +704,26 @@ func (o *CreateImagePayload) GetImportProgress() (res CreateImagePayloadGetImpor // GetImportProgressOk returns a tuple with the ImportProgress field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetImportProgressOk() (ret CreateImagePayloadGetImportProgressRetType, ok bool) { return getCreateImagePayloadGetImportProgressAttributeTypeOk(o.ImportProgress) } // HasImportProgress returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasImportProgress() bool { _, ok := o.GetImportProgressOk() return ok } // SetImportProgress gets a reference to the given int64 and assigns it to the ImportProgress field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetImportProgress(v CreateImagePayloadGetImportProgressRetType) { setCreateImagePayloadGetImportProgressAttributeType(&o.ImportProgress, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetLabels() (res CreateImagePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -585,22 +731,26 @@ func (o *CreateImagePayload) GetLabels() (res CreateImagePayloadGetLabelsRetType // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetLabelsOk() (ret CreateImagePayloadGetLabelsRetType, ok bool) { return getCreateImagePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetLabels(v CreateImagePayloadGetLabelsRetType) { setCreateImagePayloadGetLabelsAttributeType(&o.Labels, v) } // GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetMinDiskSize() (res CreateImagePayloadGetMinDiskSizeRetType) { res, _ = o.GetMinDiskSizeOk() return @@ -608,22 +758,26 @@ func (o *CreateImagePayload) GetMinDiskSize() (res CreateImagePayloadGetMinDiskS // GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetMinDiskSizeOk() (ret CreateImagePayloadGetMinDiskSizeRetType, ok bool) { return getCreateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) } // HasMinDiskSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasMinDiskSize() bool { _, ok := o.GetMinDiskSizeOk() return ok } // SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetMinDiskSize(v CreateImagePayloadGetMinDiskSizeRetType) { setCreateImagePayloadGetMinDiskSizeAttributeType(&o.MinDiskSize, v) } // GetMinRam returns the MinRam field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetMinRam() (res CreateImagePayloadGetMinRamRetType) { res, _ = o.GetMinRamOk() return @@ -631,22 +785,26 @@ func (o *CreateImagePayload) GetMinRam() (res CreateImagePayloadGetMinRamRetType // GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetMinRamOk() (ret CreateImagePayloadGetMinRamRetType, ok bool) { return getCreateImagePayloadGetMinRamAttributeTypeOk(o.MinRam) } // HasMinRam returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasMinRam() bool { _, ok := o.GetMinRamOk() return ok } // SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetMinRam(v CreateImagePayloadGetMinRamRetType) { setCreateImagePayloadGetMinRamAttributeType(&o.MinRam, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetName() (ret CreateImagePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -654,16 +812,19 @@ func (o *CreateImagePayload) GetName() (ret CreateImagePayloadGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetNameOk() (ret CreateImagePayloadGetNameRetType, ok bool) { return getCreateImagePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetName(v CreateImagePayloadGetNameRetType) { setCreateImagePayloadGetNameAttributeType(&o.Name, v) } // GetOwner returns the Owner field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetOwner() (res CreateImagePayloadGetOwnerRetType) { res, _ = o.GetOwnerOk() return @@ -671,22 +832,26 @@ func (o *CreateImagePayload) GetOwner() (res CreateImagePayloadGetOwnerRetType) // GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetOwnerOk() (ret CreateImagePayloadGetOwnerRetType, ok bool) { return getCreateImagePayloadGetOwnerAttributeTypeOk(o.Owner) } // HasOwner returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasOwner() bool { _, ok := o.GetOwnerOk() return ok } // SetOwner gets a reference to the given string and assigns it to the Owner field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetOwner(v CreateImagePayloadGetOwnerRetType) { setCreateImagePayloadGetOwnerAttributeType(&o.Owner, v) } // GetProtected returns the Protected field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetProtected() (res CreateImagePayloadgetProtectedRetType) { res, _ = o.GetProtectedOk() return @@ -694,22 +859,26 @@ func (o *CreateImagePayload) GetProtected() (res CreateImagePayloadgetProtectedR // GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetProtectedOk() (ret CreateImagePayloadgetProtectedRetType, ok bool) { return getCreateImagePayloadgetProtectedAttributeTypeOk(o.Protected) } // HasProtected returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasProtected() bool { _, ok := o.GetProtectedOk() return ok } // SetProtected gets a reference to the given bool and assigns it to the Protected field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetProtected(v CreateImagePayloadgetProtectedRetType) { setCreateImagePayloadgetProtectedAttributeType(&o.Protected, v) } // GetScope returns the Scope field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetScope() (res CreateImagePayloadGetScopeRetType) { res, _ = o.GetScopeOk() return @@ -717,22 +886,26 @@ func (o *CreateImagePayload) GetScope() (res CreateImagePayloadGetScopeRetType) // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetScopeOk() (ret CreateImagePayloadGetScopeRetType, ok bool) { return getCreateImagePayloadGetScopeAttributeTypeOk(o.Scope) } // HasScope returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasScope() bool { _, ok := o.GetScopeOk() return ok } // SetScope gets a reference to the given string and assigns it to the Scope field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetScope(v CreateImagePayloadGetScopeRetType) { setCreateImagePayloadGetScopeAttributeType(&o.Scope, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetSize() (res CreateImagePayloadGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -740,22 +913,26 @@ func (o *CreateImagePayload) GetSize() (res CreateImagePayloadGetSizeRetType) { // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetSizeOk() (ret CreateImagePayloadGetSizeRetType, ok bool) { return getCreateImagePayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetSize(v CreateImagePayloadGetSizeRetType) { setCreateImagePayloadGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetStatus() (res CreateImagePayloadGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -763,22 +940,26 @@ func (o *CreateImagePayload) GetStatus() (res CreateImagePayloadGetStatusRetType // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetStatusOk() (ret CreateImagePayloadGetStatusRetType, ok bool) { return getCreateImagePayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetStatus(v CreateImagePayloadGetStatusRetType) { setCreateImagePayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetUpdatedAt() (res CreateImagePayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -786,21 +967,25 @@ func (o *CreateImagePayload) GetUpdatedAt() (res CreateImagePayloadGetUpdatedAtR // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) GetUpdatedAtOk() (ret CreateImagePayloadGetUpdatedAtRetType, ok bool) { return getCreateImagePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateImagePayload) SetUpdatedAt(v CreateImagePayloadGetUpdatedAtRetType) { setCreateImagePayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateImagePayloadGetAgentAttributeTypeOk(o.Agent); ok { @@ -857,37 +1042,45 @@ func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateImagePayload struct { value *CreateImagePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateImagePayload) Get() *CreateImagePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateImagePayload) Set(val *CreateImagePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateImagePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateImagePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateImagePayload(val *CreateImagePayload) *NullableCreateImagePayload { return &NullableCreateImagePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateImagePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateImagePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_isolated_network_payload.go b/services/iaas/model_create_isolated_network_payload.go index 84db24978..cc6a8cad4 100644 --- a/services/iaas/model_create_isolated_network_payload.go +++ b/services/iaas/model_create_isolated_network_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateIsolatedNetworkPayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadgetDhcpAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadgetDhcpArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadgetDhcpRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateIsolatedNetworkPayloadgetDhcpAttributeTypeOk(arg CreateIsolatedNetworkPayloadgetDhcpAttributeType) (ret CreateIsolatedNetworkPayloadgetDhcpRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateIsolatedNetworkPayloadgetDhcpAttributeTypeOk(arg CreateIsolatedNet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateIsolatedNetworkPayloadgetDhcpAttributeType(arg *CreateIsolatedNetworkPayloadgetDhcpAttributeType, val CreateIsolatedNetworkPayloadgetDhcpRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setCreateIsolatedNetworkPayloadgetDhcpAttributeType(arg *CreateIsolatedNetw */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetIpv4AttributeType = *CreateNetworkIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetIpv4ArgType = CreateNetworkIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetIpv4RetType = CreateNetworkIPv4 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateIsolatedNetworkPayloadGetIpv4AttributeTypeOk(arg CreateIsolatedNetworkPayloadGetIpv4AttributeType) (ret CreateIsolatedNetworkPayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getCreateIsolatedNetworkPayloadGetIpv4AttributeTypeOk(arg CreateIsolatedNet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateIsolatedNetworkPayloadGetIpv4AttributeType(arg *CreateIsolatedNetworkPayloadGetIpv4AttributeType, val CreateIsolatedNetworkPayloadGetIpv4RetType) { *arg = &val } @@ -62,10 +77,16 @@ func setCreateIsolatedNetworkPayloadGetIpv4AttributeType(arg *CreateIsolatedNetw */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateIsolatedNetworkPayloadGetLabelsAttributeTypeOk(arg CreateIsolatedNetworkPayloadGetLabelsAttributeType) (ret CreateIsolatedNetworkPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getCreateIsolatedNetworkPayloadGetLabelsAttributeTypeOk(arg CreateIsolatedN return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateIsolatedNetworkPayloadGetLabelsAttributeType(arg *CreateIsolatedNetworkPayloadGetLabelsAttributeType, val CreateIsolatedNetworkPayloadGetLabelsRetType) { *arg = &val } @@ -82,8 +104,10 @@ func setCreateIsolatedNetworkPayloadGetLabelsAttributeType(arg *CreateIsolatedNe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateIsolatedNetworkPayloadGetNameAttributeTypeOk(arg CreateIsolatedNetworkPayloadGetNameAttributeType) (ret CreateIsolatedNetworkPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -91,31 +115,38 @@ func getCreateIsolatedNetworkPayloadGetNameAttributeTypeOk(arg CreateIsolatedNet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateIsolatedNetworkPayloadGetNameAttributeType(arg *CreateIsolatedNetworkPayloadGetNameAttributeType, val CreateIsolatedNetworkPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayloadGetNameRetType = string // CreateIsolatedNetworkPayload Object that represents the request body for a single isolated network create. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateIsolatedNetworkPayload struct { // Enable or disable DHCP for a network. Dhcp CreateIsolatedNetworkPayloadgetDhcpAttributeType `json:"dhcp,omitempty"` Ipv4 CreateIsolatedNetworkPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` - // 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. + // 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. Labels CreateIsolatedNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED Name CreateIsolatedNetworkPayloadGetNameAttributeType `json:"name" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateIsolatedNetworkPayload CreateIsolatedNetworkPayload // NewCreateIsolatedNetworkPayload instantiates a new CreateIsolatedNetworkPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateIsolatedNetworkPayload(name CreateIsolatedNetworkPayloadGetNameArgType) *CreateIsolatedNetworkPayload { this := CreateIsolatedNetworkPayload{} setCreateIsolatedNetworkPayloadGetNameAttributeType(&this.Name, name) @@ -125,6 +156,7 @@ func NewCreateIsolatedNetworkPayload(name CreateIsolatedNetworkPayloadGetNameArg // NewCreateIsolatedNetworkPayloadWithDefaults instantiates a new CreateIsolatedNetworkPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateIsolatedNetworkPayloadWithDefaults() *CreateIsolatedNetworkPayload { this := CreateIsolatedNetworkPayload{} var dhcp bool = true @@ -133,6 +165,7 @@ func NewCreateIsolatedNetworkPayloadWithDefaults() *CreateIsolatedNetworkPayload } // GetDhcp returns the Dhcp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) GetDhcp() (res CreateIsolatedNetworkPayloadgetDhcpRetType) { res, _ = o.GetDhcpOk() return @@ -140,22 +173,26 @@ func (o *CreateIsolatedNetworkPayload) GetDhcp() (res CreateIsolatedNetworkPaylo // GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) GetDhcpOk() (ret CreateIsolatedNetworkPayloadgetDhcpRetType, ok bool) { return getCreateIsolatedNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp) } // HasDhcp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) HasDhcp() bool { _, ok := o.GetDhcpOk() return ok } // SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) SetDhcp(v CreateIsolatedNetworkPayloadgetDhcpRetType) { setCreateIsolatedNetworkPayloadgetDhcpAttributeType(&o.Dhcp, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) GetIpv4() (res CreateIsolatedNetworkPayloadGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -163,22 +200,26 @@ func (o *CreateIsolatedNetworkPayload) GetIpv4() (res CreateIsolatedNetworkPaylo // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) GetIpv4Ok() (ret CreateIsolatedNetworkPayloadGetIpv4RetType, ok bool) { return getCreateIsolatedNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) SetIpv4(v CreateIsolatedNetworkPayloadGetIpv4RetType) { setCreateIsolatedNetworkPayloadGetIpv4AttributeType(&o.Ipv4, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) GetLabels() (res CreateIsolatedNetworkPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -186,22 +227,26 @@ func (o *CreateIsolatedNetworkPayload) GetLabels() (res CreateIsolatedNetworkPay // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) GetLabelsOk() (ret CreateIsolatedNetworkPayloadGetLabelsRetType, ok bool) { return getCreateIsolatedNetworkPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) SetLabels(v CreateIsolatedNetworkPayloadGetLabelsRetType) { setCreateIsolatedNetworkPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) GetName() (ret CreateIsolatedNetworkPayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -209,15 +254,18 @@ func (o *CreateIsolatedNetworkPayload) GetName() (ret CreateIsolatedNetworkPaylo // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) GetNameOk() (ret CreateIsolatedNetworkPayloadGetNameRetType, ok bool) { return getCreateIsolatedNetworkPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateIsolatedNetworkPayload) SetName(v CreateIsolatedNetworkPayloadGetNameRetType) { setCreateIsolatedNetworkPayloadGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateIsolatedNetworkPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateIsolatedNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp); ok { @@ -235,37 +283,45 @@ func (o CreateIsolatedNetworkPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateIsolatedNetworkPayload struct { value *CreateIsolatedNetworkPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateIsolatedNetworkPayload) Get() *CreateIsolatedNetworkPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateIsolatedNetworkPayload) Set(val *CreateIsolatedNetworkPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateIsolatedNetworkPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateIsolatedNetworkPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateIsolatedNetworkPayload(val *CreateIsolatedNetworkPayload) *NullableCreateIsolatedNetworkPayload { return &NullableCreateIsolatedNetworkPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateIsolatedNetworkPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateIsolatedNetworkPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_key_pair_payload.go b/services/iaas/model_create_key_pair_payload.go index d4e5f8efe..e51c6fe71 100644 --- a/services/iaas/model_create_key_pair_payload.go +++ b/services/iaas/model_create_key_pair_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &CreateKeyPairPayload{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(arg CreateKeyPairPayloadGetCreatedAtAttributeType) (ret CreateKeyPairPayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(arg CreateKeyPairPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateKeyPairPayloadGetCreatedAtAttributeType(arg *CreateKeyPairPayloadGetCreatedAtAttributeType, val CreateKeyPairPayloadGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setCreateKeyPairPayloadGetCreatedAtAttributeType(arg *CreateKeyPairPayloadG */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetFingerprintAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(arg CreateKeyPairPayloadGetFingerprintAttributeType) (ret CreateKeyPairPayloadGetFingerprintRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(arg CreateKeyPairPaylo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateKeyPairPayloadGetFingerprintAttributeType(arg *CreateKeyPairPayloadGetFingerprintAttributeType, val CreateKeyPairPayloadGetFingerprintRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetFingerprintArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetFingerprintRetType = string /* @@ -64,10 +78,16 @@ type CreateKeyPairPayloadGetFingerprintRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateKeyPairPayloadGetLabelsAttributeTypeOk(arg CreateKeyPairPayloadGetLabelsAttributeType) (ret CreateKeyPairPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getCreateKeyPairPayloadGetLabelsAttributeTypeOk(arg CreateKeyPairPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateKeyPairPayloadGetLabelsAttributeType(arg *CreateKeyPairPayloadGetLabelsAttributeType, val CreateKeyPairPayloadGetLabelsRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setCreateKeyPairPayloadGetLabelsAttributeType(arg *CreateKeyPairPayloadGetL */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateKeyPairPayloadGetNameAttributeTypeOk(arg CreateKeyPairPayloadGetNameAttributeType) (ret CreateKeyPairPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getCreateKeyPairPayloadGetNameAttributeTypeOk(arg CreateKeyPairPayloadGetNa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateKeyPairPayloadGetNameAttributeType(arg *CreateKeyPairPayloadGetNameAttributeType, val CreateKeyPairPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetNameRetType = string /* @@ -105,8 +132,10 @@ type CreateKeyPairPayloadGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetPublicKeyAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(arg CreateKeyPairPayloadGetPublicKeyAttributeType) (ret CreateKeyPairPayloadGetPublicKeyRetType, ok bool) { if arg == nil { return ret, false @@ -114,11 +143,15 @@ func getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(arg CreateKeyPairPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateKeyPairPayloadGetPublicKeyAttributeType(arg *CreateKeyPairPayloadGetPublicKeyAttributeType, val CreateKeyPairPayloadGetPublicKeyRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetPublicKeyArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetPublicKeyRetType = string /* @@ -126,10 +159,16 @@ type CreateKeyPairPayloadGetPublicKeyRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(arg CreateKeyPairPayloadGetUpdatedAtAttributeType) (ret CreateKeyPairPayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -137,17 +176,19 @@ func getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(arg CreateKeyPairPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateKeyPairPayloadGetUpdatedAtAttributeType(arg *CreateKeyPairPayloadGetUpdatedAtAttributeType, val CreateKeyPairPayloadGetUpdatedAtRetType) { *arg = &val } // CreateKeyPairPayload Object that represents the public key of an SSH keypair and its name. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateKeyPairPayload struct { // Date-time when resource was created. CreatedAt CreateKeyPairPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Object that represents an SSH keypair MD5 fingerprint. Fingerprint CreateKeyPairPayloadGetFingerprintAttributeType `json:"fingerprint,omitempty"` - // 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. + // 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. Labels CreateKeyPairPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. Name CreateKeyPairPayloadGetNameAttributeType `json:"name,omitempty"` @@ -158,12 +199,14 @@ type CreateKeyPairPayload struct { UpdatedAt CreateKeyPairPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateKeyPairPayload CreateKeyPairPayload // NewCreateKeyPairPayload instantiates a new CreateKeyPairPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateKeyPairPayload(publicKey CreateKeyPairPayloadGetPublicKeyArgType) *CreateKeyPairPayload { this := CreateKeyPairPayload{} setCreateKeyPairPayloadGetPublicKeyAttributeType(&this.PublicKey, publicKey) @@ -173,12 +216,14 @@ func NewCreateKeyPairPayload(publicKey CreateKeyPairPayloadGetPublicKeyArgType) // NewCreateKeyPairPayloadWithDefaults instantiates a new CreateKeyPairPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateKeyPairPayloadWithDefaults() *CreateKeyPairPayload { this := CreateKeyPairPayload{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetCreatedAt() (res CreateKeyPairPayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -186,22 +231,26 @@ func (o *CreateKeyPairPayload) GetCreatedAt() (res CreateKeyPairPayloadGetCreate // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetCreatedAtOk() (ret CreateKeyPairPayloadGetCreatedAtRetType, ok bool) { return getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) SetCreatedAt(v CreateKeyPairPayloadGetCreatedAtRetType) { setCreateKeyPairPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetFingerprint() (res CreateKeyPairPayloadGetFingerprintRetType) { res, _ = o.GetFingerprintOk() return @@ -209,22 +258,26 @@ func (o *CreateKeyPairPayload) GetFingerprint() (res CreateKeyPairPayloadGetFing // GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetFingerprintOk() (ret CreateKeyPairPayloadGetFingerprintRetType, ok bool) { return getCreateKeyPairPayloadGetFingerprintAttributeTypeOk(o.Fingerprint) } // HasFingerprint returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) HasFingerprint() bool { _, ok := o.GetFingerprintOk() return ok } // SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) SetFingerprint(v CreateKeyPairPayloadGetFingerprintRetType) { setCreateKeyPairPayloadGetFingerprintAttributeType(&o.Fingerprint, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetLabels() (res CreateKeyPairPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -232,22 +285,26 @@ func (o *CreateKeyPairPayload) GetLabels() (res CreateKeyPairPayloadGetLabelsRet // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetLabelsOk() (ret CreateKeyPairPayloadGetLabelsRetType, ok bool) { return getCreateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) SetLabels(v CreateKeyPairPayloadGetLabelsRetType) { setCreateKeyPairPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetName() (res CreateKeyPairPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -255,22 +312,26 @@ func (o *CreateKeyPairPayload) GetName() (res CreateKeyPairPayloadGetNameRetType // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetNameOk() (ret CreateKeyPairPayloadGetNameRetType, ok bool) { return getCreateKeyPairPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) SetName(v CreateKeyPairPayloadGetNameRetType) { setCreateKeyPairPayloadGetNameAttributeType(&o.Name, v) } // GetPublicKey returns the PublicKey field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetPublicKey() (ret CreateKeyPairPayloadGetPublicKeyRetType) { ret, _ = o.GetPublicKeyOk() return ret @@ -278,16 +339,19 @@ func (o *CreateKeyPairPayload) GetPublicKey() (ret CreateKeyPairPayloadGetPublic // GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetPublicKeyOk() (ret CreateKeyPairPayloadGetPublicKeyRetType, ok bool) { return getCreateKeyPairPayloadGetPublicKeyAttributeTypeOk(o.PublicKey) } // SetPublicKey sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) SetPublicKey(v CreateKeyPairPayloadGetPublicKeyRetType) { setCreateKeyPairPayloadGetPublicKeyAttributeType(&o.PublicKey, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetUpdatedAt() (res CreateKeyPairPayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -295,21 +359,25 @@ func (o *CreateKeyPairPayload) GetUpdatedAt() (res CreateKeyPairPayloadGetUpdate // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) GetUpdatedAtOk() (ret CreateKeyPairPayloadGetUpdatedAtRetType, ok bool) { return getCreateKeyPairPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateKeyPairPayload) SetUpdatedAt(v CreateKeyPairPayloadGetUpdatedAtRetType) { setCreateKeyPairPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateKeyPairPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateKeyPairPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -333,37 +401,45 @@ func (o CreateKeyPairPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateKeyPairPayload struct { value *CreateKeyPairPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateKeyPairPayload) Get() *CreateKeyPairPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateKeyPairPayload) Set(val *CreateKeyPairPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateKeyPairPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateKeyPairPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateKeyPairPayload(val *CreateKeyPairPayload) *NullableCreateKeyPairPayload { return &NullableCreateKeyPairPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateKeyPairPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateKeyPairPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_area_payload.go b/services/iaas/model_create_network_area_payload.go index 8c39dff05..35bb9473d 100644 --- a/services/iaas/model_create_network_area_payload.go +++ b/services/iaas/model_create_network_area_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateNetworkAreaPayload{} */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(arg CreateNetworkAreaPayloadGetLabelsAttributeType) (ret CreateNetworkAreaPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(arg CreateNetworkAreaPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkAreaPayloadGetLabelsAttributeType(arg *CreateNetworkAreaPayloadGetLabelsAttributeType, val CreateNetworkAreaPayloadGetLabelsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setCreateNetworkAreaPayloadGetLabelsAttributeType(arg *CreateNetworkAreaPay */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkAreaPayloadGetNameAttributeTypeOk(arg CreateNetworkAreaPayloadGetNameAttributeType) (ret CreateNetworkAreaPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -51,27 +61,34 @@ func getCreateNetworkAreaPayloadGetNameAttributeTypeOk(arg CreateNetworkAreaPayl return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkAreaPayloadGetNameAttributeType(arg *CreateNetworkAreaPayloadGetNameAttributeType, val CreateNetworkAreaPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaPayloadGetNameRetType = string // CreateNetworkAreaPayload Object that represents the network area create request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaPayload struct { - // 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. + // 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. Labels CreateNetworkAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED Name CreateNetworkAreaPayloadGetNameAttributeType `json:"name" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateNetworkAreaPayload CreateNetworkAreaPayload // NewCreateNetworkAreaPayload instantiates a new CreateNetworkAreaPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkAreaPayload(name CreateNetworkAreaPayloadGetNameArgType) *CreateNetworkAreaPayload { this := CreateNetworkAreaPayload{} setCreateNetworkAreaPayloadGetNameAttributeType(&this.Name, name) @@ -81,12 +98,14 @@ func NewCreateNetworkAreaPayload(name CreateNetworkAreaPayloadGetNameArgType) *C // NewCreateNetworkAreaPayloadWithDefaults instantiates a new CreateNetworkAreaPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkAreaPayloadWithDefaults() *CreateNetworkAreaPayload { this := CreateNetworkAreaPayload{} return &this } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaPayload) GetLabels() (res CreateNetworkAreaPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -94,22 +113,26 @@ func (o *CreateNetworkAreaPayload) GetLabels() (res CreateNetworkAreaPayloadGetL // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaPayload) GetLabelsOk() (ret CreateNetworkAreaPayloadGetLabelsRetType, ok bool) { return getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaPayload) SetLabels(v CreateNetworkAreaPayloadGetLabelsRetType) { setCreateNetworkAreaPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaPayload) GetName() (ret CreateNetworkAreaPayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -117,15 +140,18 @@ func (o *CreateNetworkAreaPayload) GetName() (ret CreateNetworkAreaPayloadGetNam // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaPayload) GetNameOk() (ret CreateNetworkAreaPayloadGetNameRetType, ok bool) { return getCreateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaPayload) SetName(v CreateNetworkAreaPayloadGetNameRetType) { setCreateNetworkAreaPayloadGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { @@ -137,37 +163,45 @@ func (o CreateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkAreaPayload struct { value *CreateNetworkAreaPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaPayload) Get() *CreateNetworkAreaPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaPayload) Set(val *CreateNetworkAreaPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkAreaPayload(val *CreateNetworkAreaPayload) *NullableCreateNetworkAreaPayload { return &NullableCreateNetworkAreaPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_area_range_payload.go b/services/iaas/model_create_network_area_range_payload.go index 9342db4ec..61a04e1d1 100644 --- a/services/iaas/model_create_network_area_range_payload.go +++ b/services/iaas/model_create_network_area_range_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateNetworkAreaRangePayload{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRangePayloadGetIpv4AttributeType = *[]NetworkRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRangePayloadGetIpv4ArgType = []NetworkRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRangePayloadGetIpv4RetType = []NetworkRange +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(arg CreateNetworkAreaRangePayloadGetIpv4AttributeType) (ret CreateNetworkAreaRangePayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(arg CreateNetworkAre return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkAreaRangePayloadGetIpv4AttributeType(arg *CreateNetworkAreaRangePayloadGetIpv4AttributeType, val CreateNetworkAreaRangePayloadGetIpv4RetType) { *arg = &val } // CreateNetworkAreaRangePayload struct for CreateNetworkAreaRangePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRangePayload struct { // A list of network ranges. Ipv4 CreateNetworkAreaRangePayloadGetIpv4AttributeType `json:"ipv4,omitempty"` @@ -47,6 +56,7 @@ type CreateNetworkAreaRangePayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkAreaRangePayload() *CreateNetworkAreaRangePayload { this := CreateNetworkAreaRangePayload{} return &this @@ -55,12 +65,14 @@ func NewCreateNetworkAreaRangePayload() *CreateNetworkAreaRangePayload { // NewCreateNetworkAreaRangePayloadWithDefaults instantiates a new CreateNetworkAreaRangePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkAreaRangePayloadWithDefaults() *CreateNetworkAreaRangePayload { this := CreateNetworkAreaRangePayload{} return &this } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRangePayload) GetIpv4() (res CreateNetworkAreaRangePayloadGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -68,21 +80,25 @@ func (o *CreateNetworkAreaRangePayload) GetIpv4() (res CreateNetworkAreaRangePay // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRangePayload) GetIpv4Ok() (ret CreateNetworkAreaRangePayloadGetIpv4RetType, ok bool) { return getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRangePayload) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given []NetworkRange and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRangePayload) SetIpv4(v CreateNetworkAreaRangePayloadGetIpv4RetType) { setCreateNetworkAreaRangePayloadGetIpv4AttributeType(&o.Ipv4, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkAreaRangePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkAreaRangePayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { @@ -91,37 +107,45 @@ func (o CreateNetworkAreaRangePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkAreaRangePayload struct { value *CreateNetworkAreaRangePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRangePayload) Get() *CreateNetworkAreaRangePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRangePayload) Set(val *CreateNetworkAreaRangePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRangePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRangePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkAreaRangePayload(val *CreateNetworkAreaRangePayload) *NullableCreateNetworkAreaRangePayload { return &NullableCreateNetworkAreaRangePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRangePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_area_region_payload.go b/services/iaas/model_create_network_area_region_payload.go index 33bb3d22b..031037b75 100644 --- a/services/iaas/model_create_network_area_region_payload.go +++ b/services/iaas/model_create_network_area_region_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateNetworkAreaRegionPayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRegionPayloadGetIpv4AttributeType = *RegionalAreaIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRegionPayloadGetIpv4ArgType = RegionalAreaIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRegionPayloadGetIpv4RetType = RegionalAreaIPv4 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(arg CreateNetworkAreaRegionPayloadGetIpv4AttributeType) (ret CreateNetworkAreaRegionPayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(arg CreateNetworkAr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkAreaRegionPayloadGetIpv4AttributeType(arg *CreateNetworkAreaRegionPayloadGetIpv4AttributeType, val CreateNetworkAreaRegionPayloadGetIpv4RetType) { *arg = &val } @@ -42,8 +50,10 @@ func setCreateNetworkAreaRegionPayloadGetIpv4AttributeType(arg *CreateNetworkAre */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRegionPayloadGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkAreaRegionPayloadGetStatusAttributeTypeOk(arg CreateNetworkAreaRegionPayloadGetStatusAttributeType) (ret CreateNetworkAreaRegionPayloadGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getCreateNetworkAreaRegionPayloadGetStatusAttributeTypeOk(arg CreateNetwork return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkAreaRegionPayloadGetStatusAttributeType(arg *CreateNetworkAreaRegionPayloadGetStatusAttributeType, val CreateNetworkAreaRegionPayloadGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRegionPayloadGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRegionPayloadGetStatusRetType = string // CreateNetworkAreaRegionPayload The basic properties of a regional network area. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRegionPayload struct { Ipv4 CreateNetworkAreaRegionPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. @@ -69,6 +84,7 @@ type CreateNetworkAreaRegionPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkAreaRegionPayload() *CreateNetworkAreaRegionPayload { this := CreateNetworkAreaRegionPayload{} return &this @@ -77,12 +93,14 @@ func NewCreateNetworkAreaRegionPayload() *CreateNetworkAreaRegionPayload { // NewCreateNetworkAreaRegionPayloadWithDefaults instantiates a new CreateNetworkAreaRegionPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkAreaRegionPayloadWithDefaults() *CreateNetworkAreaRegionPayload { this := CreateNetworkAreaRegionPayload{} return &this } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRegionPayload) GetIpv4() (res CreateNetworkAreaRegionPayloadGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -90,22 +108,26 @@ func (o *CreateNetworkAreaRegionPayload) GetIpv4() (res CreateNetworkAreaRegionP // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRegionPayload) GetIpv4Ok() (ret CreateNetworkAreaRegionPayloadGetIpv4RetType, ok bool) { return getCreateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRegionPayload) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given RegionalAreaIPv4 and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRegionPayload) SetIpv4(v CreateNetworkAreaRegionPayloadGetIpv4RetType) { setCreateNetworkAreaRegionPayloadGetIpv4AttributeType(&o.Ipv4, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRegionPayload) GetStatus() (res CreateNetworkAreaRegionPayloadGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -113,21 +135,25 @@ func (o *CreateNetworkAreaRegionPayload) GetStatus() (res CreateNetworkAreaRegio // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRegionPayload) GetStatusOk() (ret CreateNetworkAreaRegionPayloadGetStatusRetType, ok bool) { return getCreateNetworkAreaRegionPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRegionPayload) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRegionPayload) SetStatus(v CreateNetworkAreaRegionPayloadGetStatusRetType) { setCreateNetworkAreaRegionPayloadGetStatusAttributeType(&o.Status, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { @@ -139,37 +165,45 @@ func (o CreateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkAreaRegionPayload struct { value *CreateNetworkAreaRegionPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRegionPayload) Get() *CreateNetworkAreaRegionPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRegionPayload) Set(val *CreateNetworkAreaRegionPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRegionPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRegionPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkAreaRegionPayload(val *CreateNetworkAreaRegionPayload) *NullableCreateNetworkAreaRegionPayload { return &NullableCreateNetworkAreaRegionPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRegionPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_area_route_payload.go b/services/iaas/model_create_network_area_route_payload.go index d5333dab8..0442634f8 100644 --- a/services/iaas/model_create_network_area_route_payload.go +++ b/services/iaas/model_create_network_area_route_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateNetworkAreaRoutePayload{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRoutePayloadGetItemsAttributeType = *[]Route + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRoutePayloadGetItemsArgType = []Route + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRoutePayloadGetItemsRetType = []Route +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkAreaRoutePayloadGetItemsAttributeTypeOk(arg CreateNetworkAreaRoutePayloadGetItemsAttributeType) (ret CreateNetworkAreaRoutePayloadGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getCreateNetworkAreaRoutePayloadGetItemsAttributeTypeOk(arg CreateNetworkAr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkAreaRoutePayloadGetItemsAttributeType(arg *CreateNetworkAreaRoutePayloadGetItemsAttributeType, val CreateNetworkAreaRoutePayloadGetItemsRetType) { *arg = &val } // CreateNetworkAreaRoutePayload Object represents a request to add network routes. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkAreaRoutePayload struct { // A list of routes. // REQUIRED Items CreateNetworkAreaRoutePayloadGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateNetworkAreaRoutePayload CreateNetworkAreaRoutePayload // NewCreateNetworkAreaRoutePayload instantiates a new CreateNetworkAreaRoutePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkAreaRoutePayload(items CreateNetworkAreaRoutePayloadGetItemsArgType) *CreateNetworkAreaRoutePayload { this := CreateNetworkAreaRoutePayload{} setCreateNetworkAreaRoutePayloadGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewCreateNetworkAreaRoutePayload(items CreateNetworkAreaRoutePayloadGetItem // NewCreateNetworkAreaRoutePayloadWithDefaults instantiates a new CreateNetworkAreaRoutePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkAreaRoutePayloadWithDefaults() *CreateNetworkAreaRoutePayload { this := CreateNetworkAreaRoutePayload{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRoutePayload) GetItems() (ret CreateNetworkAreaRoutePayloadGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *CreateNetworkAreaRoutePayload) GetItems() (ret CreateNetworkAreaRoutePa // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRoutePayload) GetItemsOk() (ret CreateNetworkAreaRoutePayloadGetItemsRetType, ok bool) { return getCreateNetworkAreaRoutePayloadGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkAreaRoutePayload) SetItems(v CreateNetworkAreaRoutePayloadGetItemsRetType) { setCreateNetworkAreaRoutePayloadGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkAreaRoutePayloadGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkAreaRoutePayload struct { value *CreateNetworkAreaRoutePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRoutePayload) Get() *CreateNetworkAreaRoutePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRoutePayload) Set(val *CreateNetworkAreaRoutePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRoutePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRoutePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkAreaRoutePayload(val *CreateNetworkAreaRoutePayload) *NullableCreateNetworkAreaRoutePayload { return &NullableCreateNetworkAreaRoutePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_ipv4.go b/services/iaas/model_create_network_ipv4.go index a7bbd85c9..2e62fd4ac 100644 --- a/services/iaas/model_create_network_ipv4.go +++ b/services/iaas/model_create_network_ipv4.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -16,12 +17,14 @@ import ( ) // CreateNetworkIPv4 - The create request for an IPv4 network. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4 struct { CreateNetworkIPv4WithPrefix *CreateNetworkIPv4WithPrefix CreateNetworkIPv4WithPrefixLength *CreateNetworkIPv4WithPrefixLength } // CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefix wrapped in CreateNetworkIPv4 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefix) CreateNetworkIPv4 { return CreateNetworkIPv4{ CreateNetworkIPv4WithPrefix: v, @@ -29,6 +32,7 @@ func CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPref } // CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefixLength wrapped in CreateNetworkIPv4 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefixLength) CreateNetworkIPv4 { return CreateNetworkIPv4{ CreateNetworkIPv4WithPrefixLength: v, @@ -36,6 +40,7 @@ func CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4(v *CreateNetworkIPv4Wi } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *CreateNetworkIPv4) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -79,6 +84,7 @@ func (dst *CreateNetworkIPv4) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src CreateNetworkIPv4) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.CreateNetworkIPv4WithPrefix != nil { return json.Marshal(&src.CreateNetworkIPv4WithPrefix) } @@ -91,6 +97,7 @@ func (src CreateNetworkIPv4) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *CreateNetworkIPv4) GetActualInstance() interface{} { if obj == nil { return nil @@ -107,37 +114,45 @@ func (obj *CreateNetworkIPv4) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkIPv4 struct { value *CreateNetworkIPv4 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4) Get() *CreateNetworkIPv4 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4) Set(val *CreateNetworkIPv4) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkIPv4(val *CreateNetworkIPv4) *NullableCreateNetworkIPv4 { return &NullableCreateNetworkIPv4{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_ipv4_with_prefix.go b/services/iaas/model_create_network_ipv4_with_prefix.go index d7ef2a2f5..1e1161332 100644 --- a/services/iaas/model_create_network_ipv4_with_prefix.go +++ b/services/iaas/model_create_network_ipv4_with_prefix.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateNetworkIPv4WithPrefix{} */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetGatewayAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv4WithPrefixGetGatewayAttributeTypeOk(arg CreateNetworkIPv4WithPrefixGetGatewayAttributeType) (ret CreateNetworkIPv4WithPrefixGetGatewayRetType, ok bool) { if arg == nil { return nil, false @@ -31,6 +34,7 @@ func getCreateNetworkIPv4WithPrefixGetGatewayAttributeTypeOk(arg CreateNetworkIP return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv4WithPrefixGetGatewayAttributeType(arg *CreateNetworkIPv4WithPrefixGetGatewayAttributeType, val CreateNetworkIPv4WithPrefixGetGatewayRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -39,7 +43,10 @@ func setCreateNetworkIPv4WithPrefixGetGatewayAttributeType(arg *CreateNetworkIPv } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetGatewayArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetGatewayRetType = *string /* @@ -47,10 +54,16 @@ type CreateNetworkIPv4WithPrefixGetGatewayRetType = *string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv4WithPrefixGetNameserversAttributeTypeOk(arg CreateNetworkIPv4WithPrefixGetNameserversAttributeType) (ret CreateNetworkIPv4WithPrefixGetNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -58,6 +71,7 @@ func getCreateNetworkIPv4WithPrefixGetNameserversAttributeTypeOk(arg CreateNetwo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv4WithPrefixGetNameserversAttributeType(arg *CreateNetworkIPv4WithPrefixGetNameserversAttributeType, val CreateNetworkIPv4WithPrefixGetNameserversRetType) { *arg = &val } @@ -67,8 +81,10 @@ func setCreateNetworkIPv4WithPrefixGetNameserversAttributeType(arg *CreateNetwor */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetPrefixAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv4WithPrefixGetPrefixAttributeTypeOk(arg CreateNetworkIPv4WithPrefixGetPrefixAttributeType) (ret CreateNetworkIPv4WithPrefixGetPrefixRetType, ok bool) { if arg == nil { return ret, false @@ -76,14 +92,19 @@ func getCreateNetworkIPv4WithPrefixGetPrefixAttributeTypeOk(arg CreateNetworkIPv return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv4WithPrefixGetPrefixAttributeType(arg *CreateNetworkIPv4WithPrefixGetPrefixAttributeType, val CreateNetworkIPv4WithPrefixGetPrefixRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetPrefixArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixGetPrefixRetType = string // CreateNetworkIPv4WithPrefix The create request for an IPv4 network with a specified prefix. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefix struct { // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway CreateNetworkIPv4WithPrefixGetGatewayAttributeType `json:"gateway,omitempty"` @@ -94,12 +115,14 @@ type CreateNetworkIPv4WithPrefix struct { Prefix CreateNetworkIPv4WithPrefixGetPrefixAttributeType `json:"prefix" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateNetworkIPv4WithPrefix CreateNetworkIPv4WithPrefix // NewCreateNetworkIPv4WithPrefix instantiates a new CreateNetworkIPv4WithPrefix object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkIPv4WithPrefix(prefix CreateNetworkIPv4WithPrefixGetPrefixArgType) *CreateNetworkIPv4WithPrefix { this := CreateNetworkIPv4WithPrefix{} setCreateNetworkIPv4WithPrefixGetPrefixAttributeType(&this.Prefix, prefix) @@ -109,12 +132,14 @@ func NewCreateNetworkIPv4WithPrefix(prefix CreateNetworkIPv4WithPrefixGetPrefixA // NewCreateNetworkIPv4WithPrefixWithDefaults instantiates a new CreateNetworkIPv4WithPrefix object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkIPv4WithPrefixWithDefaults() *CreateNetworkIPv4WithPrefix { this := CreateNetworkIPv4WithPrefix{} return &this } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) GetGateway() (res CreateNetworkIPv4WithPrefixGetGatewayRetType) { res, _ = o.GetGatewayOk() return @@ -123,32 +148,38 @@ func (o *CreateNetworkIPv4WithPrefix) GetGateway() (res CreateNetworkIPv4WithPre // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) GetGatewayOk() (ret CreateNetworkIPv4WithPrefixGetGatewayRetType, ok bool) { return getCreateNetworkIPv4WithPrefixGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) HasGateway() bool { _, ok := o.GetGatewayOk() return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) SetGateway(v CreateNetworkIPv4WithPrefixGetGatewayRetType) { setCreateNetworkIPv4WithPrefixGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) SetGatewayNil() { o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) UnsetGateway() { o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) GetNameservers() (res CreateNetworkIPv4WithPrefixGetNameserversRetType) { res, _ = o.GetNameserversOk() return @@ -156,22 +187,26 @@ func (o *CreateNetworkIPv4WithPrefix) GetNameservers() (res CreateNetworkIPv4Wit // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) GetNameserversOk() (ret CreateNetworkIPv4WithPrefixGetNameserversRetType, ok bool) { return getCreateNetworkIPv4WithPrefixGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) SetNameservers(v CreateNetworkIPv4WithPrefixGetNameserversRetType) { setCreateNetworkIPv4WithPrefixGetNameserversAttributeType(&o.Nameservers, v) } // GetPrefix returns the Prefix field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) GetPrefix() (ret CreateNetworkIPv4WithPrefixGetPrefixRetType) { ret, _ = o.GetPrefixOk() return ret @@ -179,15 +214,18 @@ func (o *CreateNetworkIPv4WithPrefix) GetPrefix() (ret CreateNetworkIPv4WithPref // GetPrefixOk returns a tuple with the Prefix field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) GetPrefixOk() (ret CreateNetworkIPv4WithPrefixGetPrefixRetType, ok bool) { return getCreateNetworkIPv4WithPrefixGetPrefixAttributeTypeOk(o.Prefix) } // SetPrefix sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefix) SetPrefix(v CreateNetworkIPv4WithPrefixGetPrefixRetType) { setCreateNetworkIPv4WithPrefixGetPrefixAttributeType(&o.Prefix, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkIPv4WithPrefix) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkIPv4WithPrefixGetGatewayAttributeTypeOk(o.Gateway); ok { @@ -202,37 +240,45 @@ func (o CreateNetworkIPv4WithPrefix) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkIPv4WithPrefix struct { value *CreateNetworkIPv4WithPrefix isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4WithPrefix) Get() *CreateNetworkIPv4WithPrefix { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4WithPrefix) Set(val *CreateNetworkIPv4WithPrefix) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4WithPrefix) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4WithPrefix) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkIPv4WithPrefix(val *CreateNetworkIPv4WithPrefix) *NullableCreateNetworkIPv4WithPrefix { return &NullableCreateNetworkIPv4WithPrefix{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4WithPrefix) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_ipv4_with_prefix_length.go b/services/iaas/model_create_network_ipv4_with_prefix_length.go index d93475fb4..01f7a77ca 100644 --- a/services/iaas/model_create_network_ipv4_with_prefix_length.go +++ b/services/iaas/model_create_network_ipv4_with_prefix_length.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateNetworkIPv4WithPrefixLength{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixLengthGetNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixLengthGetNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeTypeOk(arg CreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType) (ret CreateNetworkIPv4WithPrefixLengthGetNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeTypeOk(arg Creat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType(arg *CreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType, val CreateNetworkIPv4WithPrefixLengthGetNameserversRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType(arg *Create */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixLengthGetPrefixLengthArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeTypeOk(arg CreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType) (ret CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeTypeOk(arg Crea return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType(arg *CreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType, val CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType) { *arg = &val } // CreateNetworkIPv4WithPrefixLength The create request for an IPv4 network with a wanted prefix length. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv4WithPrefixLength struct { // A list containing DNS Servers/Nameservers for IPv4. Nameservers CreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType `json:"nameservers,omitempty"` @@ -65,12 +81,14 @@ type CreateNetworkIPv4WithPrefixLength struct { PrefixLength CreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType `json:"prefixLength" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateNetworkIPv4WithPrefixLength CreateNetworkIPv4WithPrefixLength // NewCreateNetworkIPv4WithPrefixLength instantiates a new CreateNetworkIPv4WithPrefixLength object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkIPv4WithPrefixLength(prefixLength CreateNetworkIPv4WithPrefixLengthGetPrefixLengthArgType) *CreateNetworkIPv4WithPrefixLength { this := CreateNetworkIPv4WithPrefixLength{} setCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType(&this.PrefixLength, prefixLength) @@ -80,12 +98,14 @@ func NewCreateNetworkIPv4WithPrefixLength(prefixLength CreateNetworkIPv4WithPref // NewCreateNetworkIPv4WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv4WithPrefixLength object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkIPv4WithPrefixLengthWithDefaults() *CreateNetworkIPv4WithPrefixLength { this := CreateNetworkIPv4WithPrefixLength{} return &this } // GetNameservers returns the Nameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefixLength) GetNameservers() (res CreateNetworkIPv4WithPrefixLengthGetNameserversRetType) { res, _ = o.GetNameserversOk() return @@ -93,22 +113,26 @@ func (o *CreateNetworkIPv4WithPrefixLength) GetNameservers() (res CreateNetworkI // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefixLength) GetNameserversOk() (ret CreateNetworkIPv4WithPrefixLengthGetNameserversRetType, ok bool) { return getCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefixLength) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefixLength) SetNameservers(v CreateNetworkIPv4WithPrefixLengthGetNameserversRetType) { setCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeType(&o.Nameservers, v) } // GetPrefixLength returns the PrefixLength field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLength() (ret CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType) { ret, _ = o.GetPrefixLengthOk() return ret @@ -116,15 +140,18 @@ func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLength() (ret CreateNetwork // GetPrefixLengthOk returns a tuple with the PrefixLength field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLengthOk() (ret CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType, ok bool) { return getCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeTypeOk(o.PrefixLength) } // SetPrefixLength sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv4WithPrefixLength) SetPrefixLength(v CreateNetworkIPv4WithPrefixLengthGetPrefixLengthRetType) { setCreateNetworkIPv4WithPrefixLengthGetPrefixLengthAttributeType(&o.PrefixLength, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkIPv4WithPrefixLength) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkIPv4WithPrefixLengthGetNameserversAttributeTypeOk(o.Nameservers); ok { @@ -136,37 +163,45 @@ func (o CreateNetworkIPv4WithPrefixLength) ToMap() (map[string]interface{}, erro return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkIPv4WithPrefixLength struct { value *CreateNetworkIPv4WithPrefixLength isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4WithPrefixLength) Get() *CreateNetworkIPv4WithPrefixLength { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4WithPrefixLength) Set(val *CreateNetworkIPv4WithPrefixLength) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4WithPrefixLength) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4WithPrefixLength) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkIPv4WithPrefixLength(val *CreateNetworkIPv4WithPrefixLength) *NullableCreateNetworkIPv4WithPrefixLength { return &NullableCreateNetworkIPv4WithPrefixLength{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv4WithPrefixLength) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_ipv6.go b/services/iaas/model_create_network_ipv6.go index 4b81c0da0..3caf063be 100644 --- a/services/iaas/model_create_network_ipv6.go +++ b/services/iaas/model_create_network_ipv6.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -16,12 +17,14 @@ import ( ) // CreateNetworkIPv6 - The create request for an IPv6 network. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6 struct { CreateNetworkIPv6WithPrefix *CreateNetworkIPv6WithPrefix CreateNetworkIPv6WithPrefixLength *CreateNetworkIPv6WithPrefixLength } // CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefix wrapped in CreateNetworkIPv6 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefix) CreateNetworkIPv6 { return CreateNetworkIPv6{ CreateNetworkIPv6WithPrefix: v, @@ -29,6 +32,7 @@ func CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPref } // CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefixLength wrapped in CreateNetworkIPv6 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefixLength) CreateNetworkIPv6 { return CreateNetworkIPv6{ CreateNetworkIPv6WithPrefixLength: v, @@ -36,6 +40,7 @@ func CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6(v *CreateNetworkIPv6Wi } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *CreateNetworkIPv6) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -79,6 +84,7 @@ func (dst *CreateNetworkIPv6) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src CreateNetworkIPv6) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.CreateNetworkIPv6WithPrefix != nil { return json.Marshal(&src.CreateNetworkIPv6WithPrefix) } @@ -91,6 +97,7 @@ func (src CreateNetworkIPv6) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *CreateNetworkIPv6) GetActualInstance() interface{} { if obj == nil { return nil @@ -107,37 +114,45 @@ func (obj *CreateNetworkIPv6) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkIPv6 struct { value *CreateNetworkIPv6 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6) Get() *CreateNetworkIPv6 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6) Set(val *CreateNetworkIPv6) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkIPv6(val *CreateNetworkIPv6) *NullableCreateNetworkIPv6 { return &NullableCreateNetworkIPv6{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_ipv6_with_prefix.go b/services/iaas/model_create_network_ipv6_with_prefix.go index 7a4c37074..92df93ffa 100644 --- a/services/iaas/model_create_network_ipv6_with_prefix.go +++ b/services/iaas/model_create_network_ipv6_with_prefix.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateNetworkIPv6WithPrefix{} */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetGatewayAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv6WithPrefixGetGatewayAttributeTypeOk(arg CreateNetworkIPv6WithPrefixGetGatewayAttributeType) (ret CreateNetworkIPv6WithPrefixGetGatewayRetType, ok bool) { if arg == nil { return nil, false @@ -31,6 +34,7 @@ func getCreateNetworkIPv6WithPrefixGetGatewayAttributeTypeOk(arg CreateNetworkIP return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv6WithPrefixGetGatewayAttributeType(arg *CreateNetworkIPv6WithPrefixGetGatewayAttributeType, val CreateNetworkIPv6WithPrefixGetGatewayRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -39,7 +43,10 @@ func setCreateNetworkIPv6WithPrefixGetGatewayAttributeType(arg *CreateNetworkIPv } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetGatewayArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetGatewayRetType = *string /* @@ -47,10 +54,16 @@ type CreateNetworkIPv6WithPrefixGetGatewayRetType = *string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv6WithPrefixGetNameserversAttributeTypeOk(arg CreateNetworkIPv6WithPrefixGetNameserversAttributeType) (ret CreateNetworkIPv6WithPrefixGetNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -58,6 +71,7 @@ func getCreateNetworkIPv6WithPrefixGetNameserversAttributeTypeOk(arg CreateNetwo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv6WithPrefixGetNameserversAttributeType(arg *CreateNetworkIPv6WithPrefixGetNameserversAttributeType, val CreateNetworkIPv6WithPrefixGetNameserversRetType) { *arg = &val } @@ -67,8 +81,10 @@ func setCreateNetworkIPv6WithPrefixGetNameserversAttributeType(arg *CreateNetwor */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetPrefixAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv6WithPrefixGetPrefixAttributeTypeOk(arg CreateNetworkIPv6WithPrefixGetPrefixAttributeType) (ret CreateNetworkIPv6WithPrefixGetPrefixRetType, ok bool) { if arg == nil { return ret, false @@ -76,14 +92,19 @@ func getCreateNetworkIPv6WithPrefixGetPrefixAttributeTypeOk(arg CreateNetworkIPv return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv6WithPrefixGetPrefixAttributeType(arg *CreateNetworkIPv6WithPrefixGetPrefixAttributeType, val CreateNetworkIPv6WithPrefixGetPrefixRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetPrefixArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixGetPrefixRetType = string // CreateNetworkIPv6WithPrefix The create request for an IPv6 network with a specified prefix. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefix struct { // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway CreateNetworkIPv6WithPrefixGetGatewayAttributeType `json:"gateway,omitempty"` @@ -94,12 +115,14 @@ type CreateNetworkIPv6WithPrefix struct { Prefix CreateNetworkIPv6WithPrefixGetPrefixAttributeType `json:"prefix" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateNetworkIPv6WithPrefix CreateNetworkIPv6WithPrefix // NewCreateNetworkIPv6WithPrefix instantiates a new CreateNetworkIPv6WithPrefix object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkIPv6WithPrefix(prefix CreateNetworkIPv6WithPrefixGetPrefixArgType) *CreateNetworkIPv6WithPrefix { this := CreateNetworkIPv6WithPrefix{} setCreateNetworkIPv6WithPrefixGetPrefixAttributeType(&this.Prefix, prefix) @@ -109,12 +132,14 @@ func NewCreateNetworkIPv6WithPrefix(prefix CreateNetworkIPv6WithPrefixGetPrefixA // NewCreateNetworkIPv6WithPrefixWithDefaults instantiates a new CreateNetworkIPv6WithPrefix object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkIPv6WithPrefixWithDefaults() *CreateNetworkIPv6WithPrefix { this := CreateNetworkIPv6WithPrefix{} return &this } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) GetGateway() (res CreateNetworkIPv6WithPrefixGetGatewayRetType) { res, _ = o.GetGatewayOk() return @@ -123,32 +148,38 @@ func (o *CreateNetworkIPv6WithPrefix) GetGateway() (res CreateNetworkIPv6WithPre // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) GetGatewayOk() (ret CreateNetworkIPv6WithPrefixGetGatewayRetType, ok bool) { return getCreateNetworkIPv6WithPrefixGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) HasGateway() bool { _, ok := o.GetGatewayOk() return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) SetGateway(v CreateNetworkIPv6WithPrefixGetGatewayRetType) { setCreateNetworkIPv6WithPrefixGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) SetGatewayNil() { o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) UnsetGateway() { o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) GetNameservers() (res CreateNetworkIPv6WithPrefixGetNameserversRetType) { res, _ = o.GetNameserversOk() return @@ -156,22 +187,26 @@ func (o *CreateNetworkIPv6WithPrefix) GetNameservers() (res CreateNetworkIPv6Wit // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) GetNameserversOk() (ret CreateNetworkIPv6WithPrefixGetNameserversRetType, ok bool) { return getCreateNetworkIPv6WithPrefixGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) SetNameservers(v CreateNetworkIPv6WithPrefixGetNameserversRetType) { setCreateNetworkIPv6WithPrefixGetNameserversAttributeType(&o.Nameservers, v) } // GetPrefix returns the Prefix field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) GetPrefix() (ret CreateNetworkIPv6WithPrefixGetPrefixRetType) { ret, _ = o.GetPrefixOk() return ret @@ -179,15 +214,18 @@ func (o *CreateNetworkIPv6WithPrefix) GetPrefix() (ret CreateNetworkIPv6WithPref // GetPrefixOk returns a tuple with the Prefix field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) GetPrefixOk() (ret CreateNetworkIPv6WithPrefixGetPrefixRetType, ok bool) { return getCreateNetworkIPv6WithPrefixGetPrefixAttributeTypeOk(o.Prefix) } // SetPrefix sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefix) SetPrefix(v CreateNetworkIPv6WithPrefixGetPrefixRetType) { setCreateNetworkIPv6WithPrefixGetPrefixAttributeType(&o.Prefix, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkIPv6WithPrefix) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkIPv6WithPrefixGetGatewayAttributeTypeOk(o.Gateway); ok { @@ -202,37 +240,45 @@ func (o CreateNetworkIPv6WithPrefix) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkIPv6WithPrefix struct { value *CreateNetworkIPv6WithPrefix isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6WithPrefix) Get() *CreateNetworkIPv6WithPrefix { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6WithPrefix) Set(val *CreateNetworkIPv6WithPrefix) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6WithPrefix) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6WithPrefix) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkIPv6WithPrefix(val *CreateNetworkIPv6WithPrefix) *NullableCreateNetworkIPv6WithPrefix { return &NullableCreateNetworkIPv6WithPrefix{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6WithPrefix) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_ipv6_with_prefix_length.go b/services/iaas/model_create_network_ipv6_with_prefix_length.go index 1c992be33..9cbfb3842 100644 --- a/services/iaas/model_create_network_ipv6_with_prefix_length.go +++ b/services/iaas/model_create_network_ipv6_with_prefix_length.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateNetworkIPv6WithPrefixLength{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixLengthGetNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixLengthGetNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeTypeOk(arg CreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType) (ret CreateNetworkIPv6WithPrefixLengthGetNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeTypeOk(arg Creat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType(arg *CreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType, val CreateNetworkIPv6WithPrefixLengthGetNameserversRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType(arg *Create */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixLengthGetPrefixLengthArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeTypeOk(arg CreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType) (ret CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeTypeOk(arg Crea return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType(arg *CreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType, val CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType) { *arg = &val } // CreateNetworkIPv6WithPrefixLength The create request for an IPv6 network with a wanted prefix length. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkIPv6WithPrefixLength struct { // A list containing DNS Servers/Nameservers for IPv6. Nameservers CreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType `json:"nameservers,omitempty"` @@ -65,12 +81,14 @@ type CreateNetworkIPv6WithPrefixLength struct { PrefixLength CreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType `json:"prefixLength" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateNetworkIPv6WithPrefixLength CreateNetworkIPv6WithPrefixLength // NewCreateNetworkIPv6WithPrefixLength instantiates a new CreateNetworkIPv6WithPrefixLength object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkIPv6WithPrefixLength(prefixLength CreateNetworkIPv6WithPrefixLengthGetPrefixLengthArgType) *CreateNetworkIPv6WithPrefixLength { this := CreateNetworkIPv6WithPrefixLength{} setCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType(&this.PrefixLength, prefixLength) @@ -80,12 +98,14 @@ func NewCreateNetworkIPv6WithPrefixLength(prefixLength CreateNetworkIPv6WithPref // NewCreateNetworkIPv6WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv6WithPrefixLength object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkIPv6WithPrefixLengthWithDefaults() *CreateNetworkIPv6WithPrefixLength { this := CreateNetworkIPv6WithPrefixLength{} return &this } // GetNameservers returns the Nameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefixLength) GetNameservers() (res CreateNetworkIPv6WithPrefixLengthGetNameserversRetType) { res, _ = o.GetNameserversOk() return @@ -93,22 +113,26 @@ func (o *CreateNetworkIPv6WithPrefixLength) GetNameservers() (res CreateNetworkI // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefixLength) GetNameserversOk() (ret CreateNetworkIPv6WithPrefixLengthGetNameserversRetType, ok bool) { return getCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefixLength) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefixLength) SetNameservers(v CreateNetworkIPv6WithPrefixLengthGetNameserversRetType) { setCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeType(&o.Nameservers, v) } // GetPrefixLength returns the PrefixLength field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLength() (ret CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType) { ret, _ = o.GetPrefixLengthOk() return ret @@ -116,15 +140,18 @@ func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLength() (ret CreateNetwork // GetPrefixLengthOk returns a tuple with the PrefixLength field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLengthOk() (ret CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType, ok bool) { return getCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeTypeOk(o.PrefixLength) } // SetPrefixLength sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkIPv6WithPrefixLength) SetPrefixLength(v CreateNetworkIPv6WithPrefixLengthGetPrefixLengthRetType) { setCreateNetworkIPv6WithPrefixLengthGetPrefixLengthAttributeType(&o.PrefixLength, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkIPv6WithPrefixLength) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkIPv6WithPrefixLengthGetNameserversAttributeTypeOk(o.Nameservers); ok { @@ -136,37 +163,45 @@ func (o CreateNetworkIPv6WithPrefixLength) ToMap() (map[string]interface{}, erro return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkIPv6WithPrefixLength struct { value *CreateNetworkIPv6WithPrefixLength isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6WithPrefixLength) Get() *CreateNetworkIPv6WithPrefixLength { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6WithPrefixLength) Set(val *CreateNetworkIPv6WithPrefixLength) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6WithPrefixLength) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6WithPrefixLength) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkIPv6WithPrefixLength(val *CreateNetworkIPv6WithPrefixLength) *NullableCreateNetworkIPv6WithPrefixLength { return &NullableCreateNetworkIPv6WithPrefixLength{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkIPv6WithPrefixLength) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_network_payload.go b/services/iaas/model_create_network_payload.go index caf7ec2c4..8e973baa8 100644 --- a/services/iaas/model_create_network_payload.go +++ b/services/iaas/model_create_network_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateNetworkPayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadgetDhcpAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadgetDhcpArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadgetDhcpRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkPayloadgetDhcpAttributeTypeOk(arg CreateNetworkPayloadgetDhcpAttributeType) (ret CreateNetworkPayloadgetDhcpRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateNetworkPayloadgetDhcpAttributeTypeOk(arg CreateNetworkPayloadgetDh return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkPayloadgetDhcpAttributeType(arg *CreateNetworkPayloadgetDhcpAttributeType, val CreateNetworkPayloadgetDhcpRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setCreateNetworkPayloadgetDhcpAttributeType(arg *CreateNetworkPayloadgetDhc */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetIpv4AttributeType = *CreateNetworkIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetIpv4ArgType = CreateNetworkIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetIpv4RetType = CreateNetworkIPv4 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkPayloadGetIpv4AttributeTypeOk(arg CreateNetworkPayloadGetIpv4AttributeType) (ret CreateNetworkPayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getCreateNetworkPayloadGetIpv4AttributeTypeOk(arg CreateNetworkPayloadGetIp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkPayloadGetIpv4AttributeType(arg *CreateNetworkPayloadGetIpv4AttributeType, val CreateNetworkPayloadGetIpv4RetType) { *arg = &val } @@ -62,10 +77,16 @@ func setCreateNetworkPayloadGetIpv4AttributeType(arg *CreateNetworkPayloadGetIpv */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetIpv6AttributeType = *CreateNetworkIPv6 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetIpv6ArgType = CreateNetworkIPv6 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetIpv6RetType = CreateNetworkIPv6 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkPayloadGetIpv6AttributeTypeOk(arg CreateNetworkPayloadGetIpv6AttributeType) (ret CreateNetworkPayloadGetIpv6RetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getCreateNetworkPayloadGetIpv6AttributeTypeOk(arg CreateNetworkPayloadGetIp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkPayloadGetIpv6AttributeType(arg *CreateNetworkPayloadGetIpv6AttributeType, val CreateNetworkPayloadGetIpv6RetType) { *arg = &val } @@ -82,10 +104,16 @@ func setCreateNetworkPayloadGetIpv6AttributeType(arg *CreateNetworkPayloadGetIpv */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkPayloadGetLabelsAttributeTypeOk(arg CreateNetworkPayloadGetLabelsAttributeType) (ret CreateNetworkPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -93,6 +121,7 @@ func getCreateNetworkPayloadGetLabelsAttributeTypeOk(arg CreateNetworkPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkPayloadGetLabelsAttributeType(arg *CreateNetworkPayloadGetLabelsAttributeType, val CreateNetworkPayloadGetLabelsRetType) { *arg = &val } @@ -102,8 +131,10 @@ func setCreateNetworkPayloadGetLabelsAttributeType(arg *CreateNetworkPayloadGetL */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkPayloadGetNameAttributeTypeOk(arg CreateNetworkPayloadGetNameAttributeType) (ret CreateNetworkPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -111,11 +142,15 @@ func getCreateNetworkPayloadGetNameAttributeTypeOk(arg CreateNetworkPayloadGetNa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkPayloadGetNameAttributeType(arg *CreateNetworkPayloadGetNameAttributeType, val CreateNetworkPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetNameRetType = string /* @@ -123,10 +158,16 @@ type CreateNetworkPayloadGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadgetRoutedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadgetRoutedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadgetRoutedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkPayloadgetRoutedAttributeTypeOk(arg CreateNetworkPayloadgetRoutedAttributeType) (ret CreateNetworkPayloadgetRoutedRetType, ok bool) { if arg == nil { return ret, false @@ -134,6 +175,7 @@ func getCreateNetworkPayloadgetRoutedAttributeTypeOk(arg CreateNetworkPayloadget return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkPayloadgetRoutedAttributeType(arg *CreateNetworkPayloadgetRoutedAttributeType, val CreateNetworkPayloadgetRoutedRetType) { *arg = &val } @@ -143,8 +185,10 @@ func setCreateNetworkPayloadgetRoutedAttributeType(arg *CreateNetworkPayloadgetR */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetRoutingTableIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(arg CreateNetworkPayloadGetRoutingTableIdAttributeType) (ret CreateNetworkPayloadGetRoutingTableIdRetType, ok bool) { if arg == nil { return ret, false @@ -152,20 +196,25 @@ func getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(arg CreateNetworkPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNetworkPayloadGetRoutingTableIdAttributeType(arg *CreateNetworkPayloadGetRoutingTableIdAttributeType, val CreateNetworkPayloadGetRoutingTableIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetRoutingTableIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayloadGetRoutingTableIdRetType = string // CreateNetworkPayload Object that represents the request body for a network create. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNetworkPayload struct { // Enable or disable DHCP for a network. Dhcp CreateNetworkPayloadgetDhcpAttributeType `json:"dhcp,omitempty"` Ipv4 CreateNetworkPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` Ipv6 CreateNetworkPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` - // 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. + // 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. Labels CreateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED @@ -176,12 +225,14 @@ type CreateNetworkPayload struct { RoutingTableId CreateNetworkPayloadGetRoutingTableIdAttributeType `json:"routingTableId,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateNetworkPayload CreateNetworkPayload // NewCreateNetworkPayload instantiates a new CreateNetworkPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkPayload(name CreateNetworkPayloadGetNameArgType) *CreateNetworkPayload { this := CreateNetworkPayload{} setCreateNetworkPayloadGetNameAttributeType(&this.Name, name) @@ -191,6 +242,7 @@ func NewCreateNetworkPayload(name CreateNetworkPayloadGetNameArgType) *CreateNet // NewCreateNetworkPayloadWithDefaults instantiates a new CreateNetworkPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { this := CreateNetworkPayload{} var dhcp bool = true @@ -199,6 +251,7 @@ func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { } // GetDhcp returns the Dhcp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetDhcp() (res CreateNetworkPayloadgetDhcpRetType) { res, _ = o.GetDhcpOk() return @@ -206,22 +259,26 @@ func (o *CreateNetworkPayload) GetDhcp() (res CreateNetworkPayloadgetDhcpRetType // GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetDhcpOk() (ret CreateNetworkPayloadgetDhcpRetType, ok bool) { return getCreateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp) } // HasDhcp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) HasDhcp() bool { _, ok := o.GetDhcpOk() return ok } // SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) SetDhcp(v CreateNetworkPayloadgetDhcpRetType) { setCreateNetworkPayloadgetDhcpAttributeType(&o.Dhcp, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetIpv4() (res CreateNetworkPayloadGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -229,22 +286,26 @@ func (o *CreateNetworkPayload) GetIpv4() (res CreateNetworkPayloadGetIpv4RetType // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetIpv4Ok() (ret CreateNetworkPayloadGetIpv4RetType, ok bool) { return getCreateNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) SetIpv4(v CreateNetworkPayloadGetIpv4RetType) { setCreateNetworkPayloadGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetIpv6() (res CreateNetworkPayloadGetIpv6RetType) { res, _ = o.GetIpv6Ok() return @@ -252,22 +313,26 @@ func (o *CreateNetworkPayload) GetIpv6() (res CreateNetworkPayloadGetIpv6RetType // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetIpv6Ok() (ret CreateNetworkPayloadGetIpv6RetType, ok bool) { return getCreateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) HasIpv6() bool { _, ok := o.GetIpv6Ok() return ok } // SetIpv6 gets a reference to the given CreateNetworkIPv6 and assigns it to the Ipv6 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) SetIpv6(v CreateNetworkPayloadGetIpv6RetType) { setCreateNetworkPayloadGetIpv6AttributeType(&o.Ipv6, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetLabels() (res CreateNetworkPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -275,22 +340,26 @@ func (o *CreateNetworkPayload) GetLabels() (res CreateNetworkPayloadGetLabelsRet // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetLabelsOk() (ret CreateNetworkPayloadGetLabelsRetType, ok bool) { return getCreateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) SetLabels(v CreateNetworkPayloadGetLabelsRetType) { setCreateNetworkPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetName() (ret CreateNetworkPayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -298,16 +367,19 @@ func (o *CreateNetworkPayload) GetName() (ret CreateNetworkPayloadGetNameRetType // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetNameOk() (ret CreateNetworkPayloadGetNameRetType, ok bool) { return getCreateNetworkPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) SetName(v CreateNetworkPayloadGetNameRetType) { setCreateNetworkPayloadGetNameAttributeType(&o.Name, v) } // GetRouted returns the Routed field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetRouted() (res CreateNetworkPayloadgetRoutedRetType) { res, _ = o.GetRoutedOk() return @@ -315,22 +387,26 @@ func (o *CreateNetworkPayload) GetRouted() (res CreateNetworkPayloadgetRoutedRet // GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetRoutedOk() (ret CreateNetworkPayloadgetRoutedRetType, ok bool) { return getCreateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed) } // HasRouted returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) HasRouted() bool { _, ok := o.GetRoutedOk() return ok } // SetRouted gets a reference to the given bool and assigns it to the Routed field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) SetRouted(v CreateNetworkPayloadgetRoutedRetType) { setCreateNetworkPayloadgetRoutedAttributeType(&o.Routed, v) } // GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetRoutingTableId() (res CreateNetworkPayloadGetRoutingTableIdRetType) { res, _ = o.GetRoutingTableIdOk() return @@ -338,21 +414,25 @@ func (o *CreateNetworkPayload) GetRoutingTableId() (res CreateNetworkPayloadGetR // GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) GetRoutingTableIdOk() (ret CreateNetworkPayloadGetRoutingTableIdRetType, ok bool) { return getCreateNetworkPayloadGetRoutingTableIdAttributeTypeOk(o.RoutingTableId) } // HasRoutingTableId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) HasRoutingTableId() bool { _, ok := o.GetRoutingTableIdOk() return ok } // SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNetworkPayload) SetRoutingTableId(v CreateNetworkPayloadGetRoutingTableIdRetType) { setCreateNetworkPayloadGetRoutingTableIdAttributeType(&o.RoutingTableId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp); ok { @@ -379,37 +459,45 @@ func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNetworkPayload struct { value *CreateNetworkPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkPayload) Get() *CreateNetworkPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkPayload) Set(val *CreateNetworkPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNetworkPayload(val *CreateNetworkPayload) *NullableCreateNetworkPayload { return &NullableCreateNetworkPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNetworkPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNetworkPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_nic_payload.go b/services/iaas/model_create_nic_payload.go index 10949dd20..35285e7f1 100644 --- a/services/iaas/model_create_nic_payload.go +++ b/services/iaas/model_create_nic_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateNicPayload{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetAllowedAddressesAttributeType = *[]AllowedAddressesInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetAllowedAddressesArgType = []AllowedAddressesInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetAllowedAddressesRetType = []AllowedAddressesInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(arg CreateNicPayloadGetAllowedAddressesAttributeType) (ret CreateNicPayloadGetAllowedAddressesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(arg CreateNicPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetAllowedAddressesAttributeType(arg *CreateNicPayloadGetAllowedAddressesAttributeType, val CreateNicPayloadGetAllowedAddressesRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setCreateNicPayloadGetAllowedAddressesAttributeType(arg *CreateNicPayloadGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetDescriptionAttributeTypeOk(arg CreateNicPayloadGetDescriptionAttributeType) (ret CreateNicPayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getCreateNicPayloadGetDescriptionAttributeTypeOk(arg CreateNicPayloadGetDes return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetDescriptionAttributeType(arg *CreateNicPayloadGetDescriptionAttributeType, val CreateNicPayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetDescriptionRetType = string /* @@ -63,8 +77,10 @@ type CreateNicPayloadGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetDeviceAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetDeviceAttributeTypeOk(arg CreateNicPayloadGetDeviceAttributeType) (ret CreateNicPayloadGetDeviceRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getCreateNicPayloadGetDeviceAttributeTypeOk(arg CreateNicPayloadGetDeviceAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetDeviceAttributeType(arg *CreateNicPayloadGetDeviceAttributeType, val CreateNicPayloadGetDeviceRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetDeviceArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetDeviceRetType = string /* @@ -84,8 +104,10 @@ type CreateNicPayloadGetDeviceRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetIdAttributeTypeOk(arg CreateNicPayloadGetIdAttributeType) (ret CreateNicPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +115,15 @@ func getCreateNicPayloadGetIdAttributeTypeOk(arg CreateNicPayloadGetIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetIdAttributeType(arg *CreateNicPayloadGetIdAttributeType, val CreateNicPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIdRetType = string /* @@ -105,8 +131,10 @@ type CreateNicPayloadGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIpv4AttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetIpv4AttributeTypeOk(arg CreateNicPayloadGetIpv4AttributeType) (ret CreateNicPayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -114,11 +142,15 @@ func getCreateNicPayloadGetIpv4AttributeTypeOk(arg CreateNicPayloadGetIpv4Attrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetIpv4AttributeType(arg *CreateNicPayloadGetIpv4AttributeType, val CreateNicPayloadGetIpv4RetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIpv4ArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIpv4RetType = string /* @@ -126,8 +158,10 @@ type CreateNicPayloadGetIpv4RetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIpv6AttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetIpv6AttributeTypeOk(arg CreateNicPayloadGetIpv6AttributeType) (ret CreateNicPayloadGetIpv6RetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +169,15 @@ func getCreateNicPayloadGetIpv6AttributeTypeOk(arg CreateNicPayloadGetIpv6Attrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetIpv6AttributeType(arg *CreateNicPayloadGetIpv6AttributeType, val CreateNicPayloadGetIpv6RetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIpv6ArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetIpv6RetType = string /* @@ -147,10 +185,16 @@ type CreateNicPayloadGetIpv6RetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetLabelsAttributeTypeOk(arg CreateNicPayloadGetLabelsAttributeType) (ret CreateNicPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -158,6 +202,7 @@ func getCreateNicPayloadGetLabelsAttributeTypeOk(arg CreateNicPayloadGetLabelsAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetLabelsAttributeType(arg *CreateNicPayloadGetLabelsAttributeType, val CreateNicPayloadGetLabelsRetType) { *arg = &val } @@ -167,8 +212,10 @@ func setCreateNicPayloadGetLabelsAttributeType(arg *CreateNicPayloadGetLabelsAtt */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetMacAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetMacAttributeTypeOk(arg CreateNicPayloadGetMacAttributeType) (ret CreateNicPayloadGetMacRetType, ok bool) { if arg == nil { return ret, false @@ -176,11 +223,15 @@ func getCreateNicPayloadGetMacAttributeTypeOk(arg CreateNicPayloadGetMacAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetMacAttributeType(arg *CreateNicPayloadGetMacAttributeType, val CreateNicPayloadGetMacRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetMacArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetMacRetType = string /* @@ -188,8 +239,10 @@ type CreateNicPayloadGetMacRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetNameAttributeTypeOk(arg CreateNicPayloadGetNameAttributeType) (ret CreateNicPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +250,15 @@ func getCreateNicPayloadGetNameAttributeTypeOk(arg CreateNicPayloadGetNameAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetNameAttributeType(arg *CreateNicPayloadGetNameAttributeType, val CreateNicPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetNameRetType = string /* @@ -209,8 +266,10 @@ type CreateNicPayloadGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetNetworkIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetNetworkIdAttributeTypeOk(arg CreateNicPayloadGetNetworkIdAttributeType) (ret CreateNicPayloadGetNetworkIdRetType, ok bool) { if arg == nil { return ret, false @@ -218,11 +277,15 @@ func getCreateNicPayloadGetNetworkIdAttributeTypeOk(arg CreateNicPayloadGetNetwo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetNetworkIdAttributeType(arg *CreateNicPayloadGetNetworkIdAttributeType, val CreateNicPayloadGetNetworkIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetNetworkIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetNetworkIdRetType = string /* @@ -230,10 +293,16 @@ type CreateNicPayloadGetNetworkIdRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadgetNicSecurityAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadgetNicSecurityArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadgetNicSecurityRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadgetNicSecurityAttributeTypeOk(arg CreateNicPayloadgetNicSecurityAttributeType) (ret CreateNicPayloadgetNicSecurityRetType, ok bool) { if arg == nil { return ret, false @@ -241,6 +310,7 @@ func getCreateNicPayloadgetNicSecurityAttributeTypeOk(arg CreateNicPayloadgetNic return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadgetNicSecurityAttributeType(arg *CreateNicPayloadgetNicSecurityAttributeType, val CreateNicPayloadgetNicSecurityRetType) { *arg = &val } @@ -250,10 +320,16 @@ func setCreateNicPayloadgetNicSecurityAttributeType(arg *CreateNicPayloadgetNicS */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetSecurityGroupsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetSecurityGroupsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetSecurityGroupsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(arg CreateNicPayloadGetSecurityGroupsAttributeType) (ret CreateNicPayloadGetSecurityGroupsRetType, ok bool) { if arg == nil { return ret, false @@ -261,6 +337,7 @@ func getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(arg CreateNicPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetSecurityGroupsAttributeType(arg *CreateNicPayloadGetSecurityGroupsAttributeType, val CreateNicPayloadGetSecurityGroupsRetType) { *arg = &val } @@ -270,8 +347,10 @@ func setCreateNicPayloadGetSecurityGroupsAttributeType(arg *CreateNicPayloadGetS */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetStatusAttributeTypeOk(arg CreateNicPayloadGetStatusAttributeType) (ret CreateNicPayloadGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -279,11 +358,15 @@ func getCreateNicPayloadGetStatusAttributeTypeOk(arg CreateNicPayloadGetStatusAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetStatusAttributeType(arg *CreateNicPayloadGetStatusAttributeType, val CreateNicPayloadGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetStatusRetType = string /* @@ -291,8 +374,10 @@ type CreateNicPayloadGetStatusRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateNicPayloadGetTypeAttributeTypeOk(arg CreateNicPayloadGetTypeAttributeType) (ret CreateNicPayloadGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -300,14 +385,19 @@ func getCreateNicPayloadGetTypeAttributeTypeOk(arg CreateNicPayloadGetTypeAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateNicPayloadGetTypeAttributeType(arg *CreateNicPayloadGetTypeAttributeType, val CreateNicPayloadGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayloadGetTypeRetType = string // CreateNicPayload Object that represents a network interface. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateNicPayload struct { // A list of IPs or CIDR notations. AllowedAddresses CreateNicPayloadGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` @@ -321,7 +411,7 @@ type CreateNicPayload struct { Ipv4 CreateNicPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` // String that represents an IPv6 address. Ipv6 CreateNicPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` - // 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. + // 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. Labels CreateNicPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Object that represents an MAC address. Mac CreateNicPayloadGetMacAttributeType `json:"mac,omitempty"` @@ -343,6 +433,7 @@ type CreateNicPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNicPayload() *CreateNicPayload { this := CreateNicPayload{} return &this @@ -351,6 +442,7 @@ func NewCreateNicPayload() *CreateNicPayload { // NewCreateNicPayloadWithDefaults instantiates a new CreateNicPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateNicPayloadWithDefaults() *CreateNicPayload { this := CreateNicPayload{} var nicSecurity bool = true @@ -359,6 +451,7 @@ func NewCreateNicPayloadWithDefaults() *CreateNicPayload { } // GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetAllowedAddresses() (res CreateNicPayloadGetAllowedAddressesRetType) { res, _ = o.GetAllowedAddressesOk() return @@ -366,22 +459,26 @@ func (o *CreateNicPayload) GetAllowedAddresses() (res CreateNicPayloadGetAllowed // GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetAllowedAddressesOk() (ret CreateNicPayloadGetAllowedAddressesRetType, ok bool) { return getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) } // HasAllowedAddresses returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasAllowedAddresses() bool { _, ok := o.GetAllowedAddressesOk() return ok } // SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetAllowedAddresses(v CreateNicPayloadGetAllowedAddressesRetType) { setCreateNicPayloadGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetDescription() (res CreateNicPayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -389,22 +486,26 @@ func (o *CreateNicPayload) GetDescription() (res CreateNicPayloadGetDescriptionR // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetDescriptionOk() (ret CreateNicPayloadGetDescriptionRetType, ok bool) { return getCreateNicPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetDescription(v CreateNicPayloadGetDescriptionRetType) { setCreateNicPayloadGetDescriptionAttributeType(&o.Description, v) } // GetDevice returns the Device field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetDevice() (res CreateNicPayloadGetDeviceRetType) { res, _ = o.GetDeviceOk() return @@ -412,22 +513,26 @@ func (o *CreateNicPayload) GetDevice() (res CreateNicPayloadGetDeviceRetType) { // GetDeviceOk returns a tuple with the Device field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetDeviceOk() (ret CreateNicPayloadGetDeviceRetType, ok bool) { return getCreateNicPayloadGetDeviceAttributeTypeOk(o.Device) } // HasDevice returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasDevice() bool { _, ok := o.GetDeviceOk() return ok } // SetDevice gets a reference to the given string and assigns it to the Device field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetDevice(v CreateNicPayloadGetDeviceRetType) { setCreateNicPayloadGetDeviceAttributeType(&o.Device, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetId() (res CreateNicPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -435,22 +540,26 @@ func (o *CreateNicPayload) GetId() (res CreateNicPayloadGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetIdOk() (ret CreateNicPayloadGetIdRetType, ok bool) { return getCreateNicPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetId(v CreateNicPayloadGetIdRetType) { setCreateNicPayloadGetIdAttributeType(&o.Id, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetIpv4() (res CreateNicPayloadGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -458,22 +567,26 @@ func (o *CreateNicPayload) GetIpv4() (res CreateNicPayloadGetIpv4RetType) { // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetIpv4Ok() (ret CreateNicPayloadGetIpv4RetType, ok bool) { return getCreateNicPayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetIpv4(v CreateNicPayloadGetIpv4RetType) { setCreateNicPayloadGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetIpv6() (res CreateNicPayloadGetIpv6RetType) { res, _ = o.GetIpv6Ok() return @@ -481,22 +594,26 @@ func (o *CreateNicPayload) GetIpv6() (res CreateNicPayloadGetIpv6RetType) { // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetIpv6Ok() (ret CreateNicPayloadGetIpv6RetType, ok bool) { return getCreateNicPayloadGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasIpv6() bool { _, ok := o.GetIpv6Ok() return ok } // SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetIpv6(v CreateNicPayloadGetIpv6RetType) { setCreateNicPayloadGetIpv6AttributeType(&o.Ipv6, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetLabels() (res CreateNicPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -504,22 +621,26 @@ func (o *CreateNicPayload) GetLabels() (res CreateNicPayloadGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetLabelsOk() (ret CreateNicPayloadGetLabelsRetType, ok bool) { return getCreateNicPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetLabels(v CreateNicPayloadGetLabelsRetType) { setCreateNicPayloadGetLabelsAttributeType(&o.Labels, v) } // GetMac returns the Mac field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetMac() (res CreateNicPayloadGetMacRetType) { res, _ = o.GetMacOk() return @@ -527,22 +648,26 @@ func (o *CreateNicPayload) GetMac() (res CreateNicPayloadGetMacRetType) { // GetMacOk returns a tuple with the Mac field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetMacOk() (ret CreateNicPayloadGetMacRetType, ok bool) { return getCreateNicPayloadGetMacAttributeTypeOk(o.Mac) } // HasMac returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasMac() bool { _, ok := o.GetMacOk() return ok } // SetMac gets a reference to the given string and assigns it to the Mac field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetMac(v CreateNicPayloadGetMacRetType) { setCreateNicPayloadGetMacAttributeType(&o.Mac, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetName() (res CreateNicPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -550,22 +675,26 @@ func (o *CreateNicPayload) GetName() (res CreateNicPayloadGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetNameOk() (ret CreateNicPayloadGetNameRetType, ok bool) { return getCreateNicPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetName(v CreateNicPayloadGetNameRetType) { setCreateNicPayloadGetNameAttributeType(&o.Name, v) } // GetNetworkId returns the NetworkId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetNetworkId() (res CreateNicPayloadGetNetworkIdRetType) { res, _ = o.GetNetworkIdOk() return @@ -573,22 +702,26 @@ func (o *CreateNicPayload) GetNetworkId() (res CreateNicPayloadGetNetworkIdRetTy // GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetNetworkIdOk() (ret CreateNicPayloadGetNetworkIdRetType, ok bool) { return getCreateNicPayloadGetNetworkIdAttributeTypeOk(o.NetworkId) } // HasNetworkId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasNetworkId() bool { _, ok := o.GetNetworkIdOk() return ok } // SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetNetworkId(v CreateNicPayloadGetNetworkIdRetType) { setCreateNicPayloadGetNetworkIdAttributeType(&o.NetworkId, v) } // GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetNicSecurity() (res CreateNicPayloadgetNicSecurityRetType) { res, _ = o.GetNicSecurityOk() return @@ -596,22 +729,26 @@ func (o *CreateNicPayload) GetNicSecurity() (res CreateNicPayloadgetNicSecurityR // GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetNicSecurityOk() (ret CreateNicPayloadgetNicSecurityRetType, ok bool) { return getCreateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity) } // HasNicSecurity returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasNicSecurity() bool { _, ok := o.GetNicSecurityOk() return ok } // SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetNicSecurity(v CreateNicPayloadgetNicSecurityRetType) { setCreateNicPayloadgetNicSecurityAttributeType(&o.NicSecurity, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetSecurityGroups() (res CreateNicPayloadGetSecurityGroupsRetType) { res, _ = o.GetSecurityGroupsOk() return @@ -619,22 +756,26 @@ func (o *CreateNicPayload) GetSecurityGroups() (res CreateNicPayloadGetSecurityG // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetSecurityGroupsOk() (ret CreateNicPayloadGetSecurityGroupsRetType, ok bool) { return getCreateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasSecurityGroups() bool { _, ok := o.GetSecurityGroupsOk() return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetSecurityGroups(v CreateNicPayloadGetSecurityGroupsRetType) { setCreateNicPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetStatus() (res CreateNicPayloadGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -642,22 +783,26 @@ func (o *CreateNicPayload) GetStatus() (res CreateNicPayloadGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetStatusOk() (ret CreateNicPayloadGetStatusRetType, ok bool) { return getCreateNicPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetStatus(v CreateNicPayloadGetStatusRetType) { setCreateNicPayloadGetStatusAttributeType(&o.Status, v) } // GetType returns the Type field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetType() (res CreateNicPayloadGetTypeRetType) { res, _ = o.GetTypeOk() return @@ -665,21 +810,25 @@ func (o *CreateNicPayload) GetType() (res CreateNicPayloadGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) GetTypeOk() (ret CreateNicPayloadGetTypeRetType, ok bool) { return getCreateNicPayloadGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) HasType() bool { _, ok := o.GetTypeOk() return ok } // SetType gets a reference to the given string and assigns it to the Type field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateNicPayload) SetType(v CreateNicPayloadGetTypeRetType) { setCreateNicPayloadGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateNicPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { @@ -727,37 +876,45 @@ func (o CreateNicPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateNicPayload struct { value *CreateNicPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNicPayload) Get() *CreateNicPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNicPayload) Set(val *CreateNicPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNicPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNicPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateNicPayload(val *CreateNicPayload) *NullableCreateNicPayload { return &NullableCreateNicPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateNicPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateNicPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_protocol.go b/services/iaas/model_create_protocol.go index e70dd9ab7..ea75bcc1d 100644 --- a/services/iaas/model_create_protocol.go +++ b/services/iaas/model_create_protocol.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -16,12 +17,14 @@ import ( ) // CreateProtocol - The schema for a protocol when creating a security group rule. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateProtocol struct { Int64 *int64 String *string } // int64AsCreateProtocol is a convenience function that returns int64 wrapped in CreateProtocol +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func Int64AsCreateProtocol(v *int64) CreateProtocol { return CreateProtocol{ Int64: v, @@ -29,6 +32,7 @@ func Int64AsCreateProtocol(v *int64) CreateProtocol { } // stringAsCreateProtocol is a convenience function that returns string wrapped in CreateProtocol +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func StringAsCreateProtocol(v *string) CreateProtocol { return CreateProtocol{ String: v, @@ -36,6 +40,7 @@ func StringAsCreateProtocol(v *string) CreateProtocol { } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -79,6 +84,7 @@ func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src CreateProtocol) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.Int64 != nil { return json.Marshal(&src.Int64) } @@ -91,6 +97,7 @@ func (src CreateProtocol) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *CreateProtocol) GetActualInstance() interface{} { if obj == nil { return nil @@ -107,37 +114,45 @@ func (obj *CreateProtocol) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateProtocol struct { value *CreateProtocol isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateProtocol) Get() *CreateProtocol { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateProtocol) Set(val *CreateProtocol) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateProtocol) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateProtocol) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateProtocol(val *CreateProtocol) *NullableCreateProtocol { return &NullableCreateProtocol{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateProtocol) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateProtocol) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_public_ip_payload.go b/services/iaas/model_create_public_ip_payload.go index 9eb12088d..87682b909 100644 --- a/services/iaas/model_create_public_ip_payload.go +++ b/services/iaas/model_create_public_ip_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreatePublicIPPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreatePublicIPPayloadGetIdAttributeTypeOk(arg CreatePublicIPPayloadGetIdAttributeType) (ret CreatePublicIPPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getCreatePublicIPPayloadGetIdAttributeTypeOk(arg CreatePublicIPPayloadGetId return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreatePublicIPPayloadGetIdAttributeType(arg *CreatePublicIPPayloadGetIdAttributeType, val CreatePublicIPPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetIdRetType = string /* @@ -43,8 +50,10 @@ type CreatePublicIPPayloadGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetIpAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreatePublicIPPayloadGetIpAttributeTypeOk(arg CreatePublicIPPayloadGetIpAttributeType) (ret CreatePublicIPPayloadGetIpRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getCreatePublicIPPayloadGetIpAttributeTypeOk(arg CreatePublicIPPayloadGetIp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreatePublicIPPayloadGetIpAttributeType(arg *CreatePublicIPPayloadGetIpAttributeType, val CreatePublicIPPayloadGetIpRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetIpArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetIpRetType = string /* @@ -64,10 +77,16 @@ type CreatePublicIPPayloadGetIpRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreatePublicIPPayloadGetLabelsAttributeTypeOk(arg CreatePublicIPPayloadGetLabelsAttributeType) (ret CreatePublicIPPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +94,7 @@ func getCreatePublicIPPayloadGetLabelsAttributeTypeOk(arg CreatePublicIPPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreatePublicIPPayloadGetLabelsAttributeType(arg *CreatePublicIPPayloadGetLabelsAttributeType, val CreatePublicIPPayloadGetLabelsRetType) { *arg = &val } @@ -84,8 +104,10 @@ func setCreatePublicIPPayloadGetLabelsAttributeType(arg *CreatePublicIPPayloadGe */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetNetworkInterfaceAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(arg CreatePublicIPPayloadGetNetworkInterfaceAttributeType) (ret CreatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { if arg == nil { return nil, false @@ -93,6 +115,7 @@ func getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(arg CreatePublic return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreatePublicIPPayloadGetNetworkInterfaceAttributeType(arg *CreatePublicIPPayloadGetNetworkInterfaceAttributeType, val CreatePublicIPPayloadGetNetworkInterfaceRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -101,16 +124,20 @@ func setCreatePublicIPPayloadGetNetworkInterfaceAttributeType(arg *CreatePublicI } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetNetworkInterfaceArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayloadGetNetworkInterfaceRetType = *string // CreatePublicIPPayload Object that represents a public IP. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreatePublicIPPayload struct { // Universally Unique Identifier (UUID). Id CreatePublicIPPayloadGetIdAttributeType `json:"id,omitempty"` // String that represents an IPv4 address. Ip CreatePublicIPPayloadGetIpAttributeType `json:"ip,omitempty"` - // 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. + // 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. Labels CreatePublicIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Universally Unique Identifier (UUID). NetworkInterface CreatePublicIPPayloadGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` @@ -120,6 +147,7 @@ type CreatePublicIPPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreatePublicIPPayload() *CreatePublicIPPayload { this := CreatePublicIPPayload{} return &this @@ -128,12 +156,14 @@ func NewCreatePublicIPPayload() *CreatePublicIPPayload { // NewCreatePublicIPPayloadWithDefaults instantiates a new CreatePublicIPPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreatePublicIPPayloadWithDefaults() *CreatePublicIPPayload { this := CreatePublicIPPayload{} return &this } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) GetId() (res CreatePublicIPPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -141,22 +171,26 @@ func (o *CreatePublicIPPayload) GetId() (res CreatePublicIPPayloadGetIdRetType) // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) GetIdOk() (ret CreatePublicIPPayloadGetIdRetType, ok bool) { return getCreatePublicIPPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) SetId(v CreatePublicIPPayloadGetIdRetType) { setCreatePublicIPPayloadGetIdAttributeType(&o.Id, v) } // GetIp returns the Ip field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) GetIp() (res CreatePublicIPPayloadGetIpRetType) { res, _ = o.GetIpOk() return @@ -164,22 +198,26 @@ func (o *CreatePublicIPPayload) GetIp() (res CreatePublicIPPayloadGetIpRetType) // GetIpOk returns a tuple with the Ip field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) GetIpOk() (ret CreatePublicIPPayloadGetIpRetType, ok bool) { return getCreatePublicIPPayloadGetIpAttributeTypeOk(o.Ip) } // HasIp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) HasIp() bool { _, ok := o.GetIpOk() return ok } // SetIp gets a reference to the given string and assigns it to the Ip field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) SetIp(v CreatePublicIPPayloadGetIpRetType) { setCreatePublicIPPayloadGetIpAttributeType(&o.Ip, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) GetLabels() (res CreatePublicIPPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -187,22 +225,26 @@ func (o *CreatePublicIPPayload) GetLabels() (res CreatePublicIPPayloadGetLabelsR // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) GetLabelsOk() (ret CreatePublicIPPayloadGetLabelsRetType, ok bool) { return getCreatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) SetLabels(v CreatePublicIPPayloadGetLabelsRetType) { setCreatePublicIPPayloadGetLabelsAttributeType(&o.Labels, v) } // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) GetNetworkInterface() (res CreatePublicIPPayloadGetNetworkInterfaceRetType) { res, _ = o.GetNetworkInterfaceOk() return @@ -211,31 +253,37 @@ func (o *CreatePublicIPPayload) GetNetworkInterface() (res CreatePublicIPPayload // GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) GetNetworkInterfaceOk() (ret CreatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { return getCreatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) } // HasNetworkInterface returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) HasNetworkInterface() bool { _, ok := o.GetNetworkInterfaceOk() return ok } // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) SetNetworkInterface(v CreatePublicIPPayloadGetNetworkInterfaceRetType) { setCreatePublicIPPayloadGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) SetNetworkInterfaceNil() { o.NetworkInterface = nil } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreatePublicIPPayload) UnsetNetworkInterface() { o.NetworkInterface = nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreatePublicIPPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreatePublicIPPayloadGetIdAttributeTypeOk(o.Id); ok { @@ -253,37 +301,45 @@ func (o CreatePublicIPPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreatePublicIPPayload struct { value *CreatePublicIPPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreatePublicIPPayload) Get() *CreatePublicIPPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreatePublicIPPayload) Set(val *CreatePublicIPPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreatePublicIPPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreatePublicIPPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreatePublicIPPayload(val *CreatePublicIPPayload) *NullableCreatePublicIPPayload { return &NullableCreatePublicIPPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreatePublicIPPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreatePublicIPPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_security_group_payload.go b/services/iaas/model_create_security_group_payload.go index 71c6c6bf2..a77fe6099 100644 --- a/services/iaas/model_create_security_group_payload.go +++ b/services/iaas/model_create_security_group_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &CreateSecurityGroupPayload{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(arg CreateSecurityGroupPayloadGetCreatedAtAttributeType) (ret CreateSecurityGroupPayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(arg CreateSecurity return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupPayloadGetCreatedAtAttributeType(arg *CreateSecurityGroupPayloadGetCreatedAtAttributeType, val CreateSecurityGroupPayloadGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setCreateSecurityGroupPayloadGetCreatedAtAttributeType(arg *CreateSecurityG */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(arg CreateSecurityGroupPayloadGetDescriptionAttributeType) (ret CreateSecurityGroupPayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(arg CreateSecuri return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupPayloadGetDescriptionAttributeType(arg *CreateSecurityGroupPayloadGetDescriptionAttributeType, val CreateSecurityGroupPayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetDescriptionRetType = string /* @@ -64,8 +78,10 @@ type CreateSecurityGroupPayloadGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupPayloadGetIdAttributeTypeOk(arg CreateSecurityGroupPayloadGetIdAttributeType) (ret CreateSecurityGroupPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getCreateSecurityGroupPayloadGetIdAttributeTypeOk(arg CreateSecurityGroupPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupPayloadGetIdAttributeType(arg *CreateSecurityGroupPayloadGetIdAttributeType, val CreateSecurityGroupPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetIdRetType = string /* @@ -85,10 +105,16 @@ type CreateSecurityGroupPayloadGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(arg CreateSecurityGroupPayloadGetLabelsAttributeType) (ret CreateSecurityGroupPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -96,6 +122,7 @@ func getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(arg CreateSecurityGro return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupPayloadGetLabelsAttributeType(arg *CreateSecurityGroupPayloadGetLabelsAttributeType, val CreateSecurityGroupPayloadGetLabelsRetType) { *arg = &val } @@ -105,8 +132,10 @@ func setCreateSecurityGroupPayloadGetLabelsAttributeType(arg *CreateSecurityGrou */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupPayloadGetNameAttributeTypeOk(arg CreateSecurityGroupPayloadGetNameAttributeType) (ret CreateSecurityGroupPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -114,11 +143,15 @@ func getCreateSecurityGroupPayloadGetNameAttributeTypeOk(arg CreateSecurityGroup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupPayloadGetNameAttributeType(arg *CreateSecurityGroupPayloadGetNameAttributeType, val CreateSecurityGroupPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetNameRetType = string /* @@ -126,10 +159,16 @@ type CreateSecurityGroupPayloadGetNameRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetRulesAttributeType = *[]SecurityGroupRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetRulesArgType = []SecurityGroupRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetRulesRetType = []SecurityGroupRule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(arg CreateSecurityGroupPayloadGetRulesAttributeType) (ret CreateSecurityGroupPayloadGetRulesRetType, ok bool) { if arg == nil { return ret, false @@ -137,6 +176,7 @@ func getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(arg CreateSecurityGrou return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupPayloadGetRulesAttributeType(arg *CreateSecurityGroupPayloadGetRulesAttributeType, val CreateSecurityGroupPayloadGetRulesRetType) { *arg = &val } @@ -146,10 +186,16 @@ func setCreateSecurityGroupPayloadGetRulesAttributeType(arg *CreateSecurityGroup */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadgetStatefulAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadgetStatefulArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadgetStatefulRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(arg CreateSecurityGroupPayloadgetStatefulAttributeType) (ret CreateSecurityGroupPayloadgetStatefulRetType, ok bool) { if arg == nil { return ret, false @@ -157,6 +203,7 @@ func getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(arg CreateSecurityG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupPayloadgetStatefulAttributeType(arg *CreateSecurityGroupPayloadgetStatefulAttributeType, val CreateSecurityGroupPayloadgetStatefulRetType) { *arg = &val } @@ -166,10 +213,16 @@ func setCreateSecurityGroupPayloadgetStatefulAttributeType(arg *CreateSecurityGr */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(arg CreateSecurityGroupPayloadGetUpdatedAtAttributeType) (ret CreateSecurityGroupPayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -177,11 +230,13 @@ func getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(arg CreateSecurity return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupPayloadGetUpdatedAtAttributeType(arg *CreateSecurityGroupPayloadGetUpdatedAtAttributeType, val CreateSecurityGroupPayloadGetUpdatedAtRetType) { *arg = &val } // CreateSecurityGroupPayload Object that represents a security group. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupPayload struct { // Date-time when resource was created. CreatedAt CreateSecurityGroupPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -189,7 +244,7 @@ type CreateSecurityGroupPayload struct { Description CreateSecurityGroupPayloadGetDescriptionAttributeType `json:"description,omitempty"` // Universally Unique Identifier (UUID). Id CreateSecurityGroupPayloadGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels CreateSecurityGroupPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED @@ -202,12 +257,14 @@ type CreateSecurityGroupPayload struct { UpdatedAt CreateSecurityGroupPayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateSecurityGroupPayload CreateSecurityGroupPayload // NewCreateSecurityGroupPayload instantiates a new CreateSecurityGroupPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateSecurityGroupPayload(name CreateSecurityGroupPayloadGetNameArgType) *CreateSecurityGroupPayload { this := CreateSecurityGroupPayload{} setCreateSecurityGroupPayloadGetNameAttributeType(&this.Name, name) @@ -217,6 +274,7 @@ func NewCreateSecurityGroupPayload(name CreateSecurityGroupPayloadGetNameArgType // NewCreateSecurityGroupPayloadWithDefaults instantiates a new CreateSecurityGroupPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateSecurityGroupPayloadWithDefaults() *CreateSecurityGroupPayload { this := CreateSecurityGroupPayload{} var stateful bool = true @@ -225,6 +283,7 @@ func NewCreateSecurityGroupPayloadWithDefaults() *CreateSecurityGroupPayload { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetCreatedAt() (res CreateSecurityGroupPayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -232,22 +291,26 @@ func (o *CreateSecurityGroupPayload) GetCreatedAt() (res CreateSecurityGroupPayl // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetCreatedAtOk() (ret CreateSecurityGroupPayloadGetCreatedAtRetType, ok bool) { return getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) SetCreatedAt(v CreateSecurityGroupPayloadGetCreatedAtRetType) { setCreateSecurityGroupPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetDescription() (res CreateSecurityGroupPayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -255,22 +318,26 @@ func (o *CreateSecurityGroupPayload) GetDescription() (res CreateSecurityGroupPa // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetDescriptionOk() (ret CreateSecurityGroupPayloadGetDescriptionRetType, ok bool) { return getCreateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) SetDescription(v CreateSecurityGroupPayloadGetDescriptionRetType) { setCreateSecurityGroupPayloadGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetId() (res CreateSecurityGroupPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -278,22 +345,26 @@ func (o *CreateSecurityGroupPayload) GetId() (res CreateSecurityGroupPayloadGetI // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetIdOk() (ret CreateSecurityGroupPayloadGetIdRetType, ok bool) { return getCreateSecurityGroupPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) SetId(v CreateSecurityGroupPayloadGetIdRetType) { setCreateSecurityGroupPayloadGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetLabels() (res CreateSecurityGroupPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -301,22 +372,26 @@ func (o *CreateSecurityGroupPayload) GetLabels() (res CreateSecurityGroupPayload // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetLabelsOk() (ret CreateSecurityGroupPayloadGetLabelsRetType, ok bool) { return getCreateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) SetLabels(v CreateSecurityGroupPayloadGetLabelsRetType) { setCreateSecurityGroupPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetName() (ret CreateSecurityGroupPayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -324,16 +399,19 @@ func (o *CreateSecurityGroupPayload) GetName() (ret CreateSecurityGroupPayloadGe // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetNameOk() (ret CreateSecurityGroupPayloadGetNameRetType, ok bool) { return getCreateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) SetName(v CreateSecurityGroupPayloadGetNameRetType) { setCreateSecurityGroupPayloadGetNameAttributeType(&o.Name, v) } // GetRules returns the Rules field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetRules() (res CreateSecurityGroupPayloadGetRulesRetType) { res, _ = o.GetRulesOk() return @@ -341,22 +419,26 @@ func (o *CreateSecurityGroupPayload) GetRules() (res CreateSecurityGroupPayloadG // GetRulesOk returns a tuple with the Rules field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetRulesOk() (ret CreateSecurityGroupPayloadGetRulesRetType, ok bool) { return getCreateSecurityGroupPayloadGetRulesAttributeTypeOk(o.Rules) } // HasRules returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) HasRules() bool { _, ok := o.GetRulesOk() return ok } // SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) SetRules(v CreateSecurityGroupPayloadGetRulesRetType) { setCreateSecurityGroupPayloadGetRulesAttributeType(&o.Rules, v) } // GetStateful returns the Stateful field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetStateful() (res CreateSecurityGroupPayloadgetStatefulRetType) { res, _ = o.GetStatefulOk() return @@ -364,22 +446,26 @@ func (o *CreateSecurityGroupPayload) GetStateful() (res CreateSecurityGroupPaylo // GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetStatefulOk() (ret CreateSecurityGroupPayloadgetStatefulRetType, ok bool) { return getCreateSecurityGroupPayloadgetStatefulAttributeTypeOk(o.Stateful) } // HasStateful returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) HasStateful() bool { _, ok := o.GetStatefulOk() return ok } // SetStateful gets a reference to the given bool and assigns it to the Stateful field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) SetStateful(v CreateSecurityGroupPayloadgetStatefulRetType) { setCreateSecurityGroupPayloadgetStatefulAttributeType(&o.Stateful, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetUpdatedAt() (res CreateSecurityGroupPayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -387,21 +473,25 @@ func (o *CreateSecurityGroupPayload) GetUpdatedAt() (res CreateSecurityGroupPayl // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) GetUpdatedAtOk() (ret CreateSecurityGroupPayloadGetUpdatedAtRetType, ok bool) { return getCreateSecurityGroupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupPayload) SetUpdatedAt(v CreateSecurityGroupPayloadGetUpdatedAtRetType) { setCreateSecurityGroupPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateSecurityGroupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -431,37 +521,45 @@ func (o CreateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateSecurityGroupPayload struct { value *CreateSecurityGroupPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupPayload) Get() *CreateSecurityGroupPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupPayload) Set(val *CreateSecurityGroupPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateSecurityGroupPayload(val *CreateSecurityGroupPayload) *NullableCreateSecurityGroupPayload { return &NullableCreateSecurityGroupPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_security_group_rule_payload.go b/services/iaas/model_create_security_group_rule_payload.go index f2aba603c..4488dc5eb 100644 --- a/services/iaas/model_create_security_group_rule_payload.go +++ b/services/iaas/model_create_security_group_rule_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &CreateSecurityGroupRulePayload{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetCreatedAtAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetCreatedAtAttributeType) (ret CreateSecurityGroupRulePayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getCreateSecurityGroupRulePayloadGetCreatedAtAttributeTypeOk(arg CreateSecu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetCreatedAtAttributeType(arg *CreateSecurityGroupRulePayloadGetCreatedAtAttributeType, val CreateSecurityGroupRulePayloadGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setCreateSecurityGroupRulePayloadGetCreatedAtAttributeType(arg *CreateSecur */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetDescriptionAttributeType) (ret CreateSecurityGroupRulePayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(arg CreateSe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetDescriptionAttributeType(arg *CreateSecurityGroupRulePayloadGetDescriptionAttributeType, val CreateSecurityGroupRulePayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetDescriptionRetType = string /* @@ -64,8 +78,10 @@ type CreateSecurityGroupRulePayloadGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetDirectionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetDirectionAttributeType) (ret CreateSecurityGroupRulePayloadGetDirectionRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(arg CreateSecu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetDirectionAttributeType(arg *CreateSecurityGroupRulePayloadGetDirectionAttributeType, val CreateSecurityGroupRulePayloadGetDirectionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetDirectionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetDirectionRetType = string /* @@ -85,8 +105,10 @@ type CreateSecurityGroupRulePayloadGetDirectionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetEthertypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetEthertypeAttributeType) (ret CreateSecurityGroupRulePayloadGetEthertypeRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +116,15 @@ func getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(arg CreateSecu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetEthertypeAttributeType(arg *CreateSecurityGroupRulePayloadGetEthertypeAttributeType, val CreateSecurityGroupRulePayloadGetEthertypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetEthertypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetEthertypeRetType = string /* @@ -106,10 +132,16 @@ type CreateSecurityGroupRulePayloadGetEthertypeRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType = *ICMPParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIcmpParametersArgType = ICMPParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIcmpParametersRetType = ICMPParameters +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType) (ret CreateSecurityGroupRulePayloadGetIcmpParametersRetType, ok bool) { if arg == nil { return ret, false @@ -117,6 +149,7 @@ func getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(arg Creat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetIcmpParametersAttributeType(arg *CreateSecurityGroupRulePayloadGetIcmpParametersAttributeType, val CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { *arg = &val } @@ -126,8 +159,10 @@ func setCreateSecurityGroupRulePayloadGetIcmpParametersAttributeType(arg *Create */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIdAttributeType) (ret CreateSecurityGroupRulePayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +170,15 @@ func getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(arg CreateSecurityGro return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetIdAttributeType(arg *CreateSecurityGroupRulePayloadGetIdAttributeType, val CreateSecurityGroupRulePayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIdRetType = string /* @@ -147,8 +186,10 @@ type CreateSecurityGroupRulePayloadGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIpRangeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetIpRangeAttributeType) (ret CreateSecurityGroupRulePayloadGetIpRangeRetType, ok bool) { if arg == nil { return ret, false @@ -156,11 +197,15 @@ func getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(arg CreateSecuri return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetIpRangeAttributeType(arg *CreateSecurityGroupRulePayloadGetIpRangeAttributeType, val CreateSecurityGroupRulePayloadGetIpRangeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIpRangeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetIpRangeRetType = string /* @@ -168,10 +213,16 @@ type CreateSecurityGroupRulePayloadGetIpRangeRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetPortRangeAttributeType = *PortRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetPortRangeArgType = PortRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetPortRangeRetType = PortRange +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetPortRangeAttributeType) (ret CreateSecurityGroupRulePayloadGetPortRangeRetType, ok bool) { if arg == nil { return ret, false @@ -179,6 +230,7 @@ func getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(arg CreateSecu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetPortRangeAttributeType(arg *CreateSecurityGroupRulePayloadGetPortRangeAttributeType, val CreateSecurityGroupRulePayloadGetPortRangeRetType) { *arg = &val } @@ -188,8 +240,10 @@ func setCreateSecurityGroupRulePayloadGetPortRangeAttributeType(arg *CreateSecur */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType) (ret CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +251,15 @@ func getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(ar return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType(arg *CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType, val CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType = string /* @@ -209,8 +267,10 @@ type CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType) (ret CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType, ok bool) { if arg == nil { return ret, false @@ -218,11 +278,15 @@ func getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(arg Crea return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType(arg *CreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType, val CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetSecurityGroupIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType = string /* @@ -230,10 +294,16 @@ type CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetUpdatedAtAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetUpdatedAtAttributeType) (ret CreateSecurityGroupRulePayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -241,6 +311,7 @@ func getCreateSecurityGroupRulePayloadGetUpdatedAtAttributeTypeOk(arg CreateSecu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetUpdatedAtAttributeType(arg *CreateSecurityGroupRulePayloadGetUpdatedAtAttributeType, val CreateSecurityGroupRulePayloadGetUpdatedAtRetType) { *arg = &val } @@ -250,10 +321,16 @@ func setCreateSecurityGroupRulePayloadGetUpdatedAtAttributeType(arg *CreateSecur */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetProtocolAttributeType = *CreateProtocol + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetProtocolArgType = CreateProtocol + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayloadGetProtocolRetType = CreateProtocol +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(arg CreateSecurityGroupRulePayloadGetProtocolAttributeType) (ret CreateSecurityGroupRulePayloadGetProtocolRetType, ok bool) { if arg == nil { return ret, false @@ -261,11 +338,13 @@ func getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(arg CreateSecur return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRulePayloadGetProtocolAttributeType(arg *CreateSecurityGroupRulePayloadGetProtocolAttributeType, val CreateSecurityGroupRulePayloadGetProtocolRetType) { *arg = &val } // CreateSecurityGroupRulePayload Object that represents a request body for security group rule creation. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRulePayload struct { // Date-time when resource was created. CreatedAt CreateSecurityGroupRulePayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -291,12 +370,14 @@ type CreateSecurityGroupRulePayload struct { Protocol CreateSecurityGroupRulePayloadGetProtocolAttributeType `json:"protocol,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateSecurityGroupRulePayload CreateSecurityGroupRulePayload // NewCreateSecurityGroupRulePayload instantiates a new CreateSecurityGroupRulePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateSecurityGroupRulePayload(direction CreateSecurityGroupRulePayloadGetDirectionArgType) *CreateSecurityGroupRulePayload { this := CreateSecurityGroupRulePayload{} setCreateSecurityGroupRulePayloadGetDirectionAttributeType(&this.Direction, direction) @@ -306,6 +387,7 @@ func NewCreateSecurityGroupRulePayload(direction CreateSecurityGroupRulePayloadG // NewCreateSecurityGroupRulePayloadWithDefaults instantiates a new CreateSecurityGroupRulePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateSecurityGroupRulePayloadWithDefaults() *CreateSecurityGroupRulePayload { this := CreateSecurityGroupRulePayload{} var ethertype string = "IPv4" @@ -314,6 +396,7 @@ func NewCreateSecurityGroupRulePayloadWithDefaults() *CreateSecurityGroupRulePay } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetCreatedAt() (res CreateSecurityGroupRulePayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -321,22 +404,26 @@ func (o *CreateSecurityGroupRulePayload) GetCreatedAt() (res CreateSecurityGroup // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetCreatedAtOk() (ret CreateSecurityGroupRulePayloadGetCreatedAtRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetCreatedAt(v CreateSecurityGroupRulePayloadGetCreatedAtRetType) { setCreateSecurityGroupRulePayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetDescription() (res CreateSecurityGroupRulePayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -344,22 +431,26 @@ func (o *CreateSecurityGroupRulePayload) GetDescription() (res CreateSecurityGro // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetDescriptionOk() (ret CreateSecurityGroupRulePayloadGetDescriptionRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetDescription(v CreateSecurityGroupRulePayloadGetDescriptionRetType) { setCreateSecurityGroupRulePayloadGetDescriptionAttributeType(&o.Description, v) } // GetDirection returns the Direction field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetDirection() (ret CreateSecurityGroupRulePayloadGetDirectionRetType) { ret, _ = o.GetDirectionOk() return ret @@ -367,16 +458,19 @@ func (o *CreateSecurityGroupRulePayload) GetDirection() (ret CreateSecurityGroup // GetDirectionOk returns a tuple with the Direction field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetDirectionOk() (ret CreateSecurityGroupRulePayloadGetDirectionRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetDirectionAttributeTypeOk(o.Direction) } // SetDirection sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetDirection(v CreateSecurityGroupRulePayloadGetDirectionRetType) { setCreateSecurityGroupRulePayloadGetDirectionAttributeType(&o.Direction, v) } // GetEthertype returns the Ethertype field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetEthertype() (res CreateSecurityGroupRulePayloadGetEthertypeRetType) { res, _ = o.GetEthertypeOk() return @@ -384,22 +478,26 @@ func (o *CreateSecurityGroupRulePayload) GetEthertype() (res CreateSecurityGroup // GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetEthertypeOk() (ret CreateSecurityGroupRulePayloadGetEthertypeRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetEthertypeAttributeTypeOk(o.Ethertype) } // HasEthertype returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasEthertype() bool { _, ok := o.GetEthertypeOk() return ok } // SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetEthertype(v CreateSecurityGroupRulePayloadGetEthertypeRetType) { setCreateSecurityGroupRulePayloadGetEthertypeAttributeType(&o.Ethertype, v) } // GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetIcmpParameters() (res CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { res, _ = o.GetIcmpParametersOk() return @@ -407,22 +505,26 @@ func (o *CreateSecurityGroupRulePayload) GetIcmpParameters() (res CreateSecurity // GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetIcmpParametersOk() (ret CreateSecurityGroupRulePayloadGetIcmpParametersRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetIcmpParametersAttributeTypeOk(o.IcmpParameters) } // HasIcmpParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasIcmpParameters() bool { _, ok := o.GetIcmpParametersOk() return ok } // SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetIcmpParameters(v CreateSecurityGroupRulePayloadGetIcmpParametersRetType) { setCreateSecurityGroupRulePayloadGetIcmpParametersAttributeType(&o.IcmpParameters, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetId() (res CreateSecurityGroupRulePayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -430,22 +532,26 @@ func (o *CreateSecurityGroupRulePayload) GetId() (res CreateSecurityGroupRulePay // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetIdOk() (ret CreateSecurityGroupRulePayloadGetIdRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetId(v CreateSecurityGroupRulePayloadGetIdRetType) { setCreateSecurityGroupRulePayloadGetIdAttributeType(&o.Id, v) } // GetIpRange returns the IpRange field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetIpRange() (res CreateSecurityGroupRulePayloadGetIpRangeRetType) { res, _ = o.GetIpRangeOk() return @@ -453,22 +559,26 @@ func (o *CreateSecurityGroupRulePayload) GetIpRange() (res CreateSecurityGroupRu // GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetIpRangeOk() (ret CreateSecurityGroupRulePayloadGetIpRangeRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetIpRangeAttributeTypeOk(o.IpRange) } // HasIpRange returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasIpRange() bool { _, ok := o.GetIpRangeOk() return ok } // SetIpRange gets a reference to the given string and assigns it to the IpRange field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetIpRange(v CreateSecurityGroupRulePayloadGetIpRangeRetType) { setCreateSecurityGroupRulePayloadGetIpRangeAttributeType(&o.IpRange, v) } // GetPortRange returns the PortRange field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetPortRange() (res CreateSecurityGroupRulePayloadGetPortRangeRetType) { res, _ = o.GetPortRangeOk() return @@ -476,22 +586,26 @@ func (o *CreateSecurityGroupRulePayload) GetPortRange() (res CreateSecurityGroup // GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetPortRangeOk() (ret CreateSecurityGroupRulePayloadGetPortRangeRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetPortRangeAttributeTypeOk(o.PortRange) } // HasPortRange returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasPortRange() bool { _, ok := o.GetPortRangeOk() return ok } // SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetPortRange(v CreateSecurityGroupRulePayloadGetPortRangeRetType) { setCreateSecurityGroupRulePayloadGetPortRangeAttributeType(&o.PortRange, v) } // GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() (res CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { res, _ = o.GetRemoteSecurityGroupIdOk() return @@ -499,22 +613,26 @@ func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() (res CreateS // GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupIdOk() (ret CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) } // HasRemoteSecurityGroupId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasRemoteSecurityGroupId() bool { _, ok := o.GetRemoteSecurityGroupIdOk() return ok } // SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetRemoteSecurityGroupId(v CreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdRetType) { setCreateSecurityGroupRulePayloadGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) } // GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetSecurityGroupId() (res CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { res, _ = o.GetSecurityGroupIdOk() return @@ -522,22 +640,26 @@ func (o *CreateSecurityGroupRulePayload) GetSecurityGroupId() (res CreateSecurit // GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetSecurityGroupIdOk() (ret CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) } // HasSecurityGroupId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasSecurityGroupId() bool { _, ok := o.GetSecurityGroupIdOk() return ok } // SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetSecurityGroupId(v CreateSecurityGroupRulePayloadGetSecurityGroupIdRetType) { setCreateSecurityGroupRulePayloadGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetUpdatedAt() (res CreateSecurityGroupRulePayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -545,22 +667,26 @@ func (o *CreateSecurityGroupRulePayload) GetUpdatedAt() (res CreateSecurityGroup // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetUpdatedAtOk() (ret CreateSecurityGroupRulePayloadGetUpdatedAtRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetUpdatedAt(v CreateSecurityGroupRulePayloadGetUpdatedAtRetType) { setCreateSecurityGroupRulePayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetProtocol returns the Protocol field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetProtocol() (res CreateSecurityGroupRulePayloadGetProtocolRetType) { res, _ = o.GetProtocolOk() return @@ -568,21 +694,25 @@ func (o *CreateSecurityGroupRulePayload) GetProtocol() (res CreateSecurityGroupR // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (ret CreateSecurityGroupRulePayloadGetProtocolRetType, ok bool) { return getCreateSecurityGroupRulePayloadGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { _, ok := o.GetProtocolOk() return ok } // SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRulePayload) SetProtocol(v CreateSecurityGroupRulePayloadGetProtocolRetType) { setCreateSecurityGroupRulePayloadGetProtocolAttributeType(&o.Protocol, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateSecurityGroupRulePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -624,37 +754,45 @@ func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateSecurityGroupRulePayload struct { value *CreateSecurityGroupRulePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupRulePayload) Get() *CreateSecurityGroupRulePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupRulePayload) Set(val *CreateSecurityGroupRulePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupRulePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupRulePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateSecurityGroupRulePayload(val *CreateSecurityGroupRulePayload) *NullableCreateSecurityGroupRulePayload { return &NullableCreateSecurityGroupRulePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupRulePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupRulePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_security_group_rule_protocol.go b/services/iaas/model_create_security_group_rule_protocol.go index 4477434ea..9987e22ef 100644 --- a/services/iaas/model_create_security_group_rule_protocol.go +++ b/services/iaas/model_create_security_group_rule_protocol.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateSecurityGroupRuleProtocol{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRuleProtocolGetProtocolAttributeType = *CreateProtocol + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRuleProtocolGetProtocolArgType = CreateProtocol + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRuleProtocolGetProtocolRetType = CreateProtocol +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(arg CreateSecurityGroupRuleProtocolGetProtocolAttributeType) (ret CreateSecurityGroupRuleProtocolGetProtocolRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(arg CreateSecu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSecurityGroupRuleProtocolGetProtocolAttributeType(arg *CreateSecurityGroupRuleProtocolGetProtocolAttributeType, val CreateSecurityGroupRuleProtocolGetProtocolRetType) { *arg = &val } // CreateSecurityGroupRuleProtocol The internet protocol which the rule should match. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSecurityGroupRuleProtocol struct { Protocol CreateSecurityGroupRuleProtocolGetProtocolAttributeType `json:"protocol,omitempty"` } @@ -46,6 +55,7 @@ type CreateSecurityGroupRuleProtocol struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateSecurityGroupRuleProtocol() *CreateSecurityGroupRuleProtocol { this := CreateSecurityGroupRuleProtocol{} return &this @@ -54,12 +64,14 @@ func NewCreateSecurityGroupRuleProtocol() *CreateSecurityGroupRuleProtocol { // NewCreateSecurityGroupRuleProtocolWithDefaults instantiates a new CreateSecurityGroupRuleProtocol object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateSecurityGroupRuleProtocolWithDefaults() *CreateSecurityGroupRuleProtocol { this := CreateSecurityGroupRuleProtocol{} return &this } // GetProtocol returns the Protocol field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRuleProtocol) GetProtocol() (res CreateSecurityGroupRuleProtocolGetProtocolRetType) { res, _ = o.GetProtocolOk() return @@ -67,21 +79,25 @@ func (o *CreateSecurityGroupRuleProtocol) GetProtocol() (res CreateSecurityGroup // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (ret CreateSecurityGroupRuleProtocolGetProtocolRetType, ok bool) { return getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRuleProtocol) HasProtocol() bool { _, ok := o.GetProtocolOk() return ok } // SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSecurityGroupRuleProtocol) SetProtocol(v CreateSecurityGroupRuleProtocolGetProtocolRetType) { setCreateSecurityGroupRuleProtocolGetProtocolAttributeType(&o.Protocol, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateSecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol); ok { @@ -90,37 +106,45 @@ func (o CreateSecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateSecurityGroupRuleProtocol struct { value *CreateSecurityGroupRuleProtocol isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupRuleProtocol) Get() *CreateSecurityGroupRuleProtocol { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupRuleProtocol) Set(val *CreateSecurityGroupRuleProtocol) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupRuleProtocol) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupRuleProtocol) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateSecurityGroupRuleProtocol(val *CreateSecurityGroupRuleProtocol) *NullableCreateSecurityGroupRuleProtocol { return &NullableCreateSecurityGroupRuleProtocol{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_server_networking.go b/services/iaas/model_create_server_networking.go index fbbea4990..96617a54a 100644 --- a/services/iaas/model_create_server_networking.go +++ b/services/iaas/model_create_server_networking.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateServerNetworking{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerNetworkingGetNetworkIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerNetworkingGetNetworkIdAttributeTypeOk(arg CreateServerNetworkingGetNetworkIdAttributeType) (ret CreateServerNetworkingGetNetworkIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,14 +34,19 @@ func getCreateServerNetworkingGetNetworkIdAttributeTypeOk(arg CreateServerNetwor return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerNetworkingGetNetworkIdAttributeType(arg *CreateServerNetworkingGetNetworkIdAttributeType, val CreateServerNetworkingGetNetworkIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerNetworkingGetNetworkIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerNetworkingGetNetworkIdRetType = string // CreateServerNetworking The initial networking setup for the server creation with a network. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerNetworking struct { // Universally Unique Identifier (UUID). NetworkId CreateServerNetworkingGetNetworkIdAttributeType `json:"networkId,omitempty"` @@ -48,6 +56,7 @@ type CreateServerNetworking struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateServerNetworking() *CreateServerNetworking { this := CreateServerNetworking{} return &this @@ -56,12 +65,14 @@ func NewCreateServerNetworking() *CreateServerNetworking { // NewCreateServerNetworkingWithDefaults instantiates a new CreateServerNetworking object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateServerNetworkingWithDefaults() *CreateServerNetworking { this := CreateServerNetworking{} return &this } // GetNetworkId returns the NetworkId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerNetworking) GetNetworkId() (res CreateServerNetworkingGetNetworkIdRetType) { res, _ = o.GetNetworkIdOk() return @@ -69,21 +80,25 @@ func (o *CreateServerNetworking) GetNetworkId() (res CreateServerNetworkingGetNe // GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerNetworking) GetNetworkIdOk() (ret CreateServerNetworkingGetNetworkIdRetType, ok bool) { return getCreateServerNetworkingGetNetworkIdAttributeTypeOk(o.NetworkId) } // HasNetworkId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerNetworking) HasNetworkId() bool { _, ok := o.GetNetworkIdOk() return ok } // SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerNetworking) SetNetworkId(v CreateServerNetworkingGetNetworkIdRetType) { setCreateServerNetworkingGetNetworkIdAttributeType(&o.NetworkId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateServerNetworking) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateServerNetworkingGetNetworkIdAttributeTypeOk(o.NetworkId); ok { @@ -92,37 +107,45 @@ func (o CreateServerNetworking) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateServerNetworking struct { value *CreateServerNetworking isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerNetworking) Get() *CreateServerNetworking { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerNetworking) Set(val *CreateServerNetworking) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerNetworking) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerNetworking) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateServerNetworking(val *CreateServerNetworking) *NullableCreateServerNetworking { return &NullableCreateServerNetworking{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerNetworking) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerNetworking) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_server_networking_with_nics.go b/services/iaas/model_create_server_networking_with_nics.go index b617acef8..cb50cb8f7 100644 --- a/services/iaas/model_create_server_networking_with_nics.go +++ b/services/iaas/model_create_server_networking_with_nics.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateServerNetworkingWithNics{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerNetworkingWithNicsGetNicIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerNetworkingWithNicsGetNicIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerNetworkingWithNicsGetNicIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(arg CreateServerNetworkingWithNicsGetNicIdsAttributeType) (ret CreateServerNetworkingWithNicsGetNicIdsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(arg CreateServerN return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerNetworkingWithNicsGetNicIdsAttributeType(arg *CreateServerNetworkingWithNicsGetNicIdsAttributeType, val CreateServerNetworkingWithNicsGetNicIdsRetType) { *arg = &val } // CreateServerNetworkingWithNics The initial networking setup for the server creation with a network interface. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerNetworkingWithNics struct { // A list of UUIDs. NicIds CreateServerNetworkingWithNicsGetNicIdsAttributeType `json:"nicIds,omitempty"` @@ -47,6 +56,7 @@ type CreateServerNetworkingWithNics struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateServerNetworkingWithNics() *CreateServerNetworkingWithNics { this := CreateServerNetworkingWithNics{} return &this @@ -55,12 +65,14 @@ func NewCreateServerNetworkingWithNics() *CreateServerNetworkingWithNics { // NewCreateServerNetworkingWithNicsWithDefaults instantiates a new CreateServerNetworkingWithNics object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateServerNetworkingWithNicsWithDefaults() *CreateServerNetworkingWithNics { this := CreateServerNetworkingWithNics{} return &this } // GetNicIds returns the NicIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerNetworkingWithNics) GetNicIds() (res CreateServerNetworkingWithNicsGetNicIdsRetType) { res, _ = o.GetNicIdsOk() return @@ -68,21 +80,25 @@ func (o *CreateServerNetworkingWithNics) GetNicIds() (res CreateServerNetworking // GetNicIdsOk returns a tuple with the NicIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerNetworkingWithNics) GetNicIdsOk() (ret CreateServerNetworkingWithNicsGetNicIdsRetType, ok bool) { return getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(o.NicIds) } // HasNicIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerNetworkingWithNics) HasNicIds() bool { _, ok := o.GetNicIdsOk() return ok } // SetNicIds gets a reference to the given []string and assigns it to the NicIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerNetworkingWithNics) SetNicIds(v CreateServerNetworkingWithNicsGetNicIdsRetType) { setCreateServerNetworkingWithNicsGetNicIdsAttributeType(&o.NicIds, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateServerNetworkingWithNics) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateServerNetworkingWithNicsGetNicIdsAttributeTypeOk(o.NicIds); ok { @@ -91,37 +107,45 @@ func (o CreateServerNetworkingWithNics) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateServerNetworkingWithNics struct { value *CreateServerNetworkingWithNics isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerNetworkingWithNics) Get() *CreateServerNetworkingWithNics { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerNetworkingWithNics) Set(val *CreateServerNetworkingWithNics) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerNetworkingWithNics) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerNetworkingWithNics) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateServerNetworkingWithNics(val *CreateServerNetworkingWithNics) *NullableCreateServerNetworkingWithNics { return &NullableCreateServerNetworkingWithNics{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerNetworkingWithNics) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerNetworkingWithNics) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_server_payload.go b/services/iaas/model_create_server_payload.go index 4d631ff8c..1c3c0ad52 100644 --- a/services/iaas/model_create_server_payload.go +++ b/services/iaas/model_create_server_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &CreateServerPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAffinityGroupAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetAffinityGroupAttributeTypeOk(arg CreateServerPayloadGetAffinityGroupAttributeType) (ret CreateServerPayloadGetAffinityGroupRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getCreateServerPayloadGetAffinityGroupAttributeTypeOk(arg CreateServerPaylo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetAffinityGroupAttributeType(arg *CreateServerPayloadGetAffinityGroupAttributeType, val CreateServerPayloadGetAffinityGroupRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAffinityGroupArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAffinityGroupRetType = string /* @@ -44,10 +51,16 @@ type CreateServerPayloadGetAffinityGroupRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAgentAttributeType = *ServerAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAgentArgType = ServerAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAgentRetType = ServerAgent +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetAgentAttributeTypeOk(arg CreateServerPayloadGetAgentAttributeType) (ret CreateServerPayloadGetAgentRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getCreateServerPayloadGetAgentAttributeTypeOk(arg CreateServerPayloadGetAge return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetAgentAttributeType(arg *CreateServerPayloadGetAgentAttributeType, val CreateServerPayloadGetAgentRetType) { *arg = &val } @@ -64,8 +78,10 @@ func setCreateServerPayloadGetAgentAttributeType(arg *CreateServerPayloadGetAgen */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAvailabilityZoneAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(arg CreateServerPayloadGetAvailabilityZoneAttributeType) (ret CreateServerPayloadGetAvailabilityZoneRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(arg CreateServerPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetAvailabilityZoneAttributeType(arg *CreateServerPayloadGetAvailabilityZoneAttributeType, val CreateServerPayloadGetAvailabilityZoneRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAvailabilityZoneArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetAvailabilityZoneRetType = string /* @@ -85,10 +105,16 @@ type CreateServerPayloadGetAvailabilityZoneRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetBootVolumeAttributeType = *ServerBootVolume + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetBootVolumeArgType = ServerBootVolume + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetBootVolumeRetType = ServerBootVolume +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetBootVolumeAttributeTypeOk(arg CreateServerPayloadGetBootVolumeAttributeType) (ret CreateServerPayloadGetBootVolumeRetType, ok bool) { if arg == nil { return ret, false @@ -96,6 +122,7 @@ func getCreateServerPayloadGetBootVolumeAttributeTypeOk(arg CreateServerPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetBootVolumeAttributeType(arg *CreateServerPayloadGetBootVolumeAttributeType, val CreateServerPayloadGetBootVolumeRetType) { *arg = &val } @@ -105,10 +132,16 @@ func setCreateServerPayloadGetBootVolumeAttributeType(arg *CreateServerPayloadGe */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetCreatedAtAttributeTypeOk(arg CreateServerPayloadGetCreatedAtAttributeType) (ret CreateServerPayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getCreateServerPayloadGetCreatedAtAttributeTypeOk(arg CreateServerPayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetCreatedAtAttributeType(arg *CreateServerPayloadGetCreatedAtAttributeType, val CreateServerPayloadGetCreatedAtRetType) { *arg = &val } @@ -125,8 +159,10 @@ func setCreateServerPayloadGetCreatedAtAttributeType(arg *CreateServerPayloadGet */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetErrorMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetErrorMessageAttributeTypeOk(arg CreateServerPayloadGetErrorMessageAttributeType) (ret CreateServerPayloadGetErrorMessageRetType, ok bool) { if arg == nil { return ret, false @@ -134,11 +170,15 @@ func getCreateServerPayloadGetErrorMessageAttributeTypeOk(arg CreateServerPayloa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetErrorMessageAttributeType(arg *CreateServerPayloadGetErrorMessageAttributeType, val CreateServerPayloadGetErrorMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetErrorMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetErrorMessageRetType = string /* @@ -146,8 +186,10 @@ type CreateServerPayloadGetErrorMessageRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetIdAttributeTypeOk(arg CreateServerPayloadGetIdAttributeType) (ret CreateServerPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -155,11 +197,15 @@ func getCreateServerPayloadGetIdAttributeTypeOk(arg CreateServerPayloadGetIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetIdAttributeType(arg *CreateServerPayloadGetIdAttributeType, val CreateServerPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetIdRetType = string /* @@ -167,8 +213,10 @@ type CreateServerPayloadGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetImageIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetImageIdAttributeTypeOk(arg CreateServerPayloadGetImageIdAttributeType) (ret CreateServerPayloadGetImageIdRetType, ok bool) { if arg == nil { return ret, false @@ -176,11 +224,15 @@ func getCreateServerPayloadGetImageIdAttributeTypeOk(arg CreateServerPayloadGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetImageIdAttributeType(arg *CreateServerPayloadGetImageIdAttributeType, val CreateServerPayloadGetImageIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetImageIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetImageIdRetType = string /* @@ -188,8 +240,10 @@ type CreateServerPayloadGetImageIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetKeypairNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetKeypairNameAttributeTypeOk(arg CreateServerPayloadGetKeypairNameAttributeType) (ret CreateServerPayloadGetKeypairNameRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +251,15 @@ func getCreateServerPayloadGetKeypairNameAttributeTypeOk(arg CreateServerPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetKeypairNameAttributeType(arg *CreateServerPayloadGetKeypairNameAttributeType, val CreateServerPayloadGetKeypairNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetKeypairNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetKeypairNameRetType = string /* @@ -209,10 +267,16 @@ type CreateServerPayloadGetKeypairNameRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetLabelsAttributeTypeOk(arg CreateServerPayloadGetLabelsAttributeType) (ret CreateServerPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -220,6 +284,7 @@ func getCreateServerPayloadGetLabelsAttributeTypeOk(arg CreateServerPayloadGetLa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetLabelsAttributeType(arg *CreateServerPayloadGetLabelsAttributeType, val CreateServerPayloadGetLabelsRetType) { *arg = &val } @@ -229,10 +294,16 @@ func setCreateServerPayloadGetLabelsAttributeType(arg *CreateServerPayloadGetLab */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetLaunchedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetLaunchedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetLaunchedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetLaunchedAtAttributeTypeOk(arg CreateServerPayloadGetLaunchedAtAttributeType) (ret CreateServerPayloadGetLaunchedAtRetType, ok bool) { if arg == nil { return ret, false @@ -240,6 +311,7 @@ func getCreateServerPayloadGetLaunchedAtAttributeTypeOk(arg CreateServerPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetLaunchedAtAttributeType(arg *CreateServerPayloadGetLaunchedAtAttributeType, val CreateServerPayloadGetLaunchedAtRetType) { *arg = &val } @@ -249,8 +321,10 @@ func setCreateServerPayloadGetLaunchedAtAttributeType(arg *CreateServerPayloadGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMachineTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetMachineTypeAttributeTypeOk(arg CreateServerPayloadGetMachineTypeAttributeType) (ret CreateServerPayloadGetMachineTypeRetType, ok bool) { if arg == nil { return ret, false @@ -258,11 +332,15 @@ func getCreateServerPayloadGetMachineTypeAttributeTypeOk(arg CreateServerPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetMachineTypeAttributeType(arg *CreateServerPayloadGetMachineTypeAttributeType, val CreateServerPayloadGetMachineTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMachineTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMachineTypeRetType = string /* @@ -270,10 +348,16 @@ type CreateServerPayloadGetMachineTypeRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMaintenanceWindowAttributeType = *ServerMaintenance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMaintenanceWindowArgType = ServerMaintenance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMaintenanceWindowRetType = ServerMaintenance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(arg CreateServerPayloadGetMaintenanceWindowAttributeType) (ret CreateServerPayloadGetMaintenanceWindowRetType, ok bool) { if arg == nil { return ret, false @@ -281,6 +365,7 @@ func getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(arg CreateServerP return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetMaintenanceWindowAttributeType(arg *CreateServerPayloadGetMaintenanceWindowAttributeType, val CreateServerPayloadGetMaintenanceWindowRetType) { *arg = &val } @@ -290,10 +375,16 @@ func setCreateServerPayloadGetMaintenanceWindowAttributeType(arg *CreateServerPa */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMetadataAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMetadataArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetMetadataRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetMetadataAttributeTypeOk(arg CreateServerPayloadGetMetadataAttributeType) (ret CreateServerPayloadGetMetadataRetType, ok bool) { if arg == nil { return ret, false @@ -301,6 +392,7 @@ func getCreateServerPayloadGetMetadataAttributeTypeOk(arg CreateServerPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetMetadataAttributeType(arg *CreateServerPayloadGetMetadataAttributeType, val CreateServerPayloadGetMetadataRetType) { *arg = &val } @@ -310,8 +402,10 @@ func setCreateServerPayloadGetMetadataAttributeType(arg *CreateServerPayloadGetM */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetNameAttributeTypeOk(arg CreateServerPayloadGetNameAttributeType) (ret CreateServerPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -319,11 +413,15 @@ func getCreateServerPayloadGetNameAttributeTypeOk(arg CreateServerPayloadGetName return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetNameAttributeType(arg *CreateServerPayloadGetNameAttributeType, val CreateServerPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNameRetType = string /* @@ -331,10 +429,16 @@ type CreateServerPayloadGetNameRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNetworkingAttributeType = *CreateServerPayloadAllOfNetworking + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNetworkingArgType = CreateServerPayloadAllOfNetworking + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNetworkingRetType = CreateServerPayloadAllOfNetworking +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetNetworkingAttributeTypeOk(arg CreateServerPayloadGetNetworkingAttributeType) (ret CreateServerPayloadGetNetworkingRetType, ok bool) { if arg == nil { return ret, false @@ -342,6 +446,7 @@ func getCreateServerPayloadGetNetworkingAttributeTypeOk(arg CreateServerPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetNetworkingAttributeType(arg *CreateServerPayloadGetNetworkingAttributeType, val CreateServerPayloadGetNetworkingRetType) { *arg = &val } @@ -351,10 +456,16 @@ func setCreateServerPayloadGetNetworkingAttributeType(arg *CreateServerPayloadGe */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNicsAttributeType = *[]ServerNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNicsArgType = []ServerNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetNicsRetType = []ServerNetwork +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetNicsAttributeTypeOk(arg CreateServerPayloadGetNicsAttributeType) (ret CreateServerPayloadGetNicsRetType, ok bool) { if arg == nil { return ret, false @@ -362,6 +473,7 @@ func getCreateServerPayloadGetNicsAttributeTypeOk(arg CreateServerPayloadGetNics return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetNicsAttributeType(arg *CreateServerPayloadGetNicsAttributeType, val CreateServerPayloadGetNicsRetType) { *arg = &val } @@ -371,8 +483,10 @@ func setCreateServerPayloadGetNicsAttributeType(arg *CreateServerPayloadGetNicsA */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetPowerStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetPowerStatusAttributeTypeOk(arg CreateServerPayloadGetPowerStatusAttributeType) (ret CreateServerPayloadGetPowerStatusRetType, ok bool) { if arg == nil { return ret, false @@ -380,11 +494,15 @@ func getCreateServerPayloadGetPowerStatusAttributeTypeOk(arg CreateServerPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetPowerStatusAttributeType(arg *CreateServerPayloadGetPowerStatusAttributeType, val CreateServerPayloadGetPowerStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetPowerStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetPowerStatusRetType = string /* @@ -392,10 +510,16 @@ type CreateServerPayloadGetPowerStatusRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetSecurityGroupsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetSecurityGroupsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetSecurityGroupsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(arg CreateServerPayloadGetSecurityGroupsAttributeType) (ret CreateServerPayloadGetSecurityGroupsRetType, ok bool) { if arg == nil { return ret, false @@ -403,6 +527,7 @@ func getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(arg CreateServerPayl return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetSecurityGroupsAttributeType(arg *CreateServerPayloadGetSecurityGroupsAttributeType, val CreateServerPayloadGetSecurityGroupsRetType) { *arg = &val } @@ -412,10 +537,16 @@ func setCreateServerPayloadGetSecurityGroupsAttributeType(arg *CreateServerPaylo */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetServiceAccountMailsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetServiceAccountMailsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetServiceAccountMailsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(arg CreateServerPayloadGetServiceAccountMailsAttributeType) (ret CreateServerPayloadGetServiceAccountMailsRetType, ok bool) { if arg == nil { return ret, false @@ -423,6 +554,7 @@ func getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(arg CreateServe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetServiceAccountMailsAttributeType(arg *CreateServerPayloadGetServiceAccountMailsAttributeType, val CreateServerPayloadGetServiceAccountMailsRetType) { *arg = &val } @@ -432,8 +564,10 @@ func setCreateServerPayloadGetServiceAccountMailsAttributeType(arg *CreateServer */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetStatusAttributeTypeOk(arg CreateServerPayloadGetStatusAttributeType) (ret CreateServerPayloadGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -441,11 +575,15 @@ func getCreateServerPayloadGetStatusAttributeTypeOk(arg CreateServerPayloadGetSt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetStatusAttributeType(arg *CreateServerPayloadGetStatusAttributeType, val CreateServerPayloadGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetStatusRetType = string /* @@ -453,10 +591,16 @@ type CreateServerPayloadGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetUpdatedAtAttributeTypeOk(arg CreateServerPayloadGetUpdatedAtAttributeType) (ret CreateServerPayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -464,6 +608,7 @@ func getCreateServerPayloadGetUpdatedAtAttributeTypeOk(arg CreateServerPayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetUpdatedAtAttributeType(arg *CreateServerPayloadGetUpdatedAtAttributeType, val CreateServerPayloadGetUpdatedAtRetType) { *arg = &val } @@ -473,10 +618,16 @@ func setCreateServerPayloadGetUpdatedAtAttributeType(arg *CreateServerPayloadGet */ // isByteArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetUserDataAttributeType = *[]byte + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetUserDataArgType = []byte + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetUserDataRetType = []byte +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetUserDataAttributeTypeOk(arg CreateServerPayloadGetUserDataAttributeType) (ret CreateServerPayloadGetUserDataRetType, ok bool) { if arg == nil { return ret, false @@ -484,6 +635,7 @@ func getCreateServerPayloadGetUserDataAttributeTypeOk(arg CreateServerPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetUserDataAttributeType(arg *CreateServerPayloadGetUserDataAttributeType, val CreateServerPayloadGetUserDataRetType) { *arg = &val } @@ -493,10 +645,16 @@ func setCreateServerPayloadGetUserDataAttributeType(arg *CreateServerPayloadGetU */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetVolumesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetVolumesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadGetVolumesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadGetVolumesAttributeTypeOk(arg CreateServerPayloadGetVolumesAttributeType) (ret CreateServerPayloadGetVolumesRetType, ok bool) { if arg == nil { return ret, false @@ -504,11 +662,13 @@ func getCreateServerPayloadGetVolumesAttributeTypeOk(arg CreateServerPayloadGetV return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadGetVolumesAttributeType(arg *CreateServerPayloadGetVolumesAttributeType, val CreateServerPayloadGetVolumesRetType) { *arg = &val } // CreateServerPayload Object that represents the request body for a server create. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayload struct { // Universally Unique Identifier (UUID). AffinityGroup CreateServerPayloadGetAffinityGroupAttributeType `json:"affinityGroup,omitempty"` @@ -526,7 +686,7 @@ type CreateServerPayload struct { ImageId CreateServerPayloadGetImageIdAttributeType `json:"imageId,omitempty"` // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. KeypairName CreateServerPayloadGetKeypairNameAttributeType `json:"keypairName,omitempty"` - // 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. + // 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. Labels CreateServerPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Date-time when resource was launched. LaunchedAt CreateServerPayloadGetLaunchedAtAttributeType `json:"launchedAt,omitempty"` @@ -559,12 +719,14 @@ type CreateServerPayload struct { Volumes CreateServerPayloadGetVolumesAttributeType `json:"volumes,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateServerPayload CreateServerPayload // NewCreateServerPayload instantiates a new CreateServerPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateServerPayload(machineType CreateServerPayloadGetMachineTypeArgType, name CreateServerPayloadGetNameArgType, networking CreateServerPayloadGetNetworkingArgType) *CreateServerPayload { this := CreateServerPayload{} setCreateServerPayloadGetMachineTypeAttributeType(&this.MachineType, machineType) @@ -576,12 +738,14 @@ func NewCreateServerPayload(machineType CreateServerPayloadGetMachineTypeArgType // NewCreateServerPayloadWithDefaults instantiates a new CreateServerPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateServerPayloadWithDefaults() *CreateServerPayload { this := CreateServerPayload{} return &this } // GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetAffinityGroup() (res CreateServerPayloadGetAffinityGroupRetType) { res, _ = o.GetAffinityGroupOk() return @@ -589,22 +753,26 @@ func (o *CreateServerPayload) GetAffinityGroup() (res CreateServerPayloadGetAffi // GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetAffinityGroupOk() (ret CreateServerPayloadGetAffinityGroupRetType, ok bool) { return getCreateServerPayloadGetAffinityGroupAttributeTypeOk(o.AffinityGroup) } // HasAffinityGroup returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasAffinityGroup() bool { _, ok := o.GetAffinityGroupOk() return ok } // SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetAffinityGroup(v CreateServerPayloadGetAffinityGroupRetType) { setCreateServerPayloadGetAffinityGroupAttributeType(&o.AffinityGroup, v) } // GetAgent returns the Agent field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetAgent() (res CreateServerPayloadGetAgentRetType) { res, _ = o.GetAgentOk() return @@ -612,22 +780,26 @@ func (o *CreateServerPayload) GetAgent() (res CreateServerPayloadGetAgentRetType // GetAgentOk returns a tuple with the Agent field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetAgentOk() (ret CreateServerPayloadGetAgentRetType, ok bool) { return getCreateServerPayloadGetAgentAttributeTypeOk(o.Agent) } // HasAgent returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasAgent() bool { _, ok := o.GetAgentOk() return ok } // SetAgent gets a reference to the given ServerAgent and assigns it to the Agent field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetAgent(v CreateServerPayloadGetAgentRetType) { setCreateServerPayloadGetAgentAttributeType(&o.Agent, v) } // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetAvailabilityZone() (res CreateServerPayloadGetAvailabilityZoneRetType) { res, _ = o.GetAvailabilityZoneOk() return @@ -635,22 +807,26 @@ func (o *CreateServerPayload) GetAvailabilityZone() (res CreateServerPayloadGetA // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetAvailabilityZoneOk() (ret CreateServerPayloadGetAvailabilityZoneRetType, ok bool) { return getCreateServerPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // HasAvailabilityZone returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasAvailabilityZone() bool { _, ok := o.GetAvailabilityZoneOk() return ok } // SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetAvailabilityZone(v CreateServerPayloadGetAvailabilityZoneRetType) { setCreateServerPayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetBootVolume returns the BootVolume field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetBootVolume() (res CreateServerPayloadGetBootVolumeRetType) { res, _ = o.GetBootVolumeOk() return @@ -658,22 +834,26 @@ func (o *CreateServerPayload) GetBootVolume() (res CreateServerPayloadGetBootVol // GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetBootVolumeOk() (ret CreateServerPayloadGetBootVolumeRetType, ok bool) { return getCreateServerPayloadGetBootVolumeAttributeTypeOk(o.BootVolume) } // HasBootVolume returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasBootVolume() bool { _, ok := o.GetBootVolumeOk() return ok } // SetBootVolume gets a reference to the given ServerBootVolume and assigns it to the BootVolume field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetBootVolume(v CreateServerPayloadGetBootVolumeRetType) { setCreateServerPayloadGetBootVolumeAttributeType(&o.BootVolume, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetCreatedAt() (res CreateServerPayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -681,22 +861,26 @@ func (o *CreateServerPayload) GetCreatedAt() (res CreateServerPayloadGetCreatedA // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetCreatedAtOk() (ret CreateServerPayloadGetCreatedAtRetType, ok bool) { return getCreateServerPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetCreatedAt(v CreateServerPayloadGetCreatedAtRetType) { setCreateServerPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetErrorMessage() (res CreateServerPayloadGetErrorMessageRetType) { res, _ = o.GetErrorMessageOk() return @@ -704,22 +888,26 @@ func (o *CreateServerPayload) GetErrorMessage() (res CreateServerPayloadGetError // GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetErrorMessageOk() (ret CreateServerPayloadGetErrorMessageRetType, ok bool) { return getCreateServerPayloadGetErrorMessageAttributeTypeOk(o.ErrorMessage) } // HasErrorMessage returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasErrorMessage() bool { _, ok := o.GetErrorMessageOk() return ok } // SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetErrorMessage(v CreateServerPayloadGetErrorMessageRetType) { setCreateServerPayloadGetErrorMessageAttributeType(&o.ErrorMessage, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetId() (res CreateServerPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -727,22 +915,26 @@ func (o *CreateServerPayload) GetId() (res CreateServerPayloadGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetIdOk() (ret CreateServerPayloadGetIdRetType, ok bool) { return getCreateServerPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetId(v CreateServerPayloadGetIdRetType) { setCreateServerPayloadGetIdAttributeType(&o.Id, v) } // GetImageId returns the ImageId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetImageId() (res CreateServerPayloadGetImageIdRetType) { res, _ = o.GetImageIdOk() return @@ -750,22 +942,26 @@ func (o *CreateServerPayload) GetImageId() (res CreateServerPayloadGetImageIdRet // GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetImageIdOk() (ret CreateServerPayloadGetImageIdRetType, ok bool) { return getCreateServerPayloadGetImageIdAttributeTypeOk(o.ImageId) } // HasImageId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasImageId() bool { _, ok := o.GetImageIdOk() return ok } // SetImageId gets a reference to the given string and assigns it to the ImageId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetImageId(v CreateServerPayloadGetImageIdRetType) { setCreateServerPayloadGetImageIdAttributeType(&o.ImageId, v) } // GetKeypairName returns the KeypairName field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetKeypairName() (res CreateServerPayloadGetKeypairNameRetType) { res, _ = o.GetKeypairNameOk() return @@ -773,22 +969,26 @@ func (o *CreateServerPayload) GetKeypairName() (res CreateServerPayloadGetKeypai // GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetKeypairNameOk() (ret CreateServerPayloadGetKeypairNameRetType, ok bool) { return getCreateServerPayloadGetKeypairNameAttributeTypeOk(o.KeypairName) } // HasKeypairName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasKeypairName() bool { _, ok := o.GetKeypairNameOk() return ok } // SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetKeypairName(v CreateServerPayloadGetKeypairNameRetType) { setCreateServerPayloadGetKeypairNameAttributeType(&o.KeypairName, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetLabels() (res CreateServerPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -796,22 +996,26 @@ func (o *CreateServerPayload) GetLabels() (res CreateServerPayloadGetLabelsRetTy // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetLabelsOk() (ret CreateServerPayloadGetLabelsRetType, ok bool) { return getCreateServerPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetLabels(v CreateServerPayloadGetLabelsRetType) { setCreateServerPayloadGetLabelsAttributeType(&o.Labels, v) } // GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetLaunchedAt() (res CreateServerPayloadGetLaunchedAtRetType) { res, _ = o.GetLaunchedAtOk() return @@ -819,22 +1023,26 @@ func (o *CreateServerPayload) GetLaunchedAt() (res CreateServerPayloadGetLaunche // GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetLaunchedAtOk() (ret CreateServerPayloadGetLaunchedAtRetType, ok bool) { return getCreateServerPayloadGetLaunchedAtAttributeTypeOk(o.LaunchedAt) } // HasLaunchedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasLaunchedAt() bool { _, ok := o.GetLaunchedAtOk() return ok } // SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetLaunchedAt(v CreateServerPayloadGetLaunchedAtRetType) { setCreateServerPayloadGetLaunchedAtAttributeType(&o.LaunchedAt, v) } // GetMachineType returns the MachineType field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetMachineType() (ret CreateServerPayloadGetMachineTypeRetType) { ret, _ = o.GetMachineTypeOk() return ret @@ -842,16 +1050,19 @@ func (o *CreateServerPayload) GetMachineType() (ret CreateServerPayloadGetMachin // GetMachineTypeOk returns a tuple with the MachineType field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetMachineTypeOk() (ret CreateServerPayloadGetMachineTypeRetType, ok bool) { return getCreateServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType) } // SetMachineType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetMachineType(v CreateServerPayloadGetMachineTypeRetType) { setCreateServerPayloadGetMachineTypeAttributeType(&o.MachineType, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetMaintenanceWindow() (res CreateServerPayloadGetMaintenanceWindowRetType) { res, _ = o.GetMaintenanceWindowOk() return @@ -859,22 +1070,26 @@ func (o *CreateServerPayload) GetMaintenanceWindow() (res CreateServerPayloadGet // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetMaintenanceWindowOk() (ret CreateServerPayloadGetMaintenanceWindowRetType, ok bool) { return getCreateServerPayloadGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // HasMaintenanceWindow returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasMaintenanceWindow() bool { _, ok := o.GetMaintenanceWindowOk() return ok } // SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetMaintenanceWindow(v CreateServerPayloadGetMaintenanceWindowRetType) { setCreateServerPayloadGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetMetadata returns the Metadata field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetMetadata() (res CreateServerPayloadGetMetadataRetType) { res, _ = o.GetMetadataOk() return @@ -882,22 +1097,26 @@ func (o *CreateServerPayload) GetMetadata() (res CreateServerPayloadGetMetadataR // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetMetadataOk() (ret CreateServerPayloadGetMetadataRetType, ok bool) { return getCreateServerPayloadGetMetadataAttributeTypeOk(o.Metadata) } // HasMetadata returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasMetadata() bool { _, ok := o.GetMetadataOk() return ok } // SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetMetadata(v CreateServerPayloadGetMetadataRetType) { setCreateServerPayloadGetMetadataAttributeType(&o.Metadata, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetName() (ret CreateServerPayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -905,16 +1124,19 @@ func (o *CreateServerPayload) GetName() (ret CreateServerPayloadGetNameRetType) // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetNameOk() (ret CreateServerPayloadGetNameRetType, ok bool) { return getCreateServerPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetName(v CreateServerPayloadGetNameRetType) { setCreateServerPayloadGetNameAttributeType(&o.Name, v) } // GetNetworking returns the Networking field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetNetworking() (ret CreateServerPayloadGetNetworkingRetType) { ret, _ = o.GetNetworkingOk() return ret @@ -922,16 +1144,19 @@ func (o *CreateServerPayload) GetNetworking() (ret CreateServerPayloadGetNetwork // GetNetworkingOk returns a tuple with the Networking field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetNetworkingOk() (ret CreateServerPayloadGetNetworkingRetType, ok bool) { return getCreateServerPayloadGetNetworkingAttributeTypeOk(o.Networking) } // SetNetworking sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetNetworking(v CreateServerPayloadGetNetworkingRetType) { setCreateServerPayloadGetNetworkingAttributeType(&o.Networking, v) } // GetNics returns the Nics field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetNics() (res CreateServerPayloadGetNicsRetType) { res, _ = o.GetNicsOk() return @@ -939,22 +1164,26 @@ func (o *CreateServerPayload) GetNics() (res CreateServerPayloadGetNicsRetType) // GetNicsOk returns a tuple with the Nics field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetNicsOk() (ret CreateServerPayloadGetNicsRetType, ok bool) { return getCreateServerPayloadGetNicsAttributeTypeOk(o.Nics) } // HasNics returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasNics() bool { _, ok := o.GetNicsOk() return ok } // SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetNics(v CreateServerPayloadGetNicsRetType) { setCreateServerPayloadGetNicsAttributeType(&o.Nics, v) } // GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetPowerStatus() (res CreateServerPayloadGetPowerStatusRetType) { res, _ = o.GetPowerStatusOk() return @@ -962,22 +1191,26 @@ func (o *CreateServerPayload) GetPowerStatus() (res CreateServerPayloadGetPowerS // GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetPowerStatusOk() (ret CreateServerPayloadGetPowerStatusRetType, ok bool) { return getCreateServerPayloadGetPowerStatusAttributeTypeOk(o.PowerStatus) } // HasPowerStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasPowerStatus() bool { _, ok := o.GetPowerStatusOk() return ok } // SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetPowerStatus(v CreateServerPayloadGetPowerStatusRetType) { setCreateServerPayloadGetPowerStatusAttributeType(&o.PowerStatus, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetSecurityGroups() (res CreateServerPayloadGetSecurityGroupsRetType) { res, _ = o.GetSecurityGroupsOk() return @@ -985,22 +1218,26 @@ func (o *CreateServerPayload) GetSecurityGroups() (res CreateServerPayloadGetSec // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetSecurityGroupsOk() (ret CreateServerPayloadGetSecurityGroupsRetType, ok bool) { return getCreateServerPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasSecurityGroups() bool { _, ok := o.GetSecurityGroupsOk() return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetSecurityGroups(v CreateServerPayloadGetSecurityGroupsRetType) { setCreateServerPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetServiceAccountMails() (res CreateServerPayloadGetServiceAccountMailsRetType) { res, _ = o.GetServiceAccountMailsOk() return @@ -1008,22 +1245,26 @@ func (o *CreateServerPayload) GetServiceAccountMails() (res CreateServerPayloadG // GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetServiceAccountMailsOk() (ret CreateServerPayloadGetServiceAccountMailsRetType, ok bool) { return getCreateServerPayloadGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails) } // HasServiceAccountMails returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasServiceAccountMails() bool { _, ok := o.GetServiceAccountMailsOk() return ok } // SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetServiceAccountMails(v CreateServerPayloadGetServiceAccountMailsRetType) { setCreateServerPayloadGetServiceAccountMailsAttributeType(&o.ServiceAccountMails, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetStatus() (res CreateServerPayloadGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -1031,22 +1272,26 @@ func (o *CreateServerPayload) GetStatus() (res CreateServerPayloadGetStatusRetTy // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetStatusOk() (ret CreateServerPayloadGetStatusRetType, ok bool) { return getCreateServerPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetStatus(v CreateServerPayloadGetStatusRetType) { setCreateServerPayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetUpdatedAt() (res CreateServerPayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -1054,22 +1299,26 @@ func (o *CreateServerPayload) GetUpdatedAt() (res CreateServerPayloadGetUpdatedA // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetUpdatedAtOk() (ret CreateServerPayloadGetUpdatedAtRetType, ok bool) { return getCreateServerPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetUpdatedAt(v CreateServerPayloadGetUpdatedAtRetType) { setCreateServerPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetUserData returns the UserData field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetUserData() (res CreateServerPayloadGetUserDataRetType) { res, _ = o.GetUserDataOk() return @@ -1077,22 +1326,26 @@ func (o *CreateServerPayload) GetUserData() (res CreateServerPayloadGetUserDataR // GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetUserDataOk() (ret CreateServerPayloadGetUserDataRetType, ok bool) { return getCreateServerPayloadGetUserDataAttributeTypeOk(o.UserData) } // HasUserData returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasUserData() bool { _, ok := o.GetUserDataOk() return ok } // SetUserData gets a reference to the given string and assigns it to the UserData field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetUserData(v CreateServerPayloadGetUserDataRetType) { setCreateServerPayloadGetUserDataAttributeType(&o.UserData, v) } // GetVolumes returns the Volumes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetVolumes() (res CreateServerPayloadGetVolumesRetType) { res, _ = o.GetVolumesOk() return @@ -1100,21 +1353,25 @@ func (o *CreateServerPayload) GetVolumes() (res CreateServerPayloadGetVolumesRet // GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) GetVolumesOk() (ret CreateServerPayloadGetVolumesRetType, ok bool) { return getCreateServerPayloadGetVolumesAttributeTypeOk(o.Volumes) } // HasVolumes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) HasVolumes() bool { _, ok := o.GetVolumesOk() return ok } // SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayload) SetVolumes(v CreateServerPayloadGetVolumesRetType) { setCreateServerPayloadGetVolumesAttributeType(&o.Volumes, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateServerPayloadGetAffinityGroupAttributeTypeOk(o.AffinityGroup); ok { @@ -1192,37 +1449,45 @@ func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateServerPayload struct { value *CreateServerPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayload) Get() *CreateServerPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayload) Set(val *CreateServerPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateServerPayload(val *CreateServerPayload) *NullableCreateServerPayload { return &NullableCreateServerPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_server_payload_all_of.go b/services/iaas/model_create_server_payload_all_of.go index 323f4dbf4..8e061bb63 100644 --- a/services/iaas/model_create_server_payload_all_of.go +++ b/services/iaas/model_create_server_payload_all_of.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateServerPayloadAllOf{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadAllOfGetNetworkingAttributeType = *CreateServerPayloadAllOfNetworking + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadAllOfGetNetworkingArgType = CreateServerPayloadAllOfNetworking + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadAllOfGetNetworkingRetType = CreateServerPayloadAllOfNetworking +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateServerPayloadAllOfGetNetworkingAttributeTypeOk(arg CreateServerPayloadAllOfGetNetworkingAttributeType) (ret CreateServerPayloadAllOfGetNetworkingRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getCreateServerPayloadAllOfGetNetworkingAttributeTypeOk(arg CreateServerPay return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateServerPayloadAllOfGetNetworkingAttributeType(arg *CreateServerPayloadAllOfGetNetworkingAttributeType, val CreateServerPayloadAllOfGetNetworkingRetType) { *arg = &val } // CreateServerPayloadAllOf struct for CreateServerPayloadAllOf +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadAllOf struct { // REQUIRED Networking CreateServerPayloadAllOfGetNetworkingAttributeType `json:"networking" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateServerPayloadAllOf CreateServerPayloadAllOf // NewCreateServerPayloadAllOf instantiates a new CreateServerPayloadAllOf object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateServerPayloadAllOf(networking CreateServerPayloadAllOfGetNetworkingArgType) *CreateServerPayloadAllOf { this := CreateServerPayloadAllOf{} setCreateServerPayloadAllOfGetNetworkingAttributeType(&this.Networking, networking) @@ -58,12 +69,14 @@ func NewCreateServerPayloadAllOf(networking CreateServerPayloadAllOfGetNetworkin // NewCreateServerPayloadAllOfWithDefaults instantiates a new CreateServerPayloadAllOf object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateServerPayloadAllOfWithDefaults() *CreateServerPayloadAllOf { this := CreateServerPayloadAllOf{} return &this } // GetNetworking returns the Networking field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayloadAllOf) GetNetworking() (ret CreateServerPayloadAllOfGetNetworkingRetType) { ret, _ = o.GetNetworkingOk() return ret @@ -71,15 +84,18 @@ func (o *CreateServerPayloadAllOf) GetNetworking() (ret CreateServerPayloadAllOf // GetNetworkingOk returns a tuple with the Networking field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayloadAllOf) GetNetworkingOk() (ret CreateServerPayloadAllOfGetNetworkingRetType, ok bool) { return getCreateServerPayloadAllOfGetNetworkingAttributeTypeOk(o.Networking) } // SetNetworking sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateServerPayloadAllOf) SetNetworking(v CreateServerPayloadAllOfGetNetworkingRetType) { setCreateServerPayloadAllOfGetNetworkingAttributeType(&o.Networking, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateServerPayloadAllOf) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateServerPayloadAllOfGetNetworkingAttributeTypeOk(o.Networking); ok { @@ -88,37 +104,45 @@ func (o CreateServerPayloadAllOf) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateServerPayloadAllOf struct { value *CreateServerPayloadAllOf isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayloadAllOf) Get() *CreateServerPayloadAllOf { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayloadAllOf) Set(val *CreateServerPayloadAllOf) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayloadAllOf) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayloadAllOf) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateServerPayloadAllOf(val *CreateServerPayloadAllOf) *NullableCreateServerPayloadAllOf { return &NullableCreateServerPayloadAllOf{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayloadAllOf) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayloadAllOf) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_server_payload_all_of_networking.go b/services/iaas/model_create_server_payload_all_of_networking.go index 3316a9f3d..7b511d745 100644 --- a/services/iaas/model_create_server_payload_all_of_networking.go +++ b/services/iaas/model_create_server_payload_all_of_networking.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -16,12 +17,14 @@ import ( ) // CreateServerPayloadAllOfNetworking - struct for CreateServerPayloadAllOfNetworking +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateServerPayloadAllOfNetworking struct { CreateServerNetworking *CreateServerNetworking CreateServerNetworkingWithNics *CreateServerNetworkingWithNics } // CreateServerNetworkingAsCreateServerPayloadAllOfNetworking is a convenience function that returns CreateServerNetworking wrapped in CreateServerPayloadAllOfNetworking +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateServerNetworkingAsCreateServerPayloadAllOfNetworking(v *CreateServerNetworking) CreateServerPayloadAllOfNetworking { return CreateServerPayloadAllOfNetworking{ CreateServerNetworking: v, @@ -29,6 +32,7 @@ func CreateServerNetworkingAsCreateServerPayloadAllOfNetworking(v *CreateServerN } // CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in CreateServerPayloadAllOfNetworking +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking(v *CreateServerNetworkingWithNics) CreateServerPayloadAllOfNetworking { return CreateServerPayloadAllOfNetworking{ CreateServerNetworkingWithNics: v, @@ -36,6 +40,7 @@ func CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking(v *Creat } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *CreateServerPayloadAllOfNetworking) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -79,6 +84,7 @@ func (dst *CreateServerPayloadAllOfNetworking) UnmarshalJSON(data []byte) error // Marshal data from the first non-nil pointers in the struct to JSON func (src CreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.CreateServerNetworking != nil { return json.Marshal(&src.CreateServerNetworking) } @@ -91,6 +97,7 @@ func (src CreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *CreateServerPayloadAllOfNetworking) GetActualInstance() interface{} { if obj == nil { return nil @@ -107,37 +114,45 @@ func (obj *CreateServerPayloadAllOfNetworking) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateServerPayloadAllOfNetworking struct { value *CreateServerPayloadAllOfNetworking isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayloadAllOfNetworking) Get() *CreateServerPayloadAllOfNetworking { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayloadAllOfNetworking) Set(val *CreateServerPayloadAllOfNetworking) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayloadAllOfNetworking) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayloadAllOfNetworking) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateServerPayloadAllOfNetworking(val *CreateServerPayloadAllOfNetworking) *NullableCreateServerPayloadAllOfNetworking { return &NullableCreateServerPayloadAllOfNetworking{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateServerPayloadAllOfNetworking) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_snapshot_payload.go b/services/iaas/model_create_snapshot_payload.go index 40ac21e12..bed3eecde 100644 --- a/services/iaas/model_create_snapshot_payload.go +++ b/services/iaas/model_create_snapshot_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &CreateSnapshotPayload{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(arg CreateSnapshotPayloadGetCreatedAtAttributeType) (ret CreateSnapshotPayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(arg CreateSnapshotPaylo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSnapshotPayloadGetCreatedAtAttributeType(arg *CreateSnapshotPayloadGetCreatedAtAttributeType, val CreateSnapshotPayloadGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setCreateSnapshotPayloadGetCreatedAtAttributeType(arg *CreateSnapshotPayloa */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSnapshotPayloadGetIdAttributeTypeOk(arg CreateSnapshotPayloadGetIdAttributeType) (ret CreateSnapshotPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getCreateSnapshotPayloadGetIdAttributeTypeOk(arg CreateSnapshotPayloadGetId return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSnapshotPayloadGetIdAttributeType(arg *CreateSnapshotPayloadGetIdAttributeType, val CreateSnapshotPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetIdRetType = string /* @@ -64,10 +78,16 @@ type CreateSnapshotPayloadGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSnapshotPayloadGetLabelsAttributeTypeOk(arg CreateSnapshotPayloadGetLabelsAttributeType) (ret CreateSnapshotPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getCreateSnapshotPayloadGetLabelsAttributeTypeOk(arg CreateSnapshotPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSnapshotPayloadGetLabelsAttributeType(arg *CreateSnapshotPayloadGetLabelsAttributeType, val CreateSnapshotPayloadGetLabelsRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setCreateSnapshotPayloadGetLabelsAttributeType(arg *CreateSnapshotPayloadGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSnapshotPayloadGetNameAttributeTypeOk(arg CreateSnapshotPayloadGetNameAttributeType) (ret CreateSnapshotPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getCreateSnapshotPayloadGetNameAttributeTypeOk(arg CreateSnapshotPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSnapshotPayloadGetNameAttributeType(arg *CreateSnapshotPayloadGetNameAttributeType, val CreateSnapshotPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetNameRetType = string /* @@ -105,10 +132,16 @@ type CreateSnapshotPayloadGetNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSnapshotPayloadGetSizeAttributeTypeOk(arg CreateSnapshotPayloadGetSizeAttributeType) (ret CreateSnapshotPayloadGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getCreateSnapshotPayloadGetSizeAttributeTypeOk(arg CreateSnapshotPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSnapshotPayloadGetSizeAttributeType(arg *CreateSnapshotPayloadGetSizeAttributeType, val CreateSnapshotPayloadGetSizeRetType) { *arg = &val } @@ -125,8 +159,10 @@ func setCreateSnapshotPayloadGetSizeAttributeType(arg *CreateSnapshotPayloadGetS */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSnapshotPayloadGetStatusAttributeTypeOk(arg CreateSnapshotPayloadGetStatusAttributeType) (ret CreateSnapshotPayloadGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -134,11 +170,15 @@ func getCreateSnapshotPayloadGetStatusAttributeTypeOk(arg CreateSnapshotPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSnapshotPayloadGetStatusAttributeType(arg *CreateSnapshotPayloadGetStatusAttributeType, val CreateSnapshotPayloadGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetStatusRetType = string /* @@ -146,10 +186,16 @@ type CreateSnapshotPayloadGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(arg CreateSnapshotPayloadGetUpdatedAtAttributeType) (ret CreateSnapshotPayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -157,6 +203,7 @@ func getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(arg CreateSnapshotPaylo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSnapshotPayloadGetUpdatedAtAttributeType(arg *CreateSnapshotPayloadGetUpdatedAtAttributeType, val CreateSnapshotPayloadGetUpdatedAtRetType) { *arg = &val } @@ -166,8 +213,10 @@ func setCreateSnapshotPayloadGetUpdatedAtAttributeType(arg *CreateSnapshotPayloa */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(arg CreateSnapshotPayloadGetVolumeIdAttributeType) (ret CreateSnapshotPayloadGetVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -175,20 +224,25 @@ func getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(arg CreateSnapshotPayloa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateSnapshotPayloadGetVolumeIdAttributeType(arg *CreateSnapshotPayloadGetVolumeIdAttributeType, val CreateSnapshotPayloadGetVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayloadGetVolumeIdRetType = string // CreateSnapshotPayload Object that represents a snapshot. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateSnapshotPayload struct { // Date-time when resource was created. CreatedAt CreateSnapshotPayloadGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). Id CreateSnapshotPayloadGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels CreateSnapshotPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name CreateSnapshotPayloadGetNameAttributeType `json:"name,omitempty"` @@ -203,12 +257,14 @@ type CreateSnapshotPayload struct { VolumeId CreateSnapshotPayloadGetVolumeIdAttributeType `json:"volumeId" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateSnapshotPayload CreateSnapshotPayload // NewCreateSnapshotPayload instantiates a new CreateSnapshotPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateSnapshotPayload(volumeId CreateSnapshotPayloadGetVolumeIdArgType) *CreateSnapshotPayload { this := CreateSnapshotPayload{} setCreateSnapshotPayloadGetVolumeIdAttributeType(&this.VolumeId, volumeId) @@ -218,12 +274,14 @@ func NewCreateSnapshotPayload(volumeId CreateSnapshotPayloadGetVolumeIdArgType) // NewCreateSnapshotPayloadWithDefaults instantiates a new CreateSnapshotPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateSnapshotPayloadWithDefaults() *CreateSnapshotPayload { this := CreateSnapshotPayload{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetCreatedAt() (res CreateSnapshotPayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -231,22 +289,26 @@ func (o *CreateSnapshotPayload) GetCreatedAt() (res CreateSnapshotPayloadGetCrea // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetCreatedAtOk() (ret CreateSnapshotPayloadGetCreatedAtRetType, ok bool) { return getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) SetCreatedAt(v CreateSnapshotPayloadGetCreatedAtRetType) { setCreateSnapshotPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetId() (res CreateSnapshotPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -254,22 +316,26 @@ func (o *CreateSnapshotPayload) GetId() (res CreateSnapshotPayloadGetIdRetType) // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetIdOk() (ret CreateSnapshotPayloadGetIdRetType, ok bool) { return getCreateSnapshotPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) SetId(v CreateSnapshotPayloadGetIdRetType) { setCreateSnapshotPayloadGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetLabels() (res CreateSnapshotPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -277,22 +343,26 @@ func (o *CreateSnapshotPayload) GetLabels() (res CreateSnapshotPayloadGetLabelsR // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetLabelsOk() (ret CreateSnapshotPayloadGetLabelsRetType, ok bool) { return getCreateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) SetLabels(v CreateSnapshotPayloadGetLabelsRetType) { setCreateSnapshotPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetName() (res CreateSnapshotPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -300,22 +370,26 @@ func (o *CreateSnapshotPayload) GetName() (res CreateSnapshotPayloadGetNameRetTy // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetNameOk() (ret CreateSnapshotPayloadGetNameRetType, ok bool) { return getCreateSnapshotPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) SetName(v CreateSnapshotPayloadGetNameRetType) { setCreateSnapshotPayloadGetNameAttributeType(&o.Name, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetSize() (res CreateSnapshotPayloadGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -323,22 +397,26 @@ func (o *CreateSnapshotPayload) GetSize() (res CreateSnapshotPayloadGetSizeRetTy // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetSizeOk() (ret CreateSnapshotPayloadGetSizeRetType, ok bool) { return getCreateSnapshotPayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) SetSize(v CreateSnapshotPayloadGetSizeRetType) { setCreateSnapshotPayloadGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetStatus() (res CreateSnapshotPayloadGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -346,22 +424,26 @@ func (o *CreateSnapshotPayload) GetStatus() (res CreateSnapshotPayloadGetStatusR // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetStatusOk() (ret CreateSnapshotPayloadGetStatusRetType, ok bool) { return getCreateSnapshotPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) SetStatus(v CreateSnapshotPayloadGetStatusRetType) { setCreateSnapshotPayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetUpdatedAt() (res CreateSnapshotPayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -369,22 +451,26 @@ func (o *CreateSnapshotPayload) GetUpdatedAt() (res CreateSnapshotPayloadGetUpda // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetUpdatedAtOk() (ret CreateSnapshotPayloadGetUpdatedAtRetType, ok bool) { return getCreateSnapshotPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) SetUpdatedAt(v CreateSnapshotPayloadGetUpdatedAtRetType) { setCreateSnapshotPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetVolumeId returns the VolumeId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetVolumeId() (ret CreateSnapshotPayloadGetVolumeIdRetType) { ret, _ = o.GetVolumeIdOk() return ret @@ -392,15 +478,18 @@ func (o *CreateSnapshotPayload) GetVolumeId() (ret CreateSnapshotPayloadGetVolum // GetVolumeIdOk returns a tuple with the VolumeId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) GetVolumeIdOk() (ret CreateSnapshotPayloadGetVolumeIdRetType, ok bool) { return getCreateSnapshotPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) } // SetVolumeId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateSnapshotPayload) SetVolumeId(v CreateSnapshotPayloadGetVolumeIdRetType) { setCreateSnapshotPayloadGetVolumeIdAttributeType(&o.VolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateSnapshotPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateSnapshotPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -430,37 +519,45 @@ func (o CreateSnapshotPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateSnapshotPayload struct { value *CreateSnapshotPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSnapshotPayload) Get() *CreateSnapshotPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSnapshotPayload) Set(val *CreateSnapshotPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSnapshotPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSnapshotPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateSnapshotPayload(val *CreateSnapshotPayload) *NullableCreateSnapshotPayload { return &NullableCreateSnapshotPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateSnapshotPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateSnapshotPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_create_volume_payload.go b/services/iaas/model_create_volume_payload.go index caaa2c126..3ea482d1d 100644 --- a/services/iaas/model_create_volume_payload.go +++ b/services/iaas/model_create_volume_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &CreateVolumePayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetAvailabilityZoneAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(arg CreateVolumePayloadGetAvailabilityZoneAttributeType) (ret CreateVolumePayloadGetAvailabilityZoneRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(arg CreateVolumePa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetAvailabilityZoneAttributeType(arg *CreateVolumePayloadGetAvailabilityZoneAttributeType, val CreateVolumePayloadGetAvailabilityZoneRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetAvailabilityZoneArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetAvailabilityZoneRetType = string /* @@ -44,10 +51,16 @@ type CreateVolumePayloadGetAvailabilityZoneRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadgetBootableAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadgetBootableArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadgetBootableRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadgetBootableAttributeTypeOk(arg CreateVolumePayloadgetBootableAttributeType) (ret CreateVolumePayloadgetBootableRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getCreateVolumePayloadgetBootableAttributeTypeOk(arg CreateVolumePayloadget return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadgetBootableAttributeType(arg *CreateVolumePayloadgetBootableAttributeType, val CreateVolumePayloadgetBootableRetType) { *arg = &val } @@ -64,10 +78,16 @@ func setCreateVolumePayloadgetBootableAttributeType(arg *CreateVolumePayloadgetB */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetCreatedAtAttributeTypeOk(arg CreateVolumePayloadGetCreatedAtAttributeType) (ret CreateVolumePayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getCreateVolumePayloadGetCreatedAtAttributeTypeOk(arg CreateVolumePayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetCreatedAtAttributeType(arg *CreateVolumePayloadGetCreatedAtAttributeType, val CreateVolumePayloadGetCreatedAtRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setCreateVolumePayloadGetCreatedAtAttributeType(arg *CreateVolumePayloadGet */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetDescriptionAttributeTypeOk(arg CreateVolumePayloadGetDescriptionAttributeType) (ret CreateVolumePayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getCreateVolumePayloadGetDescriptionAttributeTypeOk(arg CreateVolumePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetDescriptionAttributeType(arg *CreateVolumePayloadGetDescriptionAttributeType, val CreateVolumePayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetDescriptionRetType = string /* @@ -105,10 +132,16 @@ type CreateVolumePayloadGetDescriptionRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadgetEncryptedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadgetEncryptedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadgetEncryptedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadgetEncryptedAttributeTypeOk(arg CreateVolumePayloadgetEncryptedAttributeType) (ret CreateVolumePayloadgetEncryptedRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getCreateVolumePayloadgetEncryptedAttributeTypeOk(arg CreateVolumePayloadge return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadgetEncryptedAttributeType(arg *CreateVolumePayloadgetEncryptedAttributeType, val CreateVolumePayloadgetEncryptedRetType) { *arg = &val } @@ -125,10 +159,16 @@ func setCreateVolumePayloadgetEncryptedAttributeType(arg *CreateVolumePayloadget */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetEncryptionParametersAttributeType = *VolumeEncryptionParameter + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetEncryptionParametersArgType = VolumeEncryptionParameter + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetEncryptionParametersRetType = VolumeEncryptionParameter +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetEncryptionParametersAttributeTypeOk(arg CreateVolumePayloadGetEncryptionParametersAttributeType) (ret CreateVolumePayloadGetEncryptionParametersRetType, ok bool) { if arg == nil { return ret, false @@ -136,6 +176,7 @@ func getCreateVolumePayloadGetEncryptionParametersAttributeTypeOk(arg CreateVolu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetEncryptionParametersAttributeType(arg *CreateVolumePayloadGetEncryptionParametersAttributeType, val CreateVolumePayloadGetEncryptionParametersRetType) { *arg = &val } @@ -145,8 +186,10 @@ func setCreateVolumePayloadGetEncryptionParametersAttributeType(arg *CreateVolum */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetIdAttributeTypeOk(arg CreateVolumePayloadGetIdAttributeType) (ret CreateVolumePayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -154,11 +197,15 @@ func getCreateVolumePayloadGetIdAttributeTypeOk(arg CreateVolumePayloadGetIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetIdAttributeType(arg *CreateVolumePayloadGetIdAttributeType, val CreateVolumePayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetIdRetType = string /* @@ -166,10 +213,16 @@ type CreateVolumePayloadGetIdRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetImageConfigAttributeType = *ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetImageConfigArgType = ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetImageConfigRetType = ImageConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetImageConfigAttributeTypeOk(arg CreateVolumePayloadGetImageConfigAttributeType) (ret CreateVolumePayloadGetImageConfigRetType, ok bool) { if arg == nil { return ret, false @@ -177,6 +230,7 @@ func getCreateVolumePayloadGetImageConfigAttributeTypeOk(arg CreateVolumePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetImageConfigAttributeType(arg *CreateVolumePayloadGetImageConfigAttributeType, val CreateVolumePayloadGetImageConfigRetType) { *arg = &val } @@ -186,10 +240,16 @@ func setCreateVolumePayloadGetImageConfigAttributeType(arg *CreateVolumePayloadG */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetLabelsAttributeTypeOk(arg CreateVolumePayloadGetLabelsAttributeType) (ret CreateVolumePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -197,6 +257,7 @@ func getCreateVolumePayloadGetLabelsAttributeTypeOk(arg CreateVolumePayloadGetLa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetLabelsAttributeType(arg *CreateVolumePayloadGetLabelsAttributeType, val CreateVolumePayloadGetLabelsRetType) { *arg = &val } @@ -206,8 +267,10 @@ func setCreateVolumePayloadGetLabelsAttributeType(arg *CreateVolumePayloadGetLab */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetNameAttributeTypeOk(arg CreateVolumePayloadGetNameAttributeType) (ret CreateVolumePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -215,11 +278,15 @@ func getCreateVolumePayloadGetNameAttributeTypeOk(arg CreateVolumePayloadGetName return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetNameAttributeType(arg *CreateVolumePayloadGetNameAttributeType, val CreateVolumePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetNameRetType = string /* @@ -227,8 +294,10 @@ type CreateVolumePayloadGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetPerformanceClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(arg CreateVolumePayloadGetPerformanceClassAttributeType) (ret CreateVolumePayloadGetPerformanceClassRetType, ok bool) { if arg == nil { return ret, false @@ -236,11 +305,15 @@ func getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(arg CreateVolumePa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetPerformanceClassAttributeType(arg *CreateVolumePayloadGetPerformanceClassAttributeType, val CreateVolumePayloadGetPerformanceClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetPerformanceClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetPerformanceClassRetType = string /* @@ -248,8 +321,10 @@ type CreateVolumePayloadGetPerformanceClassRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetServerIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetServerIdAttributeTypeOk(arg CreateVolumePayloadGetServerIdAttributeType) (ret CreateVolumePayloadGetServerIdRetType, ok bool) { if arg == nil { return ret, false @@ -257,11 +332,15 @@ func getCreateVolumePayloadGetServerIdAttributeTypeOk(arg CreateVolumePayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetServerIdAttributeType(arg *CreateVolumePayloadGetServerIdAttributeType, val CreateVolumePayloadGetServerIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetServerIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetServerIdRetType = string /* @@ -269,10 +348,16 @@ type CreateVolumePayloadGetServerIdRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetSizeAttributeTypeOk(arg CreateVolumePayloadGetSizeAttributeType) (ret CreateVolumePayloadGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -280,6 +365,7 @@ func getCreateVolumePayloadGetSizeAttributeTypeOk(arg CreateVolumePayloadGetSize return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetSizeAttributeType(arg *CreateVolumePayloadGetSizeAttributeType, val CreateVolumePayloadGetSizeRetType) { *arg = &val } @@ -289,10 +375,16 @@ func setCreateVolumePayloadGetSizeAttributeType(arg *CreateVolumePayloadGetSizeA */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetSourceAttributeType = *VolumeSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetSourceArgType = VolumeSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetSourceRetType = VolumeSource +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetSourceAttributeTypeOk(arg CreateVolumePayloadGetSourceAttributeType) (ret CreateVolumePayloadGetSourceRetType, ok bool) { if arg == nil { return ret, false @@ -300,6 +392,7 @@ func getCreateVolumePayloadGetSourceAttributeTypeOk(arg CreateVolumePayloadGetSo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetSourceAttributeType(arg *CreateVolumePayloadGetSourceAttributeType, val CreateVolumePayloadGetSourceRetType) { *arg = &val } @@ -309,8 +402,10 @@ func setCreateVolumePayloadGetSourceAttributeType(arg *CreateVolumePayloadGetSou */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetStatusAttributeTypeOk(arg CreateVolumePayloadGetStatusAttributeType) (ret CreateVolumePayloadGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -318,11 +413,15 @@ func getCreateVolumePayloadGetStatusAttributeTypeOk(arg CreateVolumePayloadGetSt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetStatusAttributeType(arg *CreateVolumePayloadGetStatusAttributeType, val CreateVolumePayloadGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetStatusRetType = string /* @@ -330,10 +429,16 @@ type CreateVolumePayloadGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(arg CreateVolumePayloadGetUpdatedAtAttributeType) (ret CreateVolumePayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -341,11 +446,13 @@ func getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(arg CreateVolumePayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateVolumePayloadGetUpdatedAtAttributeType(arg *CreateVolumePayloadGetUpdatedAtAttributeType, val CreateVolumePayloadGetUpdatedAtRetType) { *arg = &val } // CreateVolumePayload Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateVolumePayload struct { // Object that represents an availability zone. // REQUIRED @@ -362,7 +469,7 @@ type CreateVolumePayload struct { // Universally Unique Identifier (UUID). Id CreateVolumePayloadGetIdAttributeType `json:"id,omitempty"` ImageConfig CreateVolumePayloadGetImageConfigAttributeType `json:"imageConfig,omitempty"` - // 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. + // 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. Labels CreateVolumePayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name CreateVolumePayloadGetNameAttributeType `json:"name,omitempty"` @@ -379,12 +486,14 @@ type CreateVolumePayload struct { UpdatedAt CreateVolumePayloadGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateVolumePayload CreateVolumePayload // NewCreateVolumePayload instantiates a new CreateVolumePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateVolumePayload(availabilityZone CreateVolumePayloadGetAvailabilityZoneArgType) *CreateVolumePayload { this := CreateVolumePayload{} setCreateVolumePayloadGetAvailabilityZoneAttributeType(&this.AvailabilityZone, availabilityZone) @@ -394,12 +503,14 @@ func NewCreateVolumePayload(availabilityZone CreateVolumePayloadGetAvailabilityZ // NewCreateVolumePayloadWithDefaults instantiates a new CreateVolumePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateVolumePayloadWithDefaults() *CreateVolumePayload { this := CreateVolumePayload{} return &this } // GetAvailabilityZone returns the AvailabilityZone field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetAvailabilityZone() (ret CreateVolumePayloadGetAvailabilityZoneRetType) { ret, _ = o.GetAvailabilityZoneOk() return ret @@ -407,16 +518,19 @@ func (o *CreateVolumePayload) GetAvailabilityZone() (ret CreateVolumePayloadGetA // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetAvailabilityZoneOk() (ret CreateVolumePayloadGetAvailabilityZoneRetType, ok bool) { return getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // SetAvailabilityZone sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetAvailabilityZone(v CreateVolumePayloadGetAvailabilityZoneRetType) { setCreateVolumePayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetBootable returns the Bootable field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetBootable() (res CreateVolumePayloadgetBootableRetType) { res, _ = o.GetBootableOk() return @@ -424,22 +538,26 @@ func (o *CreateVolumePayload) GetBootable() (res CreateVolumePayloadgetBootableR // GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetBootableOk() (ret CreateVolumePayloadgetBootableRetType, ok bool) { return getCreateVolumePayloadgetBootableAttributeTypeOk(o.Bootable) } // HasBootable returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasBootable() bool { _, ok := o.GetBootableOk() return ok } // SetBootable gets a reference to the given bool and assigns it to the Bootable field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetBootable(v CreateVolumePayloadgetBootableRetType) { setCreateVolumePayloadgetBootableAttributeType(&o.Bootable, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetCreatedAt() (res CreateVolumePayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -447,22 +565,26 @@ func (o *CreateVolumePayload) GetCreatedAt() (res CreateVolumePayloadGetCreatedA // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetCreatedAtOk() (ret CreateVolumePayloadGetCreatedAtRetType, ok bool) { return getCreateVolumePayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetCreatedAt(v CreateVolumePayloadGetCreatedAtRetType) { setCreateVolumePayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetDescription() (res CreateVolumePayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -470,22 +592,26 @@ func (o *CreateVolumePayload) GetDescription() (res CreateVolumePayloadGetDescri // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetDescriptionOk() (ret CreateVolumePayloadGetDescriptionRetType, ok bool) { return getCreateVolumePayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetDescription(v CreateVolumePayloadGetDescriptionRetType) { setCreateVolumePayloadGetDescriptionAttributeType(&o.Description, v) } // GetEncrypted returns the Encrypted field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetEncrypted() (res CreateVolumePayloadgetEncryptedRetType) { res, _ = o.GetEncryptedOk() return @@ -493,22 +619,26 @@ func (o *CreateVolumePayload) GetEncrypted() (res CreateVolumePayloadgetEncrypte // GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetEncryptedOk() (ret CreateVolumePayloadgetEncryptedRetType, ok bool) { return getCreateVolumePayloadgetEncryptedAttributeTypeOk(o.Encrypted) } // HasEncrypted returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasEncrypted() bool { _, ok := o.GetEncryptedOk() return ok } // SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetEncrypted(v CreateVolumePayloadgetEncryptedRetType) { setCreateVolumePayloadgetEncryptedAttributeType(&o.Encrypted, v) } // GetEncryptionParameters returns the EncryptionParameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetEncryptionParameters() (res CreateVolumePayloadGetEncryptionParametersRetType) { res, _ = o.GetEncryptionParametersOk() return @@ -516,22 +646,26 @@ func (o *CreateVolumePayload) GetEncryptionParameters() (res CreateVolumePayload // GetEncryptionParametersOk returns a tuple with the EncryptionParameters field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetEncryptionParametersOk() (ret CreateVolumePayloadGetEncryptionParametersRetType, ok bool) { return getCreateVolumePayloadGetEncryptionParametersAttributeTypeOk(o.EncryptionParameters) } // HasEncryptionParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasEncryptionParameters() bool { _, ok := o.GetEncryptionParametersOk() return ok } // SetEncryptionParameters gets a reference to the given VolumeEncryptionParameter and assigns it to the EncryptionParameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetEncryptionParameters(v CreateVolumePayloadGetEncryptionParametersRetType) { setCreateVolumePayloadGetEncryptionParametersAttributeType(&o.EncryptionParameters, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetId() (res CreateVolumePayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -539,22 +673,26 @@ func (o *CreateVolumePayload) GetId() (res CreateVolumePayloadGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetIdOk() (ret CreateVolumePayloadGetIdRetType, ok bool) { return getCreateVolumePayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetId(v CreateVolumePayloadGetIdRetType) { setCreateVolumePayloadGetIdAttributeType(&o.Id, v) } // GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetImageConfig() (res CreateVolumePayloadGetImageConfigRetType) { res, _ = o.GetImageConfigOk() return @@ -562,22 +700,26 @@ func (o *CreateVolumePayload) GetImageConfig() (res CreateVolumePayloadGetImageC // GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetImageConfigOk() (ret CreateVolumePayloadGetImageConfigRetType, ok bool) { return getCreateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig) } // HasImageConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasImageConfig() bool { _, ok := o.GetImageConfigOk() return ok } // SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetImageConfig(v CreateVolumePayloadGetImageConfigRetType) { setCreateVolumePayloadGetImageConfigAttributeType(&o.ImageConfig, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetLabels() (res CreateVolumePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -585,22 +727,26 @@ func (o *CreateVolumePayload) GetLabels() (res CreateVolumePayloadGetLabelsRetTy // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetLabelsOk() (ret CreateVolumePayloadGetLabelsRetType, ok bool) { return getCreateVolumePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetLabels(v CreateVolumePayloadGetLabelsRetType) { setCreateVolumePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetName() (res CreateVolumePayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -608,22 +754,26 @@ func (o *CreateVolumePayload) GetName() (res CreateVolumePayloadGetNameRetType) // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetNameOk() (ret CreateVolumePayloadGetNameRetType, ok bool) { return getCreateVolumePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetName(v CreateVolumePayloadGetNameRetType) { setCreateVolumePayloadGetNameAttributeType(&o.Name, v) } // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetPerformanceClass() (res CreateVolumePayloadGetPerformanceClassRetType) { res, _ = o.GetPerformanceClassOk() return @@ -631,22 +781,26 @@ func (o *CreateVolumePayload) GetPerformanceClass() (res CreateVolumePayloadGetP // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetPerformanceClassOk() (ret CreateVolumePayloadGetPerformanceClassRetType, ok bool) { return getCreateVolumePayloadGetPerformanceClassAttributeTypeOk(o.PerformanceClass) } // HasPerformanceClass returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasPerformanceClass() bool { _, ok := o.GetPerformanceClassOk() return ok } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetPerformanceClass(v CreateVolumePayloadGetPerformanceClassRetType) { setCreateVolumePayloadGetPerformanceClassAttributeType(&o.PerformanceClass, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetServerId() (res CreateVolumePayloadGetServerIdRetType) { res, _ = o.GetServerIdOk() return @@ -654,22 +808,26 @@ func (o *CreateVolumePayload) GetServerId() (res CreateVolumePayloadGetServerIdR // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetServerIdOk() (ret CreateVolumePayloadGetServerIdRetType, ok bool) { return getCreateVolumePayloadGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasServerId() bool { _, ok := o.GetServerIdOk() return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetServerId(v CreateVolumePayloadGetServerIdRetType) { setCreateVolumePayloadGetServerIdAttributeType(&o.ServerId, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetSize() (res CreateVolumePayloadGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -677,22 +835,26 @@ func (o *CreateVolumePayload) GetSize() (res CreateVolumePayloadGetSizeRetType) // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetSizeOk() (ret CreateVolumePayloadGetSizeRetType, ok bool) { return getCreateVolumePayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetSize(v CreateVolumePayloadGetSizeRetType) { setCreateVolumePayloadGetSizeAttributeType(&o.Size, v) } // GetSource returns the Source field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetSource() (res CreateVolumePayloadGetSourceRetType) { res, _ = o.GetSourceOk() return @@ -700,22 +862,26 @@ func (o *CreateVolumePayload) GetSource() (res CreateVolumePayloadGetSourceRetTy // GetSourceOk returns a tuple with the Source field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetSourceOk() (ret CreateVolumePayloadGetSourceRetType, ok bool) { return getCreateVolumePayloadGetSourceAttributeTypeOk(o.Source) } // HasSource returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasSource() bool { _, ok := o.GetSourceOk() return ok } // SetSource gets a reference to the given VolumeSource and assigns it to the Source field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetSource(v CreateVolumePayloadGetSourceRetType) { setCreateVolumePayloadGetSourceAttributeType(&o.Source, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetStatus() (res CreateVolumePayloadGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -723,22 +889,26 @@ func (o *CreateVolumePayload) GetStatus() (res CreateVolumePayloadGetStatusRetTy // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetStatusOk() (ret CreateVolumePayloadGetStatusRetType, ok bool) { return getCreateVolumePayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetStatus(v CreateVolumePayloadGetStatusRetType) { setCreateVolumePayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetUpdatedAt() (res CreateVolumePayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -746,21 +916,25 @@ func (o *CreateVolumePayload) GetUpdatedAt() (res CreateVolumePayloadGetUpdatedA // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) GetUpdatedAtOk() (ret CreateVolumePayloadGetUpdatedAtRetType, ok bool) { return getCreateVolumePayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateVolumePayload) SetUpdatedAt(v CreateVolumePayloadGetUpdatedAtRetType) { setCreateVolumePayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateVolumePayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { @@ -814,37 +988,45 @@ func (o CreateVolumePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateVolumePayload struct { value *CreateVolumePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateVolumePayload) Get() *CreateVolumePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateVolumePayload) Set(val *CreateVolumePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateVolumePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateVolumePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateVolumePayload(val *CreateVolumePayload) *NullableCreateVolumePayload { return &NullableCreateVolumePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateVolumePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateVolumePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_destination_cidrv4.go b/services/iaas/model_destination_cidrv4.go index fbb8ca839..9566e1864 100644 --- a/services/iaas/model_destination_cidrv4.go +++ b/services/iaas/model_destination_cidrv4.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &DestinationCIDRv4{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv4GetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDestinationCIDRv4GetTypeAttributeTypeOk(arg DestinationCIDRv4GetTypeAttributeType) (ret DestinationCIDRv4GetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getDestinationCIDRv4GetTypeAttributeTypeOk(arg DestinationCIDRv4GetTypeAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDestinationCIDRv4GetTypeAttributeType(arg *DestinationCIDRv4GetTypeAttributeType, val DestinationCIDRv4GetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv4GetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv4GetTypeRetType = string /* @@ -43,8 +50,10 @@ type DestinationCIDRv4GetTypeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv4GetValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDestinationCIDRv4GetValueAttributeTypeOk(arg DestinationCIDRv4GetValueAttributeType) (ret DestinationCIDRv4GetValueRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getDestinationCIDRv4GetValueAttributeTypeOk(arg DestinationCIDRv4GetValueAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDestinationCIDRv4GetValueAttributeType(arg *DestinationCIDRv4GetValueAttributeType, val DestinationCIDRv4GetValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv4GetValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv4GetValueRetType = string // DestinationCIDRv4 IPv4 Classless Inter-Domain Routing (CIDR) Object. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv4 struct { // REQUIRED Type DestinationCIDRv4GetTypeAttributeType `json:"type" required:"true"` @@ -68,12 +82,14 @@ type DestinationCIDRv4 struct { Value DestinationCIDRv4GetValueAttributeType `json:"value" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DestinationCIDRv4 DestinationCIDRv4 // NewDestinationCIDRv4 instantiates a new DestinationCIDRv4 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDestinationCIDRv4(types DestinationCIDRv4GetTypeArgType, value DestinationCIDRv4GetValueArgType) *DestinationCIDRv4 { this := DestinationCIDRv4{} setDestinationCIDRv4GetTypeAttributeType(&this.Type, types) @@ -84,12 +100,14 @@ func NewDestinationCIDRv4(types DestinationCIDRv4GetTypeArgType, value Destinati // NewDestinationCIDRv4WithDefaults instantiates a new DestinationCIDRv4 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDestinationCIDRv4WithDefaults() *DestinationCIDRv4 { this := DestinationCIDRv4{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv4) GetType() (ret DestinationCIDRv4GetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -97,16 +115,19 @@ func (o *DestinationCIDRv4) GetType() (ret DestinationCIDRv4GetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv4) GetTypeOk() (ret DestinationCIDRv4GetTypeRetType, ok bool) { return getDestinationCIDRv4GetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv4) SetType(v DestinationCIDRv4GetTypeRetType) { setDestinationCIDRv4GetTypeAttributeType(&o.Type, v) } // GetValue returns the Value field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv4) GetValue() (ret DestinationCIDRv4GetValueRetType) { ret, _ = o.GetValueOk() return ret @@ -114,15 +135,18 @@ func (o *DestinationCIDRv4) GetValue() (ret DestinationCIDRv4GetValueRetType) { // GetValueOk returns a tuple with the Value field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv4) GetValueOk() (ret DestinationCIDRv4GetValueRetType, ok bool) { return getDestinationCIDRv4GetValueAttributeTypeOk(o.Value) } // SetValue sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv4) SetValue(v DestinationCIDRv4GetValueRetType) { setDestinationCIDRv4GetValueAttributeType(&o.Value, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DestinationCIDRv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDestinationCIDRv4GetTypeAttributeTypeOk(o.Type); ok { @@ -134,37 +158,45 @@ func (o DestinationCIDRv4) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDestinationCIDRv4 struct { value *DestinationCIDRv4 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDestinationCIDRv4) Get() *DestinationCIDRv4 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDestinationCIDRv4) Set(val *DestinationCIDRv4) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDestinationCIDRv4) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDestinationCIDRv4) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDestinationCIDRv4(val *DestinationCIDRv4) *NullableDestinationCIDRv4 { return &NullableDestinationCIDRv4{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDestinationCIDRv4) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDestinationCIDRv4) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_destination_cidrv6.go b/services/iaas/model_destination_cidrv6.go index dc4555f7f..604f6c280 100644 --- a/services/iaas/model_destination_cidrv6.go +++ b/services/iaas/model_destination_cidrv6.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &DestinationCIDRv6{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv6GetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDestinationCIDRv6GetTypeAttributeTypeOk(arg DestinationCIDRv6GetTypeAttributeType) (ret DestinationCIDRv6GetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getDestinationCIDRv6GetTypeAttributeTypeOk(arg DestinationCIDRv6GetTypeAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDestinationCIDRv6GetTypeAttributeType(arg *DestinationCIDRv6GetTypeAttributeType, val DestinationCIDRv6GetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv6GetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv6GetTypeRetType = string /* @@ -43,8 +50,10 @@ type DestinationCIDRv6GetTypeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv6GetValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getDestinationCIDRv6GetValueAttributeTypeOk(arg DestinationCIDRv6GetValueAttributeType) (ret DestinationCIDRv6GetValueRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getDestinationCIDRv6GetValueAttributeTypeOk(arg DestinationCIDRv6GetValueAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setDestinationCIDRv6GetValueAttributeType(arg *DestinationCIDRv6GetValueAttributeType, val DestinationCIDRv6GetValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv6GetValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv6GetValueRetType = string // DestinationCIDRv6 IPv6 Classless Inter-Domain Routing (CIDR) Object. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DestinationCIDRv6 struct { // REQUIRED Type DestinationCIDRv6GetTypeAttributeType `json:"type" required:"true"` @@ -68,12 +82,14 @@ type DestinationCIDRv6 struct { Value DestinationCIDRv6GetValueAttributeType `json:"value" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _DestinationCIDRv6 DestinationCIDRv6 // NewDestinationCIDRv6 instantiates a new DestinationCIDRv6 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDestinationCIDRv6(types DestinationCIDRv6GetTypeArgType, value DestinationCIDRv6GetValueArgType) *DestinationCIDRv6 { this := DestinationCIDRv6{} setDestinationCIDRv6GetTypeAttributeType(&this.Type, types) @@ -84,12 +100,14 @@ func NewDestinationCIDRv6(types DestinationCIDRv6GetTypeArgType, value Destinati // NewDestinationCIDRv6WithDefaults instantiates a new DestinationCIDRv6 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewDestinationCIDRv6WithDefaults() *DestinationCIDRv6 { this := DestinationCIDRv6{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv6) GetType() (ret DestinationCIDRv6GetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -97,16 +115,19 @@ func (o *DestinationCIDRv6) GetType() (ret DestinationCIDRv6GetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv6) GetTypeOk() (ret DestinationCIDRv6GetTypeRetType, ok bool) { return getDestinationCIDRv6GetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv6) SetType(v DestinationCIDRv6GetTypeRetType) { setDestinationCIDRv6GetTypeAttributeType(&o.Type, v) } // GetValue returns the Value field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv6) GetValue() (ret DestinationCIDRv6GetValueRetType) { ret, _ = o.GetValueOk() return ret @@ -114,15 +135,18 @@ func (o *DestinationCIDRv6) GetValue() (ret DestinationCIDRv6GetValueRetType) { // GetValueOk returns a tuple with the Value field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv6) GetValueOk() (ret DestinationCIDRv6GetValueRetType, ok bool) { return getDestinationCIDRv6GetValueAttributeTypeOk(o.Value) } // SetValue sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *DestinationCIDRv6) SetValue(v DestinationCIDRv6GetValueRetType) { setDestinationCIDRv6GetValueAttributeType(&o.Value, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o DestinationCIDRv6) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getDestinationCIDRv6GetTypeAttributeTypeOk(o.Type); ok { @@ -134,37 +158,45 @@ func (o DestinationCIDRv6) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableDestinationCIDRv6 struct { value *DestinationCIDRv6 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDestinationCIDRv6) Get() *DestinationCIDRv6 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDestinationCIDRv6) Set(val *DestinationCIDRv6) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDestinationCIDRv6) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDestinationCIDRv6) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableDestinationCIDRv6(val *DestinationCIDRv6) *NullableDestinationCIDRv6 { return &NullableDestinationCIDRv6{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableDestinationCIDRv6) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableDestinationCIDRv6) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_error.go b/services/iaas/model_error.go index 28ebb9044..68151211d 100644 --- a/services/iaas/model_error.go +++ b/services/iaas/model_error.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Error{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetCodeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetCodeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetCodeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorGetCodeAttributeTypeOk(arg ErrorGetCodeAttributeType) (ret ErrorGetCodeRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getErrorGetCodeAttributeTypeOk(arg ErrorGetCodeAttributeType) (ret ErrorGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorGetCodeAttributeType(arg *ErrorGetCodeAttributeType, val ErrorGetCodeRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setErrorGetCodeAttributeType(arg *ErrorGetCodeAttributeType, val ErrorGetCo */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetMsgAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorGetMsgAttributeTypeOk(arg ErrorGetMsgAttributeType) (ret ErrorGetMsgRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getErrorGetMsgAttributeTypeOk(arg ErrorGetMsgAttributeType) (ret ErrorGetMs return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorGetMsgAttributeType(arg *ErrorGetMsgAttributeType, val ErrorGetMsgRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetMsgArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorGetMsgRetType = string // Error Error with HTTP error code and an error message. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Error struct { // REQUIRED Code ErrorGetCodeAttributeType `json:"code" required:"true"` @@ -67,12 +82,14 @@ type Error struct { Msg ErrorGetMsgAttributeType `json:"msg" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Error Error // NewError instantiates a new Error object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewError(code ErrorGetCodeArgType, msg ErrorGetMsgArgType) *Error { this := Error{} setErrorGetCodeAttributeType(&this.Code, code) @@ -83,12 +100,14 @@ func NewError(code ErrorGetCodeArgType, msg ErrorGetMsgArgType) *Error { // NewErrorWithDefaults instantiates a new Error object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewErrorWithDefaults() *Error { this := Error{} return &this } // GetCode returns the Code field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetCode() (ret ErrorGetCodeRetType) { ret, _ = o.GetCodeOk() return ret @@ -96,16 +115,19 @@ func (o *Error) GetCode() (ret ErrorGetCodeRetType) { // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetCodeOk() (ret ErrorGetCodeRetType, ok bool) { return getErrorGetCodeAttributeTypeOk(o.Code) } // SetCode sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) SetCode(v ErrorGetCodeRetType) { setErrorGetCodeAttributeType(&o.Code, v) } // GetMsg returns the Msg field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetMsg() (ret ErrorGetMsgRetType) { ret, _ = o.GetMsgOk() return ret @@ -113,15 +135,18 @@ func (o *Error) GetMsg() (ret ErrorGetMsgRetType) { // GetMsgOk returns a tuple with the Msg field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) GetMsgOk() (ret ErrorGetMsgRetType, ok bool) { return getErrorGetMsgAttributeTypeOk(o.Msg) } // SetMsg sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Error) SetMsg(v ErrorGetMsgRetType) { setErrorGetMsgAttributeType(&o.Msg, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Error) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getErrorGetCodeAttributeTypeOk(o.Code); ok { @@ -133,37 +158,45 @@ func (o Error) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableError struct { value *Error isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableError) Get() *Error { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableError) Set(val *Error) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableError) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableError) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableError(val *Error) *NullableError { return &NullableError{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableError) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableError) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_get_server_log_200_response.go b/services/iaas/model_get_server_log_200_response.go index b185e5e27..2b4c88939 100644 --- a/services/iaas/model_get_server_log_200_response.go +++ b/services/iaas/model_get_server_log_200_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &GetServerLog200Response{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServerLog200ResponseGetOutputAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetServerLog200ResponseGetOutputAttributeTypeOk(arg GetServerLog200ResponseGetOutputAttributeType) (ret GetServerLog200ResponseGetOutputRetType, ok bool) { if arg == nil { return ret, false @@ -31,14 +34,19 @@ func getGetServerLog200ResponseGetOutputAttributeTypeOk(arg GetServerLog200Respo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetServerLog200ResponseGetOutputAttributeType(arg *GetServerLog200ResponseGetOutputAttributeType, val GetServerLog200ResponseGetOutputRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServerLog200ResponseGetOutputArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServerLog200ResponseGetOutputRetType = string // GetServerLog200Response struct for GetServerLog200Response +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServerLog200Response struct { Output GetServerLog200ResponseGetOutputAttributeType `json:"output,omitempty"` } @@ -47,6 +55,7 @@ type GetServerLog200Response struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetServerLog200Response() *GetServerLog200Response { this := GetServerLog200Response{} return &this @@ -55,12 +64,14 @@ func NewGetServerLog200Response() *GetServerLog200Response { // NewGetServerLog200ResponseWithDefaults instantiates a new GetServerLog200Response object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetServerLog200ResponseWithDefaults() *GetServerLog200Response { this := GetServerLog200Response{} return &this } // GetOutput returns the Output field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetServerLog200Response) GetOutput() (res GetServerLog200ResponseGetOutputRetType) { res, _ = o.GetOutputOk() return @@ -68,21 +79,25 @@ func (o *GetServerLog200Response) GetOutput() (res GetServerLog200ResponseGetOut // GetOutputOk returns a tuple with the Output field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetServerLog200Response) GetOutputOk() (ret GetServerLog200ResponseGetOutputRetType, ok bool) { return getGetServerLog200ResponseGetOutputAttributeTypeOk(o.Output) } // HasOutput returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetServerLog200Response) HasOutput() bool { _, ok := o.GetOutputOk() return ok } // SetOutput gets a reference to the given string and assigns it to the Output field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetServerLog200Response) SetOutput(v GetServerLog200ResponseGetOutputRetType) { setGetServerLog200ResponseGetOutputAttributeType(&o.Output, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetServerLog200Response) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetServerLog200ResponseGetOutputAttributeTypeOk(o.Output); ok { @@ -91,37 +106,45 @@ func (o GetServerLog200Response) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetServerLog200Response struct { value *GetServerLog200Response isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetServerLog200Response) Get() *GetServerLog200Response { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetServerLog200Response) Set(val *GetServerLog200Response) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetServerLog200Response) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetServerLog200Response) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetServerLog200Response(val *GetServerLog200Response) *NullableGetServerLog200Response { return &NullableGetServerLog200Response{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetServerLog200Response) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetServerLog200Response) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_icmp_parameters.go b/services/iaas/model_icmp_parameters.go index c62bff652..7afe78b29 100644 --- a/services/iaas/model_icmp_parameters.go +++ b/services/iaas/model_icmp_parameters.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ICMPParameters{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ICMPParametersGetCodeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ICMPParametersGetCodeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ICMPParametersGetCodeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getICMPParametersGetCodeAttributeTypeOk(arg ICMPParametersGetCodeAttributeType) (ret ICMPParametersGetCodeRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getICMPParametersGetCodeAttributeTypeOk(arg ICMPParametersGetCodeAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setICMPParametersGetCodeAttributeType(arg *ICMPParametersGetCodeAttributeType, val ICMPParametersGetCodeRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setICMPParametersGetCodeAttributeType(arg *ICMPParametersGetCodeAttributeTy */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ICMPParametersGetTypeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ICMPParametersGetTypeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ICMPParametersGetTypeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getICMPParametersGetTypeAttributeTypeOk(arg ICMPParametersGetTypeAttributeType) (ret ICMPParametersGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getICMPParametersGetTypeAttributeTypeOk(arg ICMPParametersGetTypeAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setICMPParametersGetTypeAttributeType(arg *ICMPParametersGetTypeAttributeType, val ICMPParametersGetTypeRetType) { *arg = &val } // ICMPParameters Object that represents ICMP parameters. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ICMPParameters struct { // ICMP code. Can be set if the protocol is ICMP. // REQUIRED @@ -67,12 +83,14 @@ type ICMPParameters struct { Type ICMPParametersGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ICMPParameters ICMPParameters // NewICMPParameters instantiates a new ICMPParameters object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewICMPParameters(code ICMPParametersGetCodeArgType, types ICMPParametersGetTypeArgType) *ICMPParameters { this := ICMPParameters{} setICMPParametersGetCodeAttributeType(&this.Code, code) @@ -83,12 +101,14 @@ func NewICMPParameters(code ICMPParametersGetCodeArgType, types ICMPParametersGe // NewICMPParametersWithDefaults instantiates a new ICMPParameters object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewICMPParametersWithDefaults() *ICMPParameters { this := ICMPParameters{} return &this } // GetCode returns the Code field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ICMPParameters) GetCode() (ret ICMPParametersGetCodeRetType) { ret, _ = o.GetCodeOk() return ret @@ -96,16 +116,19 @@ func (o *ICMPParameters) GetCode() (ret ICMPParametersGetCodeRetType) { // GetCodeOk returns a tuple with the Code field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ICMPParameters) GetCodeOk() (ret ICMPParametersGetCodeRetType, ok bool) { return getICMPParametersGetCodeAttributeTypeOk(o.Code) } // SetCode sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ICMPParameters) SetCode(v ICMPParametersGetCodeRetType) { setICMPParametersGetCodeAttributeType(&o.Code, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ICMPParameters) GetType() (ret ICMPParametersGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -113,15 +136,18 @@ func (o *ICMPParameters) GetType() (ret ICMPParametersGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ICMPParameters) GetTypeOk() (ret ICMPParametersGetTypeRetType, ok bool) { return getICMPParametersGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ICMPParameters) SetType(v ICMPParametersGetTypeRetType) { setICMPParametersGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ICMPParameters) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getICMPParametersGetCodeAttributeTypeOk(o.Code); ok { @@ -133,37 +159,45 @@ func (o ICMPParameters) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableICMPParameters struct { value *ICMPParameters isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableICMPParameters) Get() *ICMPParameters { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableICMPParameters) Set(val *ICMPParameters) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableICMPParameters) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableICMPParameters) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableICMPParameters(val *ICMPParameters) *NullableICMPParameters { return &NullableICMPParameters{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableICMPParameters) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableICMPParameters) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image.go b/services/iaas/model_image.go index 1135b5e31..15523aa72 100644 --- a/services/iaas/model_image.go +++ b/services/iaas/model_image.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &Image{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetAgentAttributeType = *ImageAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetAgentArgType = ImageAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetAgentRetType = ImageAgent +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetAgentAttributeTypeOk(arg ImageGetAgentAttributeType) (ret ImageGetAgentRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getImageGetAgentAttributeTypeOk(arg ImageGetAgentAttributeType) (ret ImageG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetAgentAttributeType(arg *ImageGetAgentAttributeType, val ImageGetAgentRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setImageGetAgentAttributeType(arg *ImageGetAgentAttributeType, val ImageGet */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetChecksumAttributeType = *ImageChecksum + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetChecksumArgType = ImageChecksum + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetChecksumRetType = ImageChecksum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetChecksumAttributeTypeOk(arg ImageGetChecksumAttributeType) (ret ImageGetChecksumRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getImageGetChecksumAttributeTypeOk(arg ImageGetChecksumAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetChecksumAttributeType(arg *ImageGetChecksumAttributeType, val ImageGetChecksumRetType) { *arg = &val } @@ -63,10 +78,16 @@ func setImageGetChecksumAttributeType(arg *ImageGetChecksumAttributeType, val Im */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetConfigAttributeType = *ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetConfigArgType = ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetConfigRetType = ImageConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetConfigAttributeTypeOk(arg ImageGetConfigAttributeType) (ret ImageGetConfigRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +95,7 @@ func getImageGetConfigAttributeTypeOk(arg ImageGetConfigAttributeType) (ret Imag return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetConfigAttributeType(arg *ImageGetConfigAttributeType, val ImageGetConfigRetType) { *arg = &val } @@ -83,10 +105,16 @@ func setImageGetConfigAttributeType(arg *ImageGetConfigAttributeType, val ImageG */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetCreatedAtAttributeTypeOk(arg ImageGetCreatedAtAttributeType) (ret ImageGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -94,6 +122,7 @@ func getImageGetCreatedAtAttributeTypeOk(arg ImageGetCreatedAtAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetCreatedAtAttributeType(arg *ImageGetCreatedAtAttributeType, val ImageGetCreatedAtRetType) { *arg = &val } @@ -103,8 +132,10 @@ func setImageGetCreatedAtAttributeType(arg *ImageGetCreatedAtAttributeType, val */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetDiskFormatAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetDiskFormatAttributeTypeOk(arg ImageGetDiskFormatAttributeType) (ret ImageGetDiskFormatRetType, ok bool) { if arg == nil { return ret, false @@ -112,11 +143,15 @@ func getImageGetDiskFormatAttributeTypeOk(arg ImageGetDiskFormatAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetDiskFormatAttributeType(arg *ImageGetDiskFormatAttributeType, val ImageGetDiskFormatRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetDiskFormatArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetDiskFormatRetType = string /* @@ -124,8 +159,10 @@ type ImageGetDiskFormatRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetIdAttributeTypeOk(arg ImageGetIdAttributeType) (ret ImageGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -133,11 +170,15 @@ func getImageGetIdAttributeTypeOk(arg ImageGetIdAttributeType) (ret ImageGetIdRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetIdAttributeType(arg *ImageGetIdAttributeType, val ImageGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetIdRetType = string /* @@ -145,10 +186,16 @@ type ImageGetIdRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetImportProgressAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetImportProgressArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetImportProgressRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetImportProgressAttributeTypeOk(arg ImageGetImportProgressAttributeType) (ret ImageGetImportProgressRetType, ok bool) { if arg == nil { return ret, false @@ -156,6 +203,7 @@ func getImageGetImportProgressAttributeTypeOk(arg ImageGetImportProgressAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetImportProgressAttributeType(arg *ImageGetImportProgressAttributeType, val ImageGetImportProgressRetType) { *arg = &val } @@ -165,10 +213,16 @@ func setImageGetImportProgressAttributeType(arg *ImageGetImportProgressAttribute */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetLabelsAttributeTypeOk(arg ImageGetLabelsAttributeType) (ret ImageGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -176,6 +230,7 @@ func getImageGetLabelsAttributeTypeOk(arg ImageGetLabelsAttributeType) (ret Imag return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetLabelsAttributeType(arg *ImageGetLabelsAttributeType, val ImageGetLabelsRetType) { *arg = &val } @@ -185,10 +240,16 @@ func setImageGetLabelsAttributeType(arg *ImageGetLabelsAttributeType, val ImageG */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetMinDiskSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetMinDiskSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetMinDiskSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetMinDiskSizeAttributeTypeOk(arg ImageGetMinDiskSizeAttributeType) (ret ImageGetMinDiskSizeRetType, ok bool) { if arg == nil { return ret, false @@ -196,6 +257,7 @@ func getImageGetMinDiskSizeAttributeTypeOk(arg ImageGetMinDiskSizeAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetMinDiskSizeAttributeType(arg *ImageGetMinDiskSizeAttributeType, val ImageGetMinDiskSizeRetType) { *arg = &val } @@ -205,10 +267,16 @@ func setImageGetMinDiskSizeAttributeType(arg *ImageGetMinDiskSizeAttributeType, */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetMinRamAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetMinRamArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetMinRamRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetMinRamAttributeTypeOk(arg ImageGetMinRamAttributeType) (ret ImageGetMinRamRetType, ok bool) { if arg == nil { return ret, false @@ -216,6 +284,7 @@ func getImageGetMinRamAttributeTypeOk(arg ImageGetMinRamAttributeType) (ret Imag return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetMinRamAttributeType(arg *ImageGetMinRamAttributeType, val ImageGetMinRamRetType) { *arg = &val } @@ -225,8 +294,10 @@ func setImageGetMinRamAttributeType(arg *ImageGetMinRamAttributeType, val ImageG */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetNameAttributeTypeOk(arg ImageGetNameAttributeType) (ret ImageGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -234,11 +305,15 @@ func getImageGetNameAttributeTypeOk(arg ImageGetNameAttributeType) (ret ImageGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetNameAttributeType(arg *ImageGetNameAttributeType, val ImageGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetNameRetType = string /* @@ -246,8 +321,10 @@ type ImageGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetOwnerAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetOwnerAttributeTypeOk(arg ImageGetOwnerAttributeType) (ret ImageGetOwnerRetType, ok bool) { if arg == nil { return ret, false @@ -255,11 +332,15 @@ func getImageGetOwnerAttributeTypeOk(arg ImageGetOwnerAttributeType) (ret ImageG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetOwnerAttributeType(arg *ImageGetOwnerAttributeType, val ImageGetOwnerRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetOwnerArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetOwnerRetType = string /* @@ -267,10 +348,16 @@ type ImageGetOwnerRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImagegetProtectedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImagegetProtectedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImagegetProtectedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImagegetProtectedAttributeTypeOk(arg ImagegetProtectedAttributeType) (ret ImagegetProtectedRetType, ok bool) { if arg == nil { return ret, false @@ -278,6 +365,7 @@ func getImagegetProtectedAttributeTypeOk(arg ImagegetProtectedAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImagegetProtectedAttributeType(arg *ImagegetProtectedAttributeType, val ImagegetProtectedRetType) { *arg = &val } @@ -287,8 +375,10 @@ func setImagegetProtectedAttributeType(arg *ImagegetProtectedAttributeType, val */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetScopeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetScopeAttributeTypeOk(arg ImageGetScopeAttributeType) (ret ImageGetScopeRetType, ok bool) { if arg == nil { return ret, false @@ -296,11 +386,15 @@ func getImageGetScopeAttributeTypeOk(arg ImageGetScopeAttributeType) (ret ImageG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetScopeAttributeType(arg *ImageGetScopeAttributeType, val ImageGetScopeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetScopeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetScopeRetType = string /* @@ -308,10 +402,16 @@ type ImageGetScopeRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetSizeAttributeTypeOk(arg ImageGetSizeAttributeType) (ret ImageGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -319,6 +419,7 @@ func getImageGetSizeAttributeTypeOk(arg ImageGetSizeAttributeType) (ret ImageGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetSizeAttributeType(arg *ImageGetSizeAttributeType, val ImageGetSizeRetType) { *arg = &val } @@ -328,8 +429,10 @@ func setImageGetSizeAttributeType(arg *ImageGetSizeAttributeType, val ImageGetSi */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetStatusAttributeTypeOk(arg ImageGetStatusAttributeType) (ret ImageGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -337,11 +440,15 @@ func getImageGetStatusAttributeTypeOk(arg ImageGetStatusAttributeType) (ret Imag return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetStatusAttributeType(arg *ImageGetStatusAttributeType, val ImageGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetStatusRetType = string /* @@ -349,10 +456,16 @@ type ImageGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageGetUpdatedAtAttributeTypeOk(arg ImageGetUpdatedAtAttributeType) (ret ImageGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -360,11 +473,13 @@ func getImageGetUpdatedAtAttributeTypeOk(arg ImageGetUpdatedAtAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageGetUpdatedAtAttributeType(arg *ImageGetUpdatedAtAttributeType, val ImageGetUpdatedAtRetType) { *arg = &val } // Image Object that represents an Image and its parameters. Used for Creating and returning (get/list). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Image struct { Agent ImageGetAgentAttributeType `json:"agent,omitempty"` Checksum ImageGetChecksumAttributeType `json:"checksum,omitempty"` @@ -378,7 +493,7 @@ type Image struct { Id ImageGetIdAttributeType `json:"id,omitempty"` // Indicates Image Import Progress in percent. ImportProgress ImageGetImportProgressAttributeType `json:"importProgress,omitempty"` - // 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. + // 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. Labels ImageGetLabelsAttributeType `json:"labels,omitempty"` // Size in Gigabyte. MinDiskSize ImageGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` @@ -401,12 +516,14 @@ type Image struct { UpdatedAt ImageGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Image Image // NewImage instantiates a new Image object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImage(diskFormat ImageGetDiskFormatArgType, name ImageGetNameArgType) *Image { this := Image{} setImageGetDiskFormatAttributeType(&this.DiskFormat, diskFormat) @@ -417,12 +534,14 @@ func NewImage(diskFormat ImageGetDiskFormatArgType, name ImageGetNameArgType) *I // NewImageWithDefaults instantiates a new Image object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageWithDefaults() *Image { this := Image{} return &this } // GetAgent returns the Agent field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetAgent() (res ImageGetAgentRetType) { res, _ = o.GetAgentOk() return @@ -430,22 +549,26 @@ func (o *Image) GetAgent() (res ImageGetAgentRetType) { // GetAgentOk returns a tuple with the Agent field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetAgentOk() (ret ImageGetAgentRetType, ok bool) { return getImageGetAgentAttributeTypeOk(o.Agent) } // HasAgent returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasAgent() bool { _, ok := o.GetAgentOk() return ok } // SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetAgent(v ImageGetAgentRetType) { setImageGetAgentAttributeType(&o.Agent, v) } // GetChecksum returns the Checksum field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetChecksum() (res ImageGetChecksumRetType) { res, _ = o.GetChecksumOk() return @@ -453,22 +576,26 @@ func (o *Image) GetChecksum() (res ImageGetChecksumRetType) { // GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetChecksumOk() (ret ImageGetChecksumRetType, ok bool) { return getImageGetChecksumAttributeTypeOk(o.Checksum) } // HasChecksum returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasChecksum() bool { _, ok := o.GetChecksumOk() return ok } // SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetChecksum(v ImageGetChecksumRetType) { setImageGetChecksumAttributeType(&o.Checksum, v) } // GetConfig returns the Config field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetConfig() (res ImageGetConfigRetType) { res, _ = o.GetConfigOk() return @@ -476,22 +603,26 @@ func (o *Image) GetConfig() (res ImageGetConfigRetType) { // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetConfigOk() (ret ImageGetConfigRetType, ok bool) { return getImageGetConfigAttributeTypeOk(o.Config) } // HasConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasConfig() bool { _, ok := o.GetConfigOk() return ok } // SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetConfig(v ImageGetConfigRetType) { setImageGetConfigAttributeType(&o.Config, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetCreatedAt() (res ImageGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -499,22 +630,26 @@ func (o *Image) GetCreatedAt() (res ImageGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetCreatedAtOk() (ret ImageGetCreatedAtRetType, ok bool) { return getImageGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetCreatedAt(v ImageGetCreatedAtRetType) { setImageGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDiskFormat returns the DiskFormat field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetDiskFormat() (ret ImageGetDiskFormatRetType) { ret, _ = o.GetDiskFormatOk() return ret @@ -522,16 +657,19 @@ func (o *Image) GetDiskFormat() (ret ImageGetDiskFormatRetType) { // GetDiskFormatOk returns a tuple with the DiskFormat field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetDiskFormatOk() (ret ImageGetDiskFormatRetType, ok bool) { return getImageGetDiskFormatAttributeTypeOk(o.DiskFormat) } // SetDiskFormat sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetDiskFormat(v ImageGetDiskFormatRetType) { setImageGetDiskFormatAttributeType(&o.DiskFormat, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetId() (res ImageGetIdRetType) { res, _ = o.GetIdOk() return @@ -539,22 +677,26 @@ func (o *Image) GetId() (res ImageGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetIdOk() (ret ImageGetIdRetType, ok bool) { return getImageGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetId(v ImageGetIdRetType) { setImageGetIdAttributeType(&o.Id, v) } // GetImportProgress returns the ImportProgress field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetImportProgress() (res ImageGetImportProgressRetType) { res, _ = o.GetImportProgressOk() return @@ -562,22 +704,26 @@ func (o *Image) GetImportProgress() (res ImageGetImportProgressRetType) { // GetImportProgressOk returns a tuple with the ImportProgress field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetImportProgressOk() (ret ImageGetImportProgressRetType, ok bool) { return getImageGetImportProgressAttributeTypeOk(o.ImportProgress) } // HasImportProgress returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasImportProgress() bool { _, ok := o.GetImportProgressOk() return ok } // SetImportProgress gets a reference to the given int64 and assigns it to the ImportProgress field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetImportProgress(v ImageGetImportProgressRetType) { setImageGetImportProgressAttributeType(&o.ImportProgress, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetLabels() (res ImageGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -585,22 +731,26 @@ func (o *Image) GetLabels() (res ImageGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetLabelsOk() (ret ImageGetLabelsRetType, ok bool) { return getImageGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetLabels(v ImageGetLabelsRetType) { setImageGetLabelsAttributeType(&o.Labels, v) } // GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetMinDiskSize() (res ImageGetMinDiskSizeRetType) { res, _ = o.GetMinDiskSizeOk() return @@ -608,22 +758,26 @@ func (o *Image) GetMinDiskSize() (res ImageGetMinDiskSizeRetType) { // GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetMinDiskSizeOk() (ret ImageGetMinDiskSizeRetType, ok bool) { return getImageGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) } // HasMinDiskSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasMinDiskSize() bool { _, ok := o.GetMinDiskSizeOk() return ok } // SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetMinDiskSize(v ImageGetMinDiskSizeRetType) { setImageGetMinDiskSizeAttributeType(&o.MinDiskSize, v) } // GetMinRam returns the MinRam field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetMinRam() (res ImageGetMinRamRetType) { res, _ = o.GetMinRamOk() return @@ -631,22 +785,26 @@ func (o *Image) GetMinRam() (res ImageGetMinRamRetType) { // GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetMinRamOk() (ret ImageGetMinRamRetType, ok bool) { return getImageGetMinRamAttributeTypeOk(o.MinRam) } // HasMinRam returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasMinRam() bool { _, ok := o.GetMinRamOk() return ok } // SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetMinRam(v ImageGetMinRamRetType) { setImageGetMinRamAttributeType(&o.MinRam, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetName() (ret ImageGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -654,16 +812,19 @@ func (o *Image) GetName() (ret ImageGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetNameOk() (ret ImageGetNameRetType, ok bool) { return getImageGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetName(v ImageGetNameRetType) { setImageGetNameAttributeType(&o.Name, v) } // GetOwner returns the Owner field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetOwner() (res ImageGetOwnerRetType) { res, _ = o.GetOwnerOk() return @@ -671,22 +832,26 @@ func (o *Image) GetOwner() (res ImageGetOwnerRetType) { // GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetOwnerOk() (ret ImageGetOwnerRetType, ok bool) { return getImageGetOwnerAttributeTypeOk(o.Owner) } // HasOwner returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasOwner() bool { _, ok := o.GetOwnerOk() return ok } // SetOwner gets a reference to the given string and assigns it to the Owner field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetOwner(v ImageGetOwnerRetType) { setImageGetOwnerAttributeType(&o.Owner, v) } // GetProtected returns the Protected field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetProtected() (res ImagegetProtectedRetType) { res, _ = o.GetProtectedOk() return @@ -694,22 +859,26 @@ func (o *Image) GetProtected() (res ImagegetProtectedRetType) { // GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetProtectedOk() (ret ImagegetProtectedRetType, ok bool) { return getImagegetProtectedAttributeTypeOk(o.Protected) } // HasProtected returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasProtected() bool { _, ok := o.GetProtectedOk() return ok } // SetProtected gets a reference to the given bool and assigns it to the Protected field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetProtected(v ImagegetProtectedRetType) { setImagegetProtectedAttributeType(&o.Protected, v) } // GetScope returns the Scope field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetScope() (res ImageGetScopeRetType) { res, _ = o.GetScopeOk() return @@ -717,22 +886,26 @@ func (o *Image) GetScope() (res ImageGetScopeRetType) { // GetScopeOk returns a tuple with the Scope field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetScopeOk() (ret ImageGetScopeRetType, ok bool) { return getImageGetScopeAttributeTypeOk(o.Scope) } // HasScope returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasScope() bool { _, ok := o.GetScopeOk() return ok } // SetScope gets a reference to the given string and assigns it to the Scope field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetScope(v ImageGetScopeRetType) { setImageGetScopeAttributeType(&o.Scope, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetSize() (res ImageGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -740,22 +913,26 @@ func (o *Image) GetSize() (res ImageGetSizeRetType) { // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetSizeOk() (ret ImageGetSizeRetType, ok bool) { return getImageGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetSize(v ImageGetSizeRetType) { setImageGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetStatus() (res ImageGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -763,22 +940,26 @@ func (o *Image) GetStatus() (res ImageGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetStatusOk() (ret ImageGetStatusRetType, ok bool) { return getImageGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetStatus(v ImageGetStatusRetType) { setImageGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetUpdatedAt() (res ImageGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -786,21 +967,25 @@ func (o *Image) GetUpdatedAt() (res ImageGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) GetUpdatedAtOk() (ret ImageGetUpdatedAtRetType, ok bool) { return getImageGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Image) SetUpdatedAt(v ImageGetUpdatedAtRetType) { setImageGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Image) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageGetAgentAttributeTypeOk(o.Agent); ok { @@ -857,37 +1042,45 @@ func (o Image) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImage struct { value *Image isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImage) Get() *Image { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImage) Set(val *Image) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImage) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImage) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImage(val *Image) *NullableImage { return &NullableImage{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImage) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImage) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image_agent.go b/services/iaas/model_image_agent.go index dcd862fb6..11de05b96 100644 --- a/services/iaas/model_image_agent.go +++ b/services/iaas/model_image_agent.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ImageAgent{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageAgentgetProvisionByDefaultAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageAgentgetProvisionByDefaultArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageAgentgetProvisionByDefaultRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageAgentgetProvisionByDefaultAttributeTypeOk(arg ImageAgentgetProvisionByDefaultAttributeType) (ret ImageAgentgetProvisionByDefaultRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getImageAgentgetProvisionByDefaultAttributeTypeOk(arg ImageAgentgetProvisio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageAgentgetProvisionByDefaultAttributeType(arg *ImageAgentgetProvisionByDefaultAttributeType, val ImageAgentgetProvisionByDefaultRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setImageAgentgetProvisionByDefaultAttributeType(arg *ImageAgentgetProvision */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageAgentgetSupportedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageAgentgetSupportedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageAgentgetSupportedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageAgentgetSupportedAttributeTypeOk(arg ImageAgentgetSupportedAttributeType) (ret ImageAgentgetSupportedRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getImageAgentgetSupportedAttributeTypeOk(arg ImageAgentgetSupportedAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageAgentgetSupportedAttributeType(arg *ImageAgentgetSupportedAttributeType, val ImageAgentgetSupportedRetType) { *arg = &val } // ImageAgent Support status and default provioning setting for the STACKIT server agent. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageAgent struct { // Default provioning of the STACKIT server agent for new servers. The default for new images is false. Can only be enabled when supported is also true. ProvisionByDefault ImageAgentgetProvisionByDefaultAttributeType `json:"provisionByDefault,omitempty"` @@ -69,6 +85,7 @@ type ImageAgent struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageAgent() *ImageAgent { this := ImageAgent{} return &this @@ -77,12 +94,14 @@ func NewImageAgent() *ImageAgent { // NewImageAgentWithDefaults instantiates a new ImageAgent object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageAgentWithDefaults() *ImageAgent { this := ImageAgent{} return &this } // GetProvisionByDefault returns the ProvisionByDefault field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageAgent) GetProvisionByDefault() (res ImageAgentgetProvisionByDefaultRetType) { res, _ = o.GetProvisionByDefaultOk() return @@ -90,22 +109,26 @@ func (o *ImageAgent) GetProvisionByDefault() (res ImageAgentgetProvisionByDefaul // GetProvisionByDefaultOk returns a tuple with the ProvisionByDefault field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageAgent) GetProvisionByDefaultOk() (ret ImageAgentgetProvisionByDefaultRetType, ok bool) { return getImageAgentgetProvisionByDefaultAttributeTypeOk(o.ProvisionByDefault) } // HasProvisionByDefault returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageAgent) HasProvisionByDefault() bool { _, ok := o.GetProvisionByDefaultOk() return ok } // SetProvisionByDefault gets a reference to the given bool and assigns it to the ProvisionByDefault field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageAgent) SetProvisionByDefault(v ImageAgentgetProvisionByDefaultRetType) { setImageAgentgetProvisionByDefaultAttributeType(&o.ProvisionByDefault, v) } // GetSupported returns the Supported field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageAgent) GetSupported() (res ImageAgentgetSupportedRetType) { res, _ = o.GetSupportedOk() return @@ -113,21 +136,25 @@ func (o *ImageAgent) GetSupported() (res ImageAgentgetSupportedRetType) { // GetSupportedOk returns a tuple with the Supported field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageAgent) GetSupportedOk() (ret ImageAgentgetSupportedRetType, ok bool) { return getImageAgentgetSupportedAttributeTypeOk(o.Supported) } // HasSupported returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageAgent) HasSupported() bool { _, ok := o.GetSupportedOk() return ok } // SetSupported gets a reference to the given bool and assigns it to the Supported field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageAgent) SetSupported(v ImageAgentgetSupportedRetType) { setImageAgentgetSupportedAttributeType(&o.Supported, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ImageAgent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageAgentgetProvisionByDefaultAttributeTypeOk(o.ProvisionByDefault); ok { @@ -139,37 +166,45 @@ func (o ImageAgent) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImageAgent struct { value *ImageAgent isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageAgent) Get() *ImageAgent { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageAgent) Set(val *ImageAgent) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageAgent) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageAgent) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImageAgent(val *ImageAgent) *NullableImageAgent { return &NullableImageAgent{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageAgent) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageAgent) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image_checksum.go b/services/iaas/model_image_checksum.go index ca733b5c6..f1a332050 100644 --- a/services/iaas/model_image_checksum.go +++ b/services/iaas/model_image_checksum.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ImageChecksum{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageChecksumGetAlgorithmAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageChecksumGetAlgorithmAttributeTypeOk(arg ImageChecksumGetAlgorithmAttributeType) (ret ImageChecksumGetAlgorithmRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getImageChecksumGetAlgorithmAttributeTypeOk(arg ImageChecksumGetAlgorithmAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageChecksumGetAlgorithmAttributeType(arg *ImageChecksumGetAlgorithmAttributeType, val ImageChecksumGetAlgorithmRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageChecksumGetAlgorithmArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageChecksumGetAlgorithmRetType = string /* @@ -43,8 +50,10 @@ type ImageChecksumGetAlgorithmRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageChecksumGetDigestAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageChecksumGetDigestAttributeTypeOk(arg ImageChecksumGetDigestAttributeType) (ret ImageChecksumGetDigestRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getImageChecksumGetDigestAttributeTypeOk(arg ImageChecksumGetDigestAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageChecksumGetDigestAttributeType(arg *ImageChecksumGetDigestAttributeType, val ImageChecksumGetDigestRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageChecksumGetDigestArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageChecksumGetDigestRetType = string // ImageChecksum Representation of an image checksum. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageChecksum struct { // Algorithm for the checksum of the image data. Possible values: `md5`, `sha512`. // REQUIRED @@ -69,12 +83,14 @@ type ImageChecksum struct { Digest ImageChecksumGetDigestAttributeType `json:"digest" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ImageChecksum ImageChecksum // NewImageChecksum instantiates a new ImageChecksum object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageChecksum(algorithm ImageChecksumGetAlgorithmArgType, digest ImageChecksumGetDigestArgType) *ImageChecksum { this := ImageChecksum{} setImageChecksumGetAlgorithmAttributeType(&this.Algorithm, algorithm) @@ -85,12 +101,14 @@ func NewImageChecksum(algorithm ImageChecksumGetAlgorithmArgType, digest ImageCh // NewImageChecksumWithDefaults instantiates a new ImageChecksum object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageChecksumWithDefaults() *ImageChecksum { this := ImageChecksum{} return &this } // GetAlgorithm returns the Algorithm field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageChecksum) GetAlgorithm() (ret ImageChecksumGetAlgorithmRetType) { ret, _ = o.GetAlgorithmOk() return ret @@ -98,16 +116,19 @@ func (o *ImageChecksum) GetAlgorithm() (ret ImageChecksumGetAlgorithmRetType) { // GetAlgorithmOk returns a tuple with the Algorithm field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageChecksum) GetAlgorithmOk() (ret ImageChecksumGetAlgorithmRetType, ok bool) { return getImageChecksumGetAlgorithmAttributeTypeOk(o.Algorithm) } // SetAlgorithm sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageChecksum) SetAlgorithm(v ImageChecksumGetAlgorithmRetType) { setImageChecksumGetAlgorithmAttributeType(&o.Algorithm, v) } // GetDigest returns the Digest field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageChecksum) GetDigest() (ret ImageChecksumGetDigestRetType) { ret, _ = o.GetDigestOk() return ret @@ -115,15 +136,18 @@ func (o *ImageChecksum) GetDigest() (ret ImageChecksumGetDigestRetType) { // GetDigestOk returns a tuple with the Digest field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageChecksum) GetDigestOk() (ret ImageChecksumGetDigestRetType, ok bool) { return getImageChecksumGetDigestAttributeTypeOk(o.Digest) } // SetDigest sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageChecksum) SetDigest(v ImageChecksumGetDigestRetType) { setImageChecksumGetDigestAttributeType(&o.Digest, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ImageChecksum) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageChecksumGetAlgorithmAttributeTypeOk(o.Algorithm); ok { @@ -135,37 +159,45 @@ func (o ImageChecksum) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImageChecksum struct { value *ImageChecksum isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageChecksum) Get() *ImageChecksum { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageChecksum) Set(val *ImageChecksum) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageChecksum) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageChecksum) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImageChecksum(val *ImageChecksum) *NullableImageChecksum { return &NullableImageChecksum{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageChecksum) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageChecksum) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image_config.go b/services/iaas/model_image_config.go index ad7bd89a2..d82689b6a 100644 --- a/services/iaas/model_image_config.go +++ b/services/iaas/model_image_config.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ImageConfig{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetArchitectureAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetArchitectureAttributeTypeOk(arg ImageConfigGetArchitectureAttributeType) (ret ImageConfigGetArchitectureRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getImageConfigGetArchitectureAttributeTypeOk(arg ImageConfigGetArchitecture return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetArchitectureAttributeType(arg *ImageConfigGetArchitectureAttributeType, val ImageConfigGetArchitectureRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetArchitectureArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetArchitectureRetType = string /* @@ -43,10 +50,16 @@ type ImageConfigGetArchitectureRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetBootMenuAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetBootMenuArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetBootMenuRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfiggetBootMenuAttributeTypeOk(arg ImageConfiggetBootMenuAttributeType) (ret ImageConfiggetBootMenuRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getImageConfiggetBootMenuAttributeTypeOk(arg ImageConfiggetBootMenuAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfiggetBootMenuAttributeType(arg *ImageConfiggetBootMenuAttributeType, val ImageConfiggetBootMenuRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setImageConfiggetBootMenuAttributeType(arg *ImageConfiggetBootMenuAttribute */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetCdromBusAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetCdromBusAttributeTypeOk(arg ImageConfigGetCdromBusAttributeType) (ret ImageConfigGetCdromBusRetType, ok bool) { if arg == nil { return nil, false @@ -72,6 +88,7 @@ func getImageConfigGetCdromBusAttributeTypeOk(arg ImageConfigGetCdromBusAttribut return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetCdromBusAttributeType(arg *ImageConfigGetCdromBusAttributeType, val ImageConfigGetCdromBusRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -80,7 +97,10 @@ func setImageConfigGetCdromBusAttributeType(arg *ImageConfigGetCdromBusAttribute } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetCdromBusArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetCdromBusRetType = *string /* @@ -88,8 +108,10 @@ type ImageConfigGetCdromBusRetType = *string */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetDiskBusAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetDiskBusAttributeTypeOk(arg ImageConfigGetDiskBusAttributeType) (ret ImageConfigGetDiskBusRetType, ok bool) { if arg == nil { return nil, false @@ -97,6 +119,7 @@ func getImageConfigGetDiskBusAttributeTypeOk(arg ImageConfigGetDiskBusAttributeT return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetDiskBusAttributeType(arg *ImageConfigGetDiskBusAttributeType, val ImageConfigGetDiskBusRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -105,7 +128,10 @@ func setImageConfigGetDiskBusAttributeType(arg *ImageConfigGetDiskBusAttributeTy } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetDiskBusArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetDiskBusRetType = *string /* @@ -113,8 +139,10 @@ type ImageConfigGetDiskBusRetType = *string */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetNicModelAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetNicModelAttributeTypeOk(arg ImageConfigGetNicModelAttributeType) (ret ImageConfigGetNicModelRetType, ok bool) { if arg == nil { return nil, false @@ -122,6 +150,7 @@ func getImageConfigGetNicModelAttributeTypeOk(arg ImageConfigGetNicModelAttribut return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetNicModelAttributeType(arg *ImageConfigGetNicModelAttributeType, val ImageConfigGetNicModelRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -130,7 +159,10 @@ func setImageConfigGetNicModelAttributeType(arg *ImageConfigGetNicModelAttribute } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetNicModelArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetNicModelRetType = *string /* @@ -138,8 +170,10 @@ type ImageConfigGetNicModelRetType = *string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetOperatingSystemAttributeTypeOk(arg ImageConfigGetOperatingSystemAttributeType) (ret ImageConfigGetOperatingSystemRetType, ok bool) { if arg == nil { return ret, false @@ -147,11 +181,15 @@ func getImageConfigGetOperatingSystemAttributeTypeOk(arg ImageConfigGetOperating return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetOperatingSystemAttributeType(arg *ImageConfigGetOperatingSystemAttributeType, val ImageConfigGetOperatingSystemRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemRetType = string /* @@ -159,8 +197,10 @@ type ImageConfigGetOperatingSystemRetType = string */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemDistroAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetOperatingSystemDistroAttributeTypeOk(arg ImageConfigGetOperatingSystemDistroAttributeType) (ret ImageConfigGetOperatingSystemDistroRetType, ok bool) { if arg == nil { return nil, false @@ -168,6 +208,7 @@ func getImageConfigGetOperatingSystemDistroAttributeTypeOk(arg ImageConfigGetOpe return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetOperatingSystemDistroAttributeType(arg *ImageConfigGetOperatingSystemDistroAttributeType, val ImageConfigGetOperatingSystemDistroRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -176,7 +217,10 @@ func setImageConfigGetOperatingSystemDistroAttributeType(arg *ImageConfigGetOper } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemDistroArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemDistroRetType = *string /* @@ -184,8 +228,10 @@ type ImageConfigGetOperatingSystemDistroRetType = *string */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemVersionAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetOperatingSystemVersionAttributeTypeOk(arg ImageConfigGetOperatingSystemVersionAttributeType) (ret ImageConfigGetOperatingSystemVersionRetType, ok bool) { if arg == nil { return nil, false @@ -193,6 +239,7 @@ func getImageConfigGetOperatingSystemVersionAttributeTypeOk(arg ImageConfigGetOp return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetOperatingSystemVersionAttributeType(arg *ImageConfigGetOperatingSystemVersionAttributeType, val ImageConfigGetOperatingSystemVersionRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -201,7 +248,10 @@ func setImageConfigGetOperatingSystemVersionAttributeType(arg *ImageConfigGetOpe } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemVersionArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetOperatingSystemVersionRetType = *string /* @@ -209,8 +259,10 @@ type ImageConfigGetOperatingSystemVersionRetType = *string */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetRescueBusAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetRescueBusAttributeTypeOk(arg ImageConfigGetRescueBusAttributeType) (ret ImageConfigGetRescueBusRetType, ok bool) { if arg == nil { return nil, false @@ -218,6 +270,7 @@ func getImageConfigGetRescueBusAttributeTypeOk(arg ImageConfigGetRescueBusAttrib return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetRescueBusAttributeType(arg *ImageConfigGetRescueBusAttributeType, val ImageConfigGetRescueBusRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -226,7 +279,10 @@ func setImageConfigGetRescueBusAttributeType(arg *ImageConfigGetRescueBusAttribu } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetRescueBusArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetRescueBusRetType = *string /* @@ -234,8 +290,10 @@ type ImageConfigGetRescueBusRetType = *string */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetRescueDeviceAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetRescueDeviceAttributeTypeOk(arg ImageConfigGetRescueDeviceAttributeType) (ret ImageConfigGetRescueDeviceRetType, ok bool) { if arg == nil { return nil, false @@ -243,6 +301,7 @@ func getImageConfigGetRescueDeviceAttributeTypeOk(arg ImageConfigGetRescueDevice return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetRescueDeviceAttributeType(arg *ImageConfigGetRescueDeviceAttributeType, val ImageConfigGetRescueDeviceRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -251,7 +310,10 @@ func setImageConfigGetRescueDeviceAttributeType(arg *ImageConfigGetRescueDeviceA } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetRescueDeviceArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetRescueDeviceRetType = *string /* @@ -259,10 +321,16 @@ type ImageConfigGetRescueDeviceRetType = *string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetSecureBootAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetSecureBootArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetSecureBootRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfiggetSecureBootAttributeTypeOk(arg ImageConfiggetSecureBootAttributeType) (ret ImageConfiggetSecureBootRetType, ok bool) { if arg == nil { return ret, false @@ -270,6 +338,7 @@ func getImageConfiggetSecureBootAttributeTypeOk(arg ImageConfiggetSecureBootAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfiggetSecureBootAttributeType(arg *ImageConfiggetSecureBootAttributeType, val ImageConfiggetSecureBootRetType) { *arg = &val } @@ -279,10 +348,16 @@ func setImageConfiggetSecureBootAttributeType(arg *ImageConfiggetSecureBootAttri */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetUefiAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetUefiArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetUefiRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfiggetUefiAttributeTypeOk(arg ImageConfiggetUefiAttributeType) (ret ImageConfiggetUefiRetType, ok bool) { if arg == nil { return ret, false @@ -290,6 +365,7 @@ func getImageConfiggetUefiAttributeTypeOk(arg ImageConfiggetUefiAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfiggetUefiAttributeType(arg *ImageConfiggetUefiAttributeType, val ImageConfiggetUefiRetType) { *arg = &val } @@ -299,8 +375,10 @@ func setImageConfiggetUefiAttributeType(arg *ImageConfiggetUefiAttributeType, va */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetVideoModelAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfigGetVideoModelAttributeTypeOk(arg ImageConfigGetVideoModelAttributeType) (ret ImageConfigGetVideoModelRetType, ok bool) { if arg == nil { return nil, false @@ -308,6 +386,7 @@ func getImageConfigGetVideoModelAttributeTypeOk(arg ImageConfigGetVideoModelAttr return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfigGetVideoModelAttributeType(arg *ImageConfigGetVideoModelAttributeType, val ImageConfigGetVideoModelRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -316,7 +395,10 @@ func setImageConfigGetVideoModelAttributeType(arg *ImageConfigGetVideoModelAttri } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetVideoModelArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfigGetVideoModelRetType = *string /* @@ -324,10 +406,16 @@ type ImageConfigGetVideoModelRetType = *string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetVirtioScsiAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetVirtioScsiArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfiggetVirtioScsiRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageConfiggetVirtioScsiAttributeTypeOk(arg ImageConfiggetVirtioScsiAttributeType) (ret ImageConfiggetVirtioScsiRetType, ok bool) { if arg == nil { return ret, false @@ -335,11 +423,13 @@ func getImageConfiggetVirtioScsiAttributeTypeOk(arg ImageConfiggetVirtioScsiAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageConfiggetVirtioScsiAttributeType(arg *ImageConfiggetVirtioScsiAttributeType, val ImageConfiggetVirtioScsiRetType) { *arg = &val } // ImageConfig Properties to set hardware and scheduling settings for an Image. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageConfig struct { // Represents CPU architecture. The default for new images is x86. Possible values: `arm64`, `x86`. Architecture ImageConfigGetArchitectureAttributeType `json:"architecture,omitempty"` @@ -375,6 +465,7 @@ type ImageConfig struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageConfig() *ImageConfig { this := ImageConfig{} return &this @@ -383,12 +474,14 @@ func NewImageConfig() *ImageConfig { // NewImageConfigWithDefaults instantiates a new ImageConfig object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageConfigWithDefaults() *ImageConfig { this := ImageConfig{} return &this } // GetArchitecture returns the Architecture field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetArchitecture() (res ImageConfigGetArchitectureRetType) { res, _ = o.GetArchitectureOk() return @@ -396,22 +489,26 @@ func (o *ImageConfig) GetArchitecture() (res ImageConfigGetArchitectureRetType) // GetArchitectureOk returns a tuple with the Architecture field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetArchitectureOk() (ret ImageConfigGetArchitectureRetType, ok bool) { return getImageConfigGetArchitectureAttributeTypeOk(o.Architecture) } // HasArchitecture returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasArchitecture() bool { _, ok := o.GetArchitectureOk() return ok } // SetArchitecture gets a reference to the given string and assigns it to the Architecture field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetArchitecture(v ImageConfigGetArchitectureRetType) { setImageConfigGetArchitectureAttributeType(&o.Architecture, v) } // GetBootMenu returns the BootMenu field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetBootMenu() (res ImageConfiggetBootMenuRetType) { res, _ = o.GetBootMenuOk() return @@ -419,22 +516,26 @@ func (o *ImageConfig) GetBootMenu() (res ImageConfiggetBootMenuRetType) { // GetBootMenuOk returns a tuple with the BootMenu field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetBootMenuOk() (ret ImageConfiggetBootMenuRetType, ok bool) { return getImageConfiggetBootMenuAttributeTypeOk(o.BootMenu) } // HasBootMenu returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasBootMenu() bool { _, ok := o.GetBootMenuOk() return ok } // SetBootMenu gets a reference to the given bool and assigns it to the BootMenu field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetBootMenu(v ImageConfiggetBootMenuRetType) { setImageConfiggetBootMenuAttributeType(&o.BootMenu, v) } // GetCdromBus returns the CdromBus field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetCdromBus() (res ImageConfigGetCdromBusRetType) { res, _ = o.GetCdromBusOk() return @@ -443,32 +544,38 @@ func (o *ImageConfig) GetCdromBus() (res ImageConfigGetCdromBusRetType) { // GetCdromBusOk returns a tuple with the CdromBus field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetCdromBusOk() (ret ImageConfigGetCdromBusRetType, ok bool) { return getImageConfigGetCdromBusAttributeTypeOk(o.CdromBus) } // HasCdromBus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasCdromBus() bool { _, ok := o.GetCdromBusOk() return ok } // SetCdromBus gets a reference to the given string and assigns it to the CdromBus field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetCdromBus(v ImageConfigGetCdromBusRetType) { setImageConfigGetCdromBusAttributeType(&o.CdromBus, v) } // SetCdromBusNil sets the value for CdromBus to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetCdromBusNil() { o.CdromBus = nil } // UnsetCdromBus ensures that no value is present for CdromBus, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) UnsetCdromBus() { o.CdromBus = nil } // GetDiskBus returns the DiskBus field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetDiskBus() (res ImageConfigGetDiskBusRetType) { res, _ = o.GetDiskBusOk() return @@ -477,32 +584,38 @@ func (o *ImageConfig) GetDiskBus() (res ImageConfigGetDiskBusRetType) { // GetDiskBusOk returns a tuple with the DiskBus field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetDiskBusOk() (ret ImageConfigGetDiskBusRetType, ok bool) { return getImageConfigGetDiskBusAttributeTypeOk(o.DiskBus) } // HasDiskBus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasDiskBus() bool { _, ok := o.GetDiskBusOk() return ok } // SetDiskBus gets a reference to the given string and assigns it to the DiskBus field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetDiskBus(v ImageConfigGetDiskBusRetType) { setImageConfigGetDiskBusAttributeType(&o.DiskBus, v) } // SetDiskBusNil sets the value for DiskBus to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetDiskBusNil() { o.DiskBus = nil } // UnsetDiskBus ensures that no value is present for DiskBus, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) UnsetDiskBus() { o.DiskBus = nil } // GetNicModel returns the NicModel field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetNicModel() (res ImageConfigGetNicModelRetType) { res, _ = o.GetNicModelOk() return @@ -511,32 +624,38 @@ func (o *ImageConfig) GetNicModel() (res ImageConfigGetNicModelRetType) { // GetNicModelOk returns a tuple with the NicModel field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetNicModelOk() (ret ImageConfigGetNicModelRetType, ok bool) { return getImageConfigGetNicModelAttributeTypeOk(o.NicModel) } // HasNicModel returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasNicModel() bool { _, ok := o.GetNicModelOk() return ok } // SetNicModel gets a reference to the given string and assigns it to the NicModel field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetNicModel(v ImageConfigGetNicModelRetType) { setImageConfigGetNicModelAttributeType(&o.NicModel, v) } // SetNicModelNil sets the value for NicModel to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetNicModelNil() { o.NicModel = nil } // UnsetNicModel ensures that no value is present for NicModel, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) UnsetNicModel() { o.NicModel = nil } // GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetOperatingSystem() (res ImageConfigGetOperatingSystemRetType) { res, _ = o.GetOperatingSystemOk() return @@ -544,22 +663,26 @@ func (o *ImageConfig) GetOperatingSystem() (res ImageConfigGetOperatingSystemRet // GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetOperatingSystemOk() (ret ImageConfigGetOperatingSystemRetType, ok bool) { return getImageConfigGetOperatingSystemAttributeTypeOk(o.OperatingSystem) } // HasOperatingSystem returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasOperatingSystem() bool { _, ok := o.GetOperatingSystemOk() return ok } // SetOperatingSystem gets a reference to the given string and assigns it to the OperatingSystem field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetOperatingSystem(v ImageConfigGetOperatingSystemRetType) { setImageConfigGetOperatingSystemAttributeType(&o.OperatingSystem, v) } // GetOperatingSystemDistro returns the OperatingSystemDistro field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetOperatingSystemDistro() (res ImageConfigGetOperatingSystemDistroRetType) { res, _ = o.GetOperatingSystemDistroOk() return @@ -568,32 +691,38 @@ func (o *ImageConfig) GetOperatingSystemDistro() (res ImageConfigGetOperatingSys // GetOperatingSystemDistroOk returns a tuple with the OperatingSystemDistro field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetOperatingSystemDistroOk() (ret ImageConfigGetOperatingSystemDistroRetType, ok bool) { return getImageConfigGetOperatingSystemDistroAttributeTypeOk(o.OperatingSystemDistro) } // HasOperatingSystemDistro returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasOperatingSystemDistro() bool { _, ok := o.GetOperatingSystemDistroOk() return ok } // SetOperatingSystemDistro gets a reference to the given string and assigns it to the OperatingSystemDistro field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetOperatingSystemDistro(v ImageConfigGetOperatingSystemDistroRetType) { setImageConfigGetOperatingSystemDistroAttributeType(&o.OperatingSystemDistro, v) } // SetOperatingSystemDistroNil sets the value for OperatingSystemDistro to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetOperatingSystemDistroNil() { o.OperatingSystemDistro = nil } // UnsetOperatingSystemDistro ensures that no value is present for OperatingSystemDistro, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) UnsetOperatingSystemDistro() { o.OperatingSystemDistro = nil } // GetOperatingSystemVersion returns the OperatingSystemVersion field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetOperatingSystemVersion() (res ImageConfigGetOperatingSystemVersionRetType) { res, _ = o.GetOperatingSystemVersionOk() return @@ -602,32 +731,38 @@ func (o *ImageConfig) GetOperatingSystemVersion() (res ImageConfigGetOperatingSy // GetOperatingSystemVersionOk returns a tuple with the OperatingSystemVersion field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetOperatingSystemVersionOk() (ret ImageConfigGetOperatingSystemVersionRetType, ok bool) { return getImageConfigGetOperatingSystemVersionAttributeTypeOk(o.OperatingSystemVersion) } // HasOperatingSystemVersion returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasOperatingSystemVersion() bool { _, ok := o.GetOperatingSystemVersionOk() return ok } // SetOperatingSystemVersion gets a reference to the given string and assigns it to the OperatingSystemVersion field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetOperatingSystemVersion(v ImageConfigGetOperatingSystemVersionRetType) { setImageConfigGetOperatingSystemVersionAttributeType(&o.OperatingSystemVersion, v) } // SetOperatingSystemVersionNil sets the value for OperatingSystemVersion to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetOperatingSystemVersionNil() { o.OperatingSystemVersion = nil } // UnsetOperatingSystemVersion ensures that no value is present for OperatingSystemVersion, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) UnsetOperatingSystemVersion() { o.OperatingSystemVersion = nil } // GetRescueBus returns the RescueBus field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetRescueBus() (res ImageConfigGetRescueBusRetType) { res, _ = o.GetRescueBusOk() return @@ -636,32 +771,38 @@ func (o *ImageConfig) GetRescueBus() (res ImageConfigGetRescueBusRetType) { // GetRescueBusOk returns a tuple with the RescueBus field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetRescueBusOk() (ret ImageConfigGetRescueBusRetType, ok bool) { return getImageConfigGetRescueBusAttributeTypeOk(o.RescueBus) } // HasRescueBus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasRescueBus() bool { _, ok := o.GetRescueBusOk() return ok } // SetRescueBus gets a reference to the given string and assigns it to the RescueBus field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetRescueBus(v ImageConfigGetRescueBusRetType) { setImageConfigGetRescueBusAttributeType(&o.RescueBus, v) } // SetRescueBusNil sets the value for RescueBus to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetRescueBusNil() { o.RescueBus = nil } // UnsetRescueBus ensures that no value is present for RescueBus, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) UnsetRescueBus() { o.RescueBus = nil } // GetRescueDevice returns the RescueDevice field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetRescueDevice() (res ImageConfigGetRescueDeviceRetType) { res, _ = o.GetRescueDeviceOk() return @@ -670,32 +811,38 @@ func (o *ImageConfig) GetRescueDevice() (res ImageConfigGetRescueDeviceRetType) // GetRescueDeviceOk returns a tuple with the RescueDevice field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetRescueDeviceOk() (ret ImageConfigGetRescueDeviceRetType, ok bool) { return getImageConfigGetRescueDeviceAttributeTypeOk(o.RescueDevice) } // HasRescueDevice returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasRescueDevice() bool { _, ok := o.GetRescueDeviceOk() return ok } // SetRescueDevice gets a reference to the given string and assigns it to the RescueDevice field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetRescueDevice(v ImageConfigGetRescueDeviceRetType) { setImageConfigGetRescueDeviceAttributeType(&o.RescueDevice, v) } // SetRescueDeviceNil sets the value for RescueDevice to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetRescueDeviceNil() { o.RescueDevice = nil } // UnsetRescueDevice ensures that no value is present for RescueDevice, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) UnsetRescueDevice() { o.RescueDevice = nil } // GetSecureBoot returns the SecureBoot field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetSecureBoot() (res ImageConfiggetSecureBootRetType) { res, _ = o.GetSecureBootOk() return @@ -703,22 +850,26 @@ func (o *ImageConfig) GetSecureBoot() (res ImageConfiggetSecureBootRetType) { // GetSecureBootOk returns a tuple with the SecureBoot field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetSecureBootOk() (ret ImageConfiggetSecureBootRetType, ok bool) { return getImageConfiggetSecureBootAttributeTypeOk(o.SecureBoot) } // HasSecureBoot returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasSecureBoot() bool { _, ok := o.GetSecureBootOk() return ok } // SetSecureBoot gets a reference to the given bool and assigns it to the SecureBoot field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetSecureBoot(v ImageConfiggetSecureBootRetType) { setImageConfiggetSecureBootAttributeType(&o.SecureBoot, v) } // GetUefi returns the Uefi field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetUefi() (res ImageConfiggetUefiRetType) { res, _ = o.GetUefiOk() return @@ -726,22 +877,26 @@ func (o *ImageConfig) GetUefi() (res ImageConfiggetUefiRetType) { // GetUefiOk returns a tuple with the Uefi field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetUefiOk() (ret ImageConfiggetUefiRetType, ok bool) { return getImageConfiggetUefiAttributeTypeOk(o.Uefi) } // HasUefi returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasUefi() bool { _, ok := o.GetUefiOk() return ok } // SetUefi gets a reference to the given bool and assigns it to the Uefi field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetUefi(v ImageConfiggetUefiRetType) { setImageConfiggetUefiAttributeType(&o.Uefi, v) } // GetVideoModel returns the VideoModel field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetVideoModel() (res ImageConfigGetVideoModelRetType) { res, _ = o.GetVideoModelOk() return @@ -750,32 +905,38 @@ func (o *ImageConfig) GetVideoModel() (res ImageConfigGetVideoModelRetType) { // GetVideoModelOk returns a tuple with the VideoModel field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetVideoModelOk() (ret ImageConfigGetVideoModelRetType, ok bool) { return getImageConfigGetVideoModelAttributeTypeOk(o.VideoModel) } // HasVideoModel returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasVideoModel() bool { _, ok := o.GetVideoModelOk() return ok } // SetVideoModel gets a reference to the given string and assigns it to the VideoModel field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetVideoModel(v ImageConfigGetVideoModelRetType) { setImageConfigGetVideoModelAttributeType(&o.VideoModel, v) } // SetVideoModelNil sets the value for VideoModel to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetVideoModelNil() { o.VideoModel = nil } // UnsetVideoModel ensures that no value is present for VideoModel, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) UnsetVideoModel() { o.VideoModel = nil } // GetVirtioScsi returns the VirtioScsi field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetVirtioScsi() (res ImageConfiggetVirtioScsiRetType) { res, _ = o.GetVirtioScsiOk() return @@ -783,21 +944,25 @@ func (o *ImageConfig) GetVirtioScsi() (res ImageConfiggetVirtioScsiRetType) { // GetVirtioScsiOk returns a tuple with the VirtioScsi field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) GetVirtioScsiOk() (ret ImageConfiggetVirtioScsiRetType, ok bool) { return getImageConfiggetVirtioScsiAttributeTypeOk(o.VirtioScsi) } // HasVirtioScsi returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) HasVirtioScsi() bool { _, ok := o.GetVirtioScsiOk() return ok } // SetVirtioScsi gets a reference to the given bool and assigns it to the VirtioScsi field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageConfig) SetVirtioScsi(v ImageConfiggetVirtioScsiRetType) { setImageConfiggetVirtioScsiAttributeType(&o.VirtioScsi, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ImageConfig) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageConfigGetArchitectureAttributeTypeOk(o.Architecture); ok { @@ -845,37 +1010,45 @@ func (o ImageConfig) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImageConfig struct { value *ImageConfig isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageConfig) Get() *ImageConfig { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageConfig) Set(val *ImageConfig) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageConfig) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageConfig) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImageConfig(val *ImageConfig) *NullableImageConfig { return &NullableImageConfig{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageConfig) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageConfig) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image_create_response.go b/services/iaas/model_image_create_response.go index 0845d7e40..1e2cb5a50 100644 --- a/services/iaas/model_image_create_response.go +++ b/services/iaas/model_image_create_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ImageCreateResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageCreateResponseGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageCreateResponseGetIdAttributeTypeOk(arg ImageCreateResponseGetIdAttributeType) (ret ImageCreateResponseGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getImageCreateResponseGetIdAttributeTypeOk(arg ImageCreateResponseGetIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageCreateResponseGetIdAttributeType(arg *ImageCreateResponseGetIdAttributeType, val ImageCreateResponseGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageCreateResponseGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageCreateResponseGetIdRetType = string /* @@ -43,8 +50,10 @@ type ImageCreateResponseGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageCreateResponseGetUploadUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageCreateResponseGetUploadUrlAttributeTypeOk(arg ImageCreateResponseGetUploadUrlAttributeType) (ret ImageCreateResponseGetUploadUrlRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getImageCreateResponseGetUploadUrlAttributeTypeOk(arg ImageCreateResponseGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageCreateResponseGetUploadUrlAttributeType(arg *ImageCreateResponseGetUploadUrlAttributeType, val ImageCreateResponseGetUploadUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageCreateResponseGetUploadUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageCreateResponseGetUploadUrlRetType = string // ImageCreateResponse Image creation response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageCreateResponse struct { // Universally Unique Identifier (UUID). // REQUIRED @@ -68,12 +82,14 @@ type ImageCreateResponse struct { UploadUrl ImageCreateResponseGetUploadUrlAttributeType `json:"uploadUrl" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ImageCreateResponse ImageCreateResponse // NewImageCreateResponse instantiates a new ImageCreateResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageCreateResponse(id ImageCreateResponseGetIdArgType, uploadUrl ImageCreateResponseGetUploadUrlArgType) *ImageCreateResponse { this := ImageCreateResponse{} setImageCreateResponseGetIdAttributeType(&this.Id, id) @@ -84,12 +100,14 @@ func NewImageCreateResponse(id ImageCreateResponseGetIdArgType, uploadUrl ImageC // NewImageCreateResponseWithDefaults instantiates a new ImageCreateResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageCreateResponseWithDefaults() *ImageCreateResponse { this := ImageCreateResponse{} return &this } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageCreateResponse) GetId() (ret ImageCreateResponseGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -97,16 +115,19 @@ func (o *ImageCreateResponse) GetId() (ret ImageCreateResponseGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageCreateResponse) GetIdOk() (ret ImageCreateResponseGetIdRetType, ok bool) { return getImageCreateResponseGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageCreateResponse) SetId(v ImageCreateResponseGetIdRetType) { setImageCreateResponseGetIdAttributeType(&o.Id, v) } // GetUploadUrl returns the UploadUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageCreateResponse) GetUploadUrl() (ret ImageCreateResponseGetUploadUrlRetType) { ret, _ = o.GetUploadUrlOk() return ret @@ -114,15 +135,18 @@ func (o *ImageCreateResponse) GetUploadUrl() (ret ImageCreateResponseGetUploadUr // GetUploadUrlOk returns a tuple with the UploadUrl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageCreateResponse) GetUploadUrlOk() (ret ImageCreateResponseGetUploadUrlRetType, ok bool) { return getImageCreateResponseGetUploadUrlAttributeTypeOk(o.UploadUrl) } // SetUploadUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageCreateResponse) SetUploadUrl(v ImageCreateResponseGetUploadUrlRetType) { setImageCreateResponseGetUploadUrlAttributeType(&o.UploadUrl, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ImageCreateResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageCreateResponseGetIdAttributeTypeOk(o.Id); ok { @@ -134,37 +158,45 @@ func (o ImageCreateResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImageCreateResponse struct { value *ImageCreateResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageCreateResponse) Get() *ImageCreateResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageCreateResponse) Set(val *ImageCreateResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageCreateResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageCreateResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImageCreateResponse(val *ImageCreateResponse) *NullableImageCreateResponse { return &NullableImageCreateResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageCreateResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageCreateResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image_from_volume_payload.go b/services/iaas/model_image_from_volume_payload.go index 3aa7078dc..a5ac4c856 100644 --- a/services/iaas/model_image_from_volume_payload.go +++ b/services/iaas/model_image_from_volume_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ImageFromVolumePayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadGetDiskFormatAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageFromVolumePayloadGetDiskFormatAttributeTypeOk(arg ImageFromVolumePayloadGetDiskFormatAttributeType) (ret ImageFromVolumePayloadGetDiskFormatRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getImageFromVolumePayloadGetDiskFormatAttributeTypeOk(arg ImageFromVolumePa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageFromVolumePayloadGetDiskFormatAttributeType(arg *ImageFromVolumePayloadGetDiskFormatAttributeType, val ImageFromVolumePayloadGetDiskFormatRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadGetDiskFormatArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadGetDiskFormatRetType = string /* @@ -43,8 +50,10 @@ type ImageFromVolumePayloadGetDiskFormatRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageFromVolumePayloadGetNameAttributeTypeOk(arg ImageFromVolumePayloadGetNameAttributeType) (ret ImageFromVolumePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getImageFromVolumePayloadGetNameAttributeTypeOk(arg ImageFromVolumePayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageFromVolumePayloadGetNameAttributeType(arg *ImageFromVolumePayloadGetNameAttributeType, val ImageFromVolumePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadGetNameRetType = string /* @@ -64,10 +77,16 @@ type ImageFromVolumePayloadGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadgetProtectedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadgetProtectedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayloadgetProtectedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageFromVolumePayloadgetProtectedAttributeTypeOk(arg ImageFromVolumePayloadgetProtectedAttributeType) (ret ImageFromVolumePayloadgetProtectedRetType, ok bool) { if arg == nil { return ret, false @@ -75,14 +94,17 @@ func getImageFromVolumePayloadgetProtectedAttributeTypeOk(arg ImageFromVolumePay return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageFromVolumePayloadgetProtectedAttributeType(arg *ImageFromVolumePayloadgetProtectedAttributeType, val ImageFromVolumePayloadgetProtectedRetType) { *arg = &val } // ImageFromVolumePayload Object that represents the upload request of an image to a volume. Used for creating an image from a volume. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageFromVolumePayload struct { // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. - DiskFormat ImageFromVolumePayloadGetDiskFormatAttributeType `json:"diskFormat,omitempty"` + // REQUIRED + DiskFormat ImageFromVolumePayloadGetDiskFormatAttributeType `json:"diskFormat" required:"true"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED Name ImageFromVolumePayloadGetNameAttributeType `json:"name" required:"true"` @@ -90,14 +112,17 @@ type ImageFromVolumePayload struct { Protected ImageFromVolumePayloadgetProtectedAttributeType `json:"protected,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ImageFromVolumePayload ImageFromVolumePayload // NewImageFromVolumePayload instantiates a new ImageFromVolumePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewImageFromVolumePayload(name ImageFromVolumePayloadGetNameArgType) *ImageFromVolumePayload { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewImageFromVolumePayload(diskFormat ImageFromVolumePayloadGetDiskFormatArgType, name ImageFromVolumePayloadGetNameArgType) *ImageFromVolumePayload { this := ImageFromVolumePayload{} + setImageFromVolumePayloadGetDiskFormatAttributeType(&this.DiskFormat, diskFormat) setImageFromVolumePayloadGetNameAttributeType(&this.Name, name) return &this } @@ -105,6 +130,7 @@ func NewImageFromVolumePayload(name ImageFromVolumePayloadGetNameArgType) *Image // NewImageFromVolumePayloadWithDefaults instantiates a new ImageFromVolumePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageFromVolumePayloadWithDefaults() *ImageFromVolumePayload { this := ImageFromVolumePayload{} var protected bool = false @@ -112,30 +138,28 @@ func NewImageFromVolumePayloadWithDefaults() *ImageFromVolumePayload { return &this } -// GetDiskFormat returns the DiskFormat field value if set, zero value otherwise. -func (o *ImageFromVolumePayload) GetDiskFormat() (res ImageFromVolumePayloadGetDiskFormatRetType) { - res, _ = o.GetDiskFormatOk() - return +// GetDiskFormat returns the DiskFormat field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ImageFromVolumePayload) GetDiskFormat() (ret ImageFromVolumePayloadGetDiskFormatRetType) { + ret, _ = o.GetDiskFormatOk() + return ret } -// GetDiskFormatOk returns a tuple with the DiskFormat field value if set, nil otherwise +// GetDiskFormatOk returns a tuple with the DiskFormat field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) GetDiskFormatOk() (ret ImageFromVolumePayloadGetDiskFormatRetType, ok bool) { return getImageFromVolumePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat) } -// HasDiskFormat returns a boolean if a field has been set. -func (o *ImageFromVolumePayload) HasDiskFormat() bool { - _, ok := o.GetDiskFormatOk() - return ok -} - -// SetDiskFormat gets a reference to the given string and assigns it to the DiskFormat field. +// SetDiskFormat sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) SetDiskFormat(v ImageFromVolumePayloadGetDiskFormatRetType) { setImageFromVolumePayloadGetDiskFormatAttributeType(&o.DiskFormat, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) GetName() (ret ImageFromVolumePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -143,16 +167,19 @@ func (o *ImageFromVolumePayload) GetName() (ret ImageFromVolumePayloadGetNameRet // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) GetNameOk() (ret ImageFromVolumePayloadGetNameRetType, ok bool) { return getImageFromVolumePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) SetName(v ImageFromVolumePayloadGetNameRetType) { setImageFromVolumePayloadGetNameAttributeType(&o.Name, v) } // GetProtected returns the Protected field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) GetProtected() (res ImageFromVolumePayloadgetProtectedRetType) { res, _ = o.GetProtectedOk() return @@ -160,21 +187,25 @@ func (o *ImageFromVolumePayload) GetProtected() (res ImageFromVolumePayloadgetPr // GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) GetProtectedOk() (ret ImageFromVolumePayloadgetProtectedRetType, ok bool) { return getImageFromVolumePayloadgetProtectedAttributeTypeOk(o.Protected) } // HasProtected returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) HasProtected() bool { _, ok := o.GetProtectedOk() return ok } // SetProtected gets a reference to the given bool and assigns it to the Protected field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageFromVolumePayload) SetProtected(v ImageFromVolumePayloadgetProtectedRetType) { setImageFromVolumePayloadgetProtectedAttributeType(&o.Protected, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ImageFromVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageFromVolumePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat); ok { @@ -189,37 +220,45 @@ func (o ImageFromVolumePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImageFromVolumePayload struct { value *ImageFromVolumePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageFromVolumePayload) Get() *ImageFromVolumePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageFromVolumePayload) Set(val *ImageFromVolumePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageFromVolumePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageFromVolumePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImageFromVolumePayload(val *ImageFromVolumePayload) *NullableImageFromVolumePayload { return &NullableImageFromVolumePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageFromVolumePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageFromVolumePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image_list_response.go b/services/iaas/model_image_list_response.go index 5b1b6b1da..68afd3601 100644 --- a/services/iaas/model_image_list_response.go +++ b/services/iaas/model_image_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ImageListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageListResponseGetItemsAttributeType = *[]Image + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageListResponseGetItemsArgType = []Image + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageListResponseGetItemsRetType = []Image +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageListResponseGetItemsAttributeTypeOk(arg ImageListResponseGetItemsAttributeType) (ret ImageListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getImageListResponseGetItemsAttributeTypeOk(arg ImageListResponseGetItemsAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageListResponseGetItemsAttributeType(arg *ImageListResponseGetItemsAttributeType, val ImageListResponseGetItemsRetType) { *arg = &val } // ImageListResponse Image list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageListResponse struct { // A list containing image objects. // REQUIRED Items ImageListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ImageListResponse ImageListResponse // NewImageListResponse instantiates a new ImageListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageListResponse(items ImageListResponseGetItemsArgType) *ImageListResponse { this := ImageListResponse{} setImageListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewImageListResponse(items ImageListResponseGetItemsArgType) *ImageListResp // NewImageListResponseWithDefaults instantiates a new ImageListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageListResponseWithDefaults() *ImageListResponse { this := ImageListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageListResponse) GetItems() (ret ImageListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *ImageListResponse) GetItems() (ret ImageListResponseGetItemsRetType) { // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageListResponse) GetItemsOk() (ret ImageListResponseGetItemsRetType, ok bool) { return getImageListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageListResponse) SetItems(v ImageListResponseGetItemsRetType) { setImageListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ImageListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o ImageListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImageListResponse struct { value *ImageListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageListResponse) Get() *ImageListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageListResponse) Set(val *ImageListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImageListResponse(val *ImageListResponse) *NullableImageListResponse { return &NullableImageListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image_share.go b/services/iaas/model_image_share.go index 0e6901fdd..957956fd2 100644 --- a/services/iaas/model_image_share.go +++ b/services/iaas/model_image_share.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ImageShare{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageSharegetParentOrganizationAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageSharegetParentOrganizationArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageSharegetParentOrganizationRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageSharegetParentOrganizationAttributeTypeOk(arg ImageSharegetParentOrganizationAttributeType) (ret ImageSharegetParentOrganizationRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getImageSharegetParentOrganizationAttributeTypeOk(arg ImageSharegetParentOr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageSharegetParentOrganizationAttributeType(arg *ImageSharegetParentOrganizationAttributeType, val ImageSharegetParentOrganizationRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setImageSharegetParentOrganizationAttributeType(arg *ImageSharegetParentOrg */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareGetProjectsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareGetProjectsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareGetProjectsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageShareGetProjectsAttributeTypeOk(arg ImageShareGetProjectsAttributeType) (ret ImageShareGetProjectsRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getImageShareGetProjectsAttributeTypeOk(arg ImageShareGetProjectsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageShareGetProjectsAttributeType(arg *ImageShareGetProjectsAttributeType, val ImageShareGetProjectsRetType) { *arg = &val } // ImageShare Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShare struct { // Image is shared with all projects inside the image owners organization. ParentOrganization ImageSharegetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` @@ -69,6 +85,7 @@ type ImageShare struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageShare() *ImageShare { this := ImageShare{} return &this @@ -77,12 +94,14 @@ func NewImageShare() *ImageShare { // NewImageShareWithDefaults instantiates a new ImageShare object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageShareWithDefaults() *ImageShare { this := ImageShare{} return &this } // GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShare) GetParentOrganization() (res ImageSharegetParentOrganizationRetType) { res, _ = o.GetParentOrganizationOk() return @@ -90,22 +109,26 @@ func (o *ImageShare) GetParentOrganization() (res ImageSharegetParentOrganizatio // GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShare) GetParentOrganizationOk() (ret ImageSharegetParentOrganizationRetType, ok bool) { return getImageSharegetParentOrganizationAttributeTypeOk(o.ParentOrganization) } // HasParentOrganization returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShare) HasParentOrganization() bool { _, ok := o.GetParentOrganizationOk() return ok } // SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShare) SetParentOrganization(v ImageSharegetParentOrganizationRetType) { setImageSharegetParentOrganizationAttributeType(&o.ParentOrganization, v) } // GetProjects returns the Projects field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShare) GetProjects() (res ImageShareGetProjectsRetType) { res, _ = o.GetProjectsOk() return @@ -113,21 +136,25 @@ func (o *ImageShare) GetProjects() (res ImageShareGetProjectsRetType) { // GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShare) GetProjectsOk() (ret ImageShareGetProjectsRetType, ok bool) { return getImageShareGetProjectsAttributeTypeOk(o.Projects) } // HasProjects returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShare) HasProjects() bool { _, ok := o.GetProjectsOk() return ok } // SetProjects gets a reference to the given []string and assigns it to the Projects field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShare) SetProjects(v ImageShareGetProjectsRetType) { setImageShareGetProjectsAttributeType(&o.Projects, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ImageShare) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageSharegetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { @@ -139,37 +166,45 @@ func (o ImageShare) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImageShare struct { value *ImageShare isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageShare) Get() *ImageShare { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageShare) Set(val *ImageShare) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageShare) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageShare) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImageShare(val *ImageShare) *NullableImageShare { return &NullableImageShare{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageShare) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageShare) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_image_share_consumer.go b/services/iaas/model_image_share_consumer.go index 01590e648..2f9918e12 100644 --- a/services/iaas/model_image_share_consumer.go +++ b/services/iaas/model_image_share_consumer.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &ImageShareConsumer{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetConsumerProjectIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(arg ImageShareConsumerGetConsumerProjectIdAttributeType) (ret ImageShareConsumerGetConsumerProjectIdRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(arg ImageShareCons return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageShareConsumerGetConsumerProjectIdAttributeType(arg *ImageShareConsumerGetConsumerProjectIdAttributeType, val ImageShareConsumerGetConsumerProjectIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetConsumerProjectIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetConsumerProjectIdRetType = string /* @@ -44,10 +51,16 @@ type ImageShareConsumerGetConsumerProjectIdRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageShareConsumerGetCreatedAtAttributeTypeOk(arg ImageShareConsumerGetCreatedAtAttributeType) (ret ImageShareConsumerGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getImageShareConsumerGetCreatedAtAttributeTypeOk(arg ImageShareConsumerGetC return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageShareConsumerGetCreatedAtAttributeType(arg *ImageShareConsumerGetCreatedAtAttributeType, val ImageShareConsumerGetCreatedAtRetType) { *arg = &val } @@ -64,8 +78,10 @@ func setImageShareConsumerGetCreatedAtAttributeType(arg *ImageShareConsumerGetCr */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetImageIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageShareConsumerGetImageIdAttributeTypeOk(arg ImageShareConsumerGetImageIdAttributeType) (ret ImageShareConsumerGetImageIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getImageShareConsumerGetImageIdAttributeTypeOk(arg ImageShareConsumerGetIma return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageShareConsumerGetImageIdAttributeType(arg *ImageShareConsumerGetImageIdAttributeType, val ImageShareConsumerGetImageIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetImageIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetImageIdRetType = string /* @@ -85,10 +105,16 @@ type ImageShareConsumerGetImageIdRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumerGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getImageShareConsumerGetUpdatedAtAttributeTypeOk(arg ImageShareConsumerGetUpdatedAtAttributeType) (ret ImageShareConsumerGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -96,11 +122,13 @@ func getImageShareConsumerGetUpdatedAtAttributeTypeOk(arg ImageShareConsumerGetU return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setImageShareConsumerGetUpdatedAtAttributeType(arg *ImageShareConsumerGetUpdatedAtAttributeType, val ImageShareConsumerGetUpdatedAtRetType) { *arg = &val } // ImageShareConsumer The details of an Image share consumer. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ImageShareConsumer struct { // Universally Unique Identifier (UUID). ConsumerProjectId ImageShareConsumerGetConsumerProjectIdAttributeType `json:"consumerProjectId,omitempty"` @@ -116,6 +144,7 @@ type ImageShareConsumer struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageShareConsumer() *ImageShareConsumer { this := ImageShareConsumer{} return &this @@ -124,12 +153,14 @@ func NewImageShareConsumer() *ImageShareConsumer { // NewImageShareConsumerWithDefaults instantiates a new ImageShareConsumer object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewImageShareConsumerWithDefaults() *ImageShareConsumer { this := ImageShareConsumer{} return &this } // GetConsumerProjectId returns the ConsumerProjectId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) GetConsumerProjectId() (res ImageShareConsumerGetConsumerProjectIdRetType) { res, _ = o.GetConsumerProjectIdOk() return @@ -137,22 +168,26 @@ func (o *ImageShareConsumer) GetConsumerProjectId() (res ImageShareConsumerGetCo // GetConsumerProjectIdOk returns a tuple with the ConsumerProjectId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) GetConsumerProjectIdOk() (ret ImageShareConsumerGetConsumerProjectIdRetType, ok bool) { return getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(o.ConsumerProjectId) } // HasConsumerProjectId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) HasConsumerProjectId() bool { _, ok := o.GetConsumerProjectIdOk() return ok } // SetConsumerProjectId gets a reference to the given string and assigns it to the ConsumerProjectId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) SetConsumerProjectId(v ImageShareConsumerGetConsumerProjectIdRetType) { setImageShareConsumerGetConsumerProjectIdAttributeType(&o.ConsumerProjectId, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) GetCreatedAt() (res ImageShareConsumerGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -160,22 +195,26 @@ func (o *ImageShareConsumer) GetCreatedAt() (res ImageShareConsumerGetCreatedAtR // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) GetCreatedAtOk() (ret ImageShareConsumerGetCreatedAtRetType, ok bool) { return getImageShareConsumerGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) SetCreatedAt(v ImageShareConsumerGetCreatedAtRetType) { setImageShareConsumerGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetImageId returns the ImageId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) GetImageId() (res ImageShareConsumerGetImageIdRetType) { res, _ = o.GetImageIdOk() return @@ -183,22 +222,26 @@ func (o *ImageShareConsumer) GetImageId() (res ImageShareConsumerGetImageIdRetTy // GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) GetImageIdOk() (ret ImageShareConsumerGetImageIdRetType, ok bool) { return getImageShareConsumerGetImageIdAttributeTypeOk(o.ImageId) } // HasImageId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) HasImageId() bool { _, ok := o.GetImageIdOk() return ok } // SetImageId gets a reference to the given string and assigns it to the ImageId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) SetImageId(v ImageShareConsumerGetImageIdRetType) { setImageShareConsumerGetImageIdAttributeType(&o.ImageId, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) GetUpdatedAt() (res ImageShareConsumerGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -206,21 +249,25 @@ func (o *ImageShareConsumer) GetUpdatedAt() (res ImageShareConsumerGetUpdatedAtR // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) GetUpdatedAtOk() (ret ImageShareConsumerGetUpdatedAtRetType, ok bool) { return getImageShareConsumerGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ImageShareConsumer) SetUpdatedAt(v ImageShareConsumerGetUpdatedAtRetType) { setImageShareConsumerGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ImageShareConsumer) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getImageShareConsumerGetConsumerProjectIdAttributeTypeOk(o.ConsumerProjectId); ok { @@ -238,37 +285,45 @@ func (o ImageShareConsumer) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableImageShareConsumer struct { value *ImageShareConsumer isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageShareConsumer) Get() *ImageShareConsumer { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageShareConsumer) Set(val *ImageShareConsumer) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageShareConsumer) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageShareConsumer) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableImageShareConsumer(val *ImageShareConsumer) *NullableImageShareConsumer { return &NullableImageShareConsumer{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableImageShareConsumer) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableImageShareConsumer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_key_pair_list_response.go b/services/iaas/model_key_pair_list_response.go index 0486cc794..38c818496 100644 --- a/services/iaas/model_key_pair_list_response.go +++ b/services/iaas/model_key_pair_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &KeyPairListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeyPairListResponseGetItemsAttributeType = *[]Keypair + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeyPairListResponseGetItemsArgType = []Keypair + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeyPairListResponseGetItemsRetType = []Keypair +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getKeyPairListResponseGetItemsAttributeTypeOk(arg KeyPairListResponseGetItemsAttributeType) (ret KeyPairListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getKeyPairListResponseGetItemsAttributeTypeOk(arg KeyPairListResponseGetIte return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setKeyPairListResponseGetItemsAttributeType(arg *KeyPairListResponseGetItemsAttributeType, val KeyPairListResponseGetItemsRetType) { *arg = &val } // KeyPairListResponse SSH keypair list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeyPairListResponse struct { // A list of SSH keypairs. // REQUIRED Items KeyPairListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _KeyPairListResponse KeyPairListResponse // NewKeyPairListResponse instantiates a new KeyPairListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewKeyPairListResponse(items KeyPairListResponseGetItemsArgType) *KeyPairListResponse { this := KeyPairListResponse{} setKeyPairListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewKeyPairListResponse(items KeyPairListResponseGetItemsArgType) *KeyPairLi // NewKeyPairListResponseWithDefaults instantiates a new KeyPairListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewKeyPairListResponseWithDefaults() *KeyPairListResponse { this := KeyPairListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *KeyPairListResponse) GetItems() (ret KeyPairListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *KeyPairListResponse) GetItems() (ret KeyPairListResponseGetItemsRetType // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *KeyPairListResponse) GetItemsOk() (ret KeyPairListResponseGetItemsRetType, ok bool) { return getKeyPairListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *KeyPairListResponse) SetItems(v KeyPairListResponseGetItemsRetType) { setKeyPairListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o KeyPairListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getKeyPairListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o KeyPairListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableKeyPairListResponse struct { value *KeyPairListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableKeyPairListResponse) Get() *KeyPairListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableKeyPairListResponse) Set(val *KeyPairListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableKeyPairListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableKeyPairListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableKeyPairListResponse(val *KeyPairListResponse) *NullableKeyPairListResponse { return &NullableKeyPairListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableKeyPairListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableKeyPairListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_keypair.go b/services/iaas/model_keypair.go index 0ee9e25ed..73d25ae4e 100644 --- a/services/iaas/model_keypair.go +++ b/services/iaas/model_keypair.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &Keypair{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getKeypairGetCreatedAtAttributeTypeOk(arg KeypairGetCreatedAtAttributeType) (ret KeypairGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getKeypairGetCreatedAtAttributeTypeOk(arg KeypairGetCreatedAtAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setKeypairGetCreatedAtAttributeType(arg *KeypairGetCreatedAtAttributeType, val KeypairGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setKeypairGetCreatedAtAttributeType(arg *KeypairGetCreatedAtAttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetFingerprintAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getKeypairGetFingerprintAttributeTypeOk(arg KeypairGetFingerprintAttributeType) (ret KeypairGetFingerprintRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getKeypairGetFingerprintAttributeTypeOk(arg KeypairGetFingerprintAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setKeypairGetFingerprintAttributeType(arg *KeypairGetFingerprintAttributeType, val KeypairGetFingerprintRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetFingerprintArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetFingerprintRetType = string /* @@ -64,10 +78,16 @@ type KeypairGetFingerprintRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getKeypairGetLabelsAttributeTypeOk(arg KeypairGetLabelsAttributeType) (ret KeypairGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getKeypairGetLabelsAttributeTypeOk(arg KeypairGetLabelsAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setKeypairGetLabelsAttributeType(arg *KeypairGetLabelsAttributeType, val KeypairGetLabelsRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setKeypairGetLabelsAttributeType(arg *KeypairGetLabelsAttributeType, val Ke */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getKeypairGetNameAttributeTypeOk(arg KeypairGetNameAttributeType) (ret KeypairGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getKeypairGetNameAttributeTypeOk(arg KeypairGetNameAttributeType) (ret Keyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setKeypairGetNameAttributeType(arg *KeypairGetNameAttributeType, val KeypairGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetNameRetType = string /* @@ -105,8 +132,10 @@ type KeypairGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetPublicKeyAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getKeypairGetPublicKeyAttributeTypeOk(arg KeypairGetPublicKeyAttributeType) (ret KeypairGetPublicKeyRetType, ok bool) { if arg == nil { return ret, false @@ -114,11 +143,15 @@ func getKeypairGetPublicKeyAttributeTypeOk(arg KeypairGetPublicKeyAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setKeypairGetPublicKeyAttributeType(arg *KeypairGetPublicKeyAttributeType, val KeypairGetPublicKeyRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetPublicKeyArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetPublicKeyRetType = string /* @@ -126,10 +159,16 @@ type KeypairGetPublicKeyRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type KeypairGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getKeypairGetUpdatedAtAttributeTypeOk(arg KeypairGetUpdatedAtAttributeType) (ret KeypairGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -137,17 +176,19 @@ func getKeypairGetUpdatedAtAttributeTypeOk(arg KeypairGetUpdatedAtAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setKeypairGetUpdatedAtAttributeType(arg *KeypairGetUpdatedAtAttributeType, val KeypairGetUpdatedAtRetType) { *arg = &val } // Keypair Object that represents the public key of an SSH keypair and its name. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Keypair struct { // Date-time when resource was created. CreatedAt KeypairGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Object that represents an SSH keypair MD5 fingerprint. Fingerprint KeypairGetFingerprintAttributeType `json:"fingerprint,omitempty"` - // 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. + // 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. Labels KeypairGetLabelsAttributeType `json:"labels,omitempty"` // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. Name KeypairGetNameAttributeType `json:"name,omitempty"` @@ -158,12 +199,14 @@ type Keypair struct { UpdatedAt KeypairGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Keypair Keypair // NewKeypair instantiates a new Keypair object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewKeypair(publicKey KeypairGetPublicKeyArgType) *Keypair { this := Keypair{} setKeypairGetPublicKeyAttributeType(&this.PublicKey, publicKey) @@ -173,12 +216,14 @@ func NewKeypair(publicKey KeypairGetPublicKeyArgType) *Keypair { // NewKeypairWithDefaults instantiates a new Keypair object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewKeypairWithDefaults() *Keypair { this := Keypair{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetCreatedAt() (res KeypairGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -186,22 +231,26 @@ func (o *Keypair) GetCreatedAt() (res KeypairGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetCreatedAtOk() (ret KeypairGetCreatedAtRetType, ok bool) { return getKeypairGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) SetCreatedAt(v KeypairGetCreatedAtRetType) { setKeypairGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetFingerprint() (res KeypairGetFingerprintRetType) { res, _ = o.GetFingerprintOk() return @@ -209,22 +258,26 @@ func (o *Keypair) GetFingerprint() (res KeypairGetFingerprintRetType) { // GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetFingerprintOk() (ret KeypairGetFingerprintRetType, ok bool) { return getKeypairGetFingerprintAttributeTypeOk(o.Fingerprint) } // HasFingerprint returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) HasFingerprint() bool { _, ok := o.GetFingerprintOk() return ok } // SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) SetFingerprint(v KeypairGetFingerprintRetType) { setKeypairGetFingerprintAttributeType(&o.Fingerprint, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetLabels() (res KeypairGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -232,22 +285,26 @@ func (o *Keypair) GetLabels() (res KeypairGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetLabelsOk() (ret KeypairGetLabelsRetType, ok bool) { return getKeypairGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) SetLabels(v KeypairGetLabelsRetType) { setKeypairGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetName() (res KeypairGetNameRetType) { res, _ = o.GetNameOk() return @@ -255,22 +312,26 @@ func (o *Keypair) GetName() (res KeypairGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetNameOk() (ret KeypairGetNameRetType, ok bool) { return getKeypairGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) SetName(v KeypairGetNameRetType) { setKeypairGetNameAttributeType(&o.Name, v) } // GetPublicKey returns the PublicKey field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetPublicKey() (ret KeypairGetPublicKeyRetType) { ret, _ = o.GetPublicKeyOk() return ret @@ -278,16 +339,19 @@ func (o *Keypair) GetPublicKey() (ret KeypairGetPublicKeyRetType) { // GetPublicKeyOk returns a tuple with the PublicKey field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetPublicKeyOk() (ret KeypairGetPublicKeyRetType, ok bool) { return getKeypairGetPublicKeyAttributeTypeOk(o.PublicKey) } // SetPublicKey sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) SetPublicKey(v KeypairGetPublicKeyRetType) { setKeypairGetPublicKeyAttributeType(&o.PublicKey, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetUpdatedAt() (res KeypairGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -295,21 +359,25 @@ func (o *Keypair) GetUpdatedAt() (res KeypairGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) GetUpdatedAtOk() (ret KeypairGetUpdatedAtRetType, ok bool) { return getKeypairGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Keypair) SetUpdatedAt(v KeypairGetUpdatedAtRetType) { setKeypairGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Keypair) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getKeypairGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -333,37 +401,45 @@ func (o Keypair) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableKeypair struct { value *Keypair isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableKeypair) Get() *Keypair { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableKeypair) Set(val *Keypair) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableKeypair) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableKeypair) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableKeypair(val *Keypair) *NullableKeypair { return &NullableKeypair{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableKeypair) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableKeypair) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_machine_type.go b/services/iaas/model_machine_type.go index e28ec475d..22c4a950e 100644 --- a/services/iaas/model_machine_type.go +++ b/services/iaas/model_machine_type.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &MachineType{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMachineTypeGetDescriptionAttributeTypeOk(arg MachineTypeGetDescriptionAttributeType) (ret MachineTypeGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getMachineTypeGetDescriptionAttributeTypeOk(arg MachineTypeGetDescriptionAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMachineTypeGetDescriptionAttributeType(arg *MachineTypeGetDescriptionAttributeType, val MachineTypeGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetDescriptionRetType = string /* @@ -43,10 +50,16 @@ type MachineTypeGetDescriptionRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetDiskAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetDiskArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetDiskRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMachineTypeGetDiskAttributeTypeOk(arg MachineTypeGetDiskAttributeType) (ret MachineTypeGetDiskRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getMachineTypeGetDiskAttributeTypeOk(arg MachineTypeGetDiskAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMachineTypeGetDiskAttributeType(arg *MachineTypeGetDiskAttributeType, val MachineTypeGetDiskRetType) { *arg = &val } @@ -63,10 +77,16 @@ func setMachineTypeGetDiskAttributeType(arg *MachineTypeGetDiskAttributeType, va */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetExtraSpecsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetExtraSpecsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetExtraSpecsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMachineTypeGetExtraSpecsAttributeTypeOk(arg MachineTypeGetExtraSpecsAttributeType) (ret MachineTypeGetExtraSpecsRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +94,7 @@ func getMachineTypeGetExtraSpecsAttributeTypeOk(arg MachineTypeGetExtraSpecsAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMachineTypeGetExtraSpecsAttributeType(arg *MachineTypeGetExtraSpecsAttributeType, val MachineTypeGetExtraSpecsRetType) { *arg = &val } @@ -83,8 +104,10 @@ func setMachineTypeGetExtraSpecsAttributeType(arg *MachineTypeGetExtraSpecsAttri */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMachineTypeGetNameAttributeTypeOk(arg MachineTypeGetNameAttributeType) (ret MachineTypeGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -92,11 +115,15 @@ func getMachineTypeGetNameAttributeTypeOk(arg MachineTypeGetNameAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMachineTypeGetNameAttributeType(arg *MachineTypeGetNameAttributeType, val MachineTypeGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetNameRetType = string /* @@ -104,10 +131,16 @@ type MachineTypeGetNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetRamAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetRamArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetRamRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMachineTypeGetRamAttributeTypeOk(arg MachineTypeGetRamAttributeType) (ret MachineTypeGetRamRetType, ok bool) { if arg == nil { return ret, false @@ -115,6 +148,7 @@ func getMachineTypeGetRamAttributeTypeOk(arg MachineTypeGetRamAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMachineTypeGetRamAttributeType(arg *MachineTypeGetRamAttributeType, val MachineTypeGetRamRetType) { *arg = &val } @@ -124,10 +158,16 @@ func setMachineTypeGetRamAttributeType(arg *MachineTypeGetRamAttributeType, val */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetVcpusAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetVcpusArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeGetVcpusRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMachineTypeGetVcpusAttributeTypeOk(arg MachineTypeGetVcpusAttributeType) (ret MachineTypeGetVcpusRetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +175,13 @@ func getMachineTypeGetVcpusAttributeTypeOk(arg MachineTypeGetVcpusAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMachineTypeGetVcpusAttributeType(arg *MachineTypeGetVcpusAttributeType, val MachineTypeGetVcpusRetType) { *arg = &val } // MachineType Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, `ram`, `vcpus`. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineType struct { // Description Object. Allows string up to 255 Characters. Description MachineTypeGetDescriptionAttributeType `json:"description,omitempty"` @@ -159,12 +201,14 @@ type MachineType struct { Vcpus MachineTypeGetVcpusAttributeType `json:"vcpus" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _MachineType MachineType // NewMachineType instantiates a new MachineType object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewMachineType(disk MachineTypeGetDiskArgType, name MachineTypeGetNameArgType, ram MachineTypeGetRamArgType, vcpus MachineTypeGetVcpusArgType) *MachineType { this := MachineType{} setMachineTypeGetDiskAttributeType(&this.Disk, disk) @@ -177,12 +221,14 @@ func NewMachineType(disk MachineTypeGetDiskArgType, name MachineTypeGetNameArgTy // NewMachineTypeWithDefaults instantiates a new MachineType object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewMachineTypeWithDefaults() *MachineType { this := MachineType{} return &this } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetDescription() (res MachineTypeGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -190,22 +236,26 @@ func (o *MachineType) GetDescription() (res MachineTypeGetDescriptionRetType) { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetDescriptionOk() (ret MachineTypeGetDescriptionRetType, ok bool) { return getMachineTypeGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) SetDescription(v MachineTypeGetDescriptionRetType) { setMachineTypeGetDescriptionAttributeType(&o.Description, v) } // GetDisk returns the Disk field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetDisk() (ret MachineTypeGetDiskRetType) { ret, _ = o.GetDiskOk() return ret @@ -213,16 +263,19 @@ func (o *MachineType) GetDisk() (ret MachineTypeGetDiskRetType) { // GetDiskOk returns a tuple with the Disk field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetDiskOk() (ret MachineTypeGetDiskRetType, ok bool) { return getMachineTypeGetDiskAttributeTypeOk(o.Disk) } // SetDisk sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) SetDisk(v MachineTypeGetDiskRetType) { setMachineTypeGetDiskAttributeType(&o.Disk, v) } // GetExtraSpecs returns the ExtraSpecs field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetExtraSpecs() (res MachineTypeGetExtraSpecsRetType) { res, _ = o.GetExtraSpecsOk() return @@ -230,22 +283,26 @@ func (o *MachineType) GetExtraSpecs() (res MachineTypeGetExtraSpecsRetType) { // GetExtraSpecsOk returns a tuple with the ExtraSpecs field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetExtraSpecsOk() (ret MachineTypeGetExtraSpecsRetType, ok bool) { return getMachineTypeGetExtraSpecsAttributeTypeOk(o.ExtraSpecs) } // HasExtraSpecs returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) HasExtraSpecs() bool { _, ok := o.GetExtraSpecsOk() return ok } // SetExtraSpecs gets a reference to the given map[string]interface{} and assigns it to the ExtraSpecs field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) SetExtraSpecs(v MachineTypeGetExtraSpecsRetType) { setMachineTypeGetExtraSpecsAttributeType(&o.ExtraSpecs, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetName() (ret MachineTypeGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -253,16 +310,19 @@ func (o *MachineType) GetName() (ret MachineTypeGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetNameOk() (ret MachineTypeGetNameRetType, ok bool) { return getMachineTypeGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) SetName(v MachineTypeGetNameRetType) { setMachineTypeGetNameAttributeType(&o.Name, v) } // GetRam returns the Ram field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetRam() (ret MachineTypeGetRamRetType) { ret, _ = o.GetRamOk() return ret @@ -270,16 +330,19 @@ func (o *MachineType) GetRam() (ret MachineTypeGetRamRetType) { // GetRamOk returns a tuple with the Ram field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetRamOk() (ret MachineTypeGetRamRetType, ok bool) { return getMachineTypeGetRamAttributeTypeOk(o.Ram) } // SetRam sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) SetRam(v MachineTypeGetRamRetType) { setMachineTypeGetRamAttributeType(&o.Ram, v) } // GetVcpus returns the Vcpus field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetVcpus() (ret MachineTypeGetVcpusRetType) { ret, _ = o.GetVcpusOk() return ret @@ -287,15 +350,18 @@ func (o *MachineType) GetVcpus() (ret MachineTypeGetVcpusRetType) { // GetVcpusOk returns a tuple with the Vcpus field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) GetVcpusOk() (ret MachineTypeGetVcpusRetType, ok bool) { return getMachineTypeGetVcpusAttributeTypeOk(o.Vcpus) } // SetVcpus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineType) SetVcpus(v MachineTypeGetVcpusRetType) { setMachineTypeGetVcpusAttributeType(&o.Vcpus, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o MachineType) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getMachineTypeGetDescriptionAttributeTypeOk(o.Description); ok { @@ -319,37 +385,45 @@ func (o MachineType) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableMachineType struct { value *MachineType isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMachineType) Get() *MachineType { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMachineType) Set(val *MachineType) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMachineType) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMachineType) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableMachineType(val *MachineType) *NullableMachineType { return &NullableMachineType{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMachineType) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMachineType) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_machine_type_list_response.go b/services/iaas/model_machine_type_list_response.go index fa9154cca..7fe75188e 100644 --- a/services/iaas/model_machine_type_list_response.go +++ b/services/iaas/model_machine_type_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &MachineTypeListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeListResponseGetItemsAttributeType = *[]MachineType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeListResponseGetItemsArgType = []MachineType + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeListResponseGetItemsRetType = []MachineType +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getMachineTypeListResponseGetItemsAttributeTypeOk(arg MachineTypeListResponseGetItemsAttributeType) (ret MachineTypeListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getMachineTypeListResponseGetItemsAttributeTypeOk(arg MachineTypeListRespon return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setMachineTypeListResponseGetItemsAttributeType(arg *MachineTypeListResponseGetItemsAttributeType, val MachineTypeListResponseGetItemsRetType) { *arg = &val } // MachineTypeListResponse Machine type list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MachineTypeListResponse struct { // Machine type list. // REQUIRED Items MachineTypeListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _MachineTypeListResponse MachineTypeListResponse // NewMachineTypeListResponse instantiates a new MachineTypeListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewMachineTypeListResponse(items MachineTypeListResponseGetItemsArgType) *MachineTypeListResponse { this := MachineTypeListResponse{} setMachineTypeListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewMachineTypeListResponse(items MachineTypeListResponseGetItemsArgType) *M // NewMachineTypeListResponseWithDefaults instantiates a new MachineTypeListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewMachineTypeListResponseWithDefaults() *MachineTypeListResponse { this := MachineTypeListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineTypeListResponse) GetItems() (ret MachineTypeListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *MachineTypeListResponse) GetItems() (ret MachineTypeListResponseGetItem // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineTypeListResponse) GetItemsOk() (ret MachineTypeListResponseGetItemsRetType, ok bool) { return getMachineTypeListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *MachineTypeListResponse) SetItems(v MachineTypeListResponseGetItemsRetType) { setMachineTypeListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o MachineTypeListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getMachineTypeListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o MachineTypeListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableMachineTypeListResponse struct { value *MachineTypeListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMachineTypeListResponse) Get() *MachineTypeListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMachineTypeListResponse) Set(val *MachineTypeListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMachineTypeListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMachineTypeListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableMachineTypeListResponse(val *MachineTypeListResponse) *NullableMachineTypeListResponse { return &NullableMachineTypeListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableMachineTypeListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableMachineTypeListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_network.go b/services/iaas/model_network.go index de1587ec6..9eee05a88 100644 --- a/services/iaas/model_network.go +++ b/services/iaas/model_network.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &Network{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetCreatedAtAttributeTypeOk(arg NetworkGetCreatedAtAttributeType) (ret NetworkGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getNetworkGetCreatedAtAttributeTypeOk(arg NetworkGetCreatedAtAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetCreatedAtAttributeType(arg *NetworkGetCreatedAtAttributeType, val NetworkGetCreatedAtRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setNetworkGetCreatedAtAttributeType(arg *NetworkGetCreatedAtAttributeType, */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkgetDhcpAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkgetDhcpArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkgetDhcpRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkgetDhcpAttributeTypeOk(arg NetworkgetDhcpAttributeType) (ret NetworkgetDhcpRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getNetworkgetDhcpAttributeTypeOk(arg NetworkgetDhcpAttributeType) (ret Netw return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkgetDhcpAttributeType(arg *NetworkgetDhcpAttributeType, val NetworkgetDhcpRetType) { *arg = &val } @@ -63,8 +78,10 @@ func setNetworkgetDhcpAttributeType(arg *NetworkgetDhcpAttributeType, val Networ */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetIdAttributeTypeOk(arg NetworkGetIdAttributeType) (ret NetworkGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +89,15 @@ func getNetworkGetIdAttributeTypeOk(arg NetworkGetIdAttributeType) (ret NetworkG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetIdAttributeType(arg *NetworkGetIdAttributeType, val NetworkGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIdRetType = string /* @@ -84,10 +105,16 @@ type NetworkGetIdRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIpv4AttributeType = *NetworkIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIpv4ArgType = NetworkIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIpv4RetType = NetworkIPv4 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetIpv4AttributeTypeOk(arg NetworkGetIpv4AttributeType) (ret NetworkGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +122,7 @@ func getNetworkGetIpv4AttributeTypeOk(arg NetworkGetIpv4AttributeType) (ret Netw return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetIpv4AttributeType(arg *NetworkGetIpv4AttributeType, val NetworkGetIpv4RetType) { *arg = &val } @@ -104,10 +132,16 @@ func setNetworkGetIpv4AttributeType(arg *NetworkGetIpv4AttributeType, val Networ */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIpv6AttributeType = *NetworkIPv6 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIpv6ArgType = NetworkIPv6 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetIpv6RetType = NetworkIPv6 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetIpv6AttributeTypeOk(arg NetworkGetIpv6AttributeType) (ret NetworkGetIpv6RetType, ok bool) { if arg == nil { return ret, false @@ -115,6 +149,7 @@ func getNetworkGetIpv6AttributeTypeOk(arg NetworkGetIpv6AttributeType) (ret Netw return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetIpv6AttributeType(arg *NetworkGetIpv6AttributeType, val NetworkGetIpv6RetType) { *arg = &val } @@ -124,10 +159,16 @@ func setNetworkGetIpv6AttributeType(arg *NetworkGetIpv6AttributeType, val Networ */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetLabelsAttributeTypeOk(arg NetworkGetLabelsAttributeType) (ret NetworkGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -135,6 +176,7 @@ func getNetworkGetLabelsAttributeTypeOk(arg NetworkGetLabelsAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetLabelsAttributeType(arg *NetworkGetLabelsAttributeType, val NetworkGetLabelsRetType) { *arg = &val } @@ -144,8 +186,10 @@ func setNetworkGetLabelsAttributeType(arg *NetworkGetLabelsAttributeType, val Ne */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetNameAttributeTypeOk(arg NetworkGetNameAttributeType) (ret NetworkGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -153,11 +197,15 @@ func getNetworkGetNameAttributeTypeOk(arg NetworkGetNameAttributeType) (ret Netw return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetNameAttributeType(arg *NetworkGetNameAttributeType, val NetworkGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetNameRetType = string /* @@ -165,10 +213,16 @@ type NetworkGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkgetRoutedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkgetRoutedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkgetRoutedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkgetRoutedAttributeTypeOk(arg NetworkgetRoutedAttributeType) (ret NetworkgetRoutedRetType, ok bool) { if arg == nil { return ret, false @@ -176,6 +230,7 @@ func getNetworkgetRoutedAttributeTypeOk(arg NetworkgetRoutedAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkgetRoutedAttributeType(arg *NetworkgetRoutedAttributeType, val NetworkgetRoutedRetType) { *arg = &val } @@ -185,8 +240,10 @@ func setNetworkgetRoutedAttributeType(arg *NetworkgetRoutedAttributeType, val Ne */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetRoutingTableIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetRoutingTableIdAttributeTypeOk(arg NetworkGetRoutingTableIdAttributeType) (ret NetworkGetRoutingTableIdRetType, ok bool) { if arg == nil { return ret, false @@ -194,11 +251,15 @@ func getNetworkGetRoutingTableIdAttributeTypeOk(arg NetworkGetRoutingTableIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetRoutingTableIdAttributeType(arg *NetworkGetRoutingTableIdAttributeType, val NetworkGetRoutingTableIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetRoutingTableIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetRoutingTableIdRetType = string /* @@ -206,8 +267,10 @@ type NetworkGetRoutingTableIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetStatusAttributeTypeOk(arg NetworkGetStatusAttributeType) (ret NetworkGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -215,11 +278,15 @@ func getNetworkGetStatusAttributeTypeOk(arg NetworkGetStatusAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetStatusAttributeType(arg *NetworkGetStatusAttributeType, val NetworkGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetStatusRetType = string /* @@ -227,10 +294,16 @@ type NetworkGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkGetUpdatedAtAttributeTypeOk(arg NetworkGetUpdatedAtAttributeType) (ret NetworkGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -238,11 +311,13 @@ func getNetworkGetUpdatedAtAttributeTypeOk(arg NetworkGetUpdatedAtAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkGetUpdatedAtAttributeType(arg *NetworkGetUpdatedAtAttributeType, val NetworkGetUpdatedAtRetType) { *arg = &val } // Network Object that represents a network. If no routing table is specified, the default routing table is used. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Network struct { // Date-time when resource was created. CreatedAt NetworkGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -253,7 +328,7 @@ type Network struct { Id NetworkGetIdAttributeType `json:"id" required:"true"` Ipv4 NetworkGetIpv4AttributeType `json:"ipv4,omitempty"` Ipv6 NetworkGetIpv6AttributeType `json:"ipv6,omitempty"` - // 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. + // 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. Labels NetworkGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED Name NetworkGetNameAttributeType `json:"name" required:"true"` @@ -268,12 +343,14 @@ type Network struct { UpdatedAt NetworkGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Network Network // NewNetwork instantiates a new Network object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetwork(id NetworkGetIdArgType, name NetworkGetNameArgType, status NetworkGetStatusArgType) *Network { this := Network{} setNetworkGetIdAttributeType(&this.Id, id) @@ -285,12 +362,14 @@ func NewNetwork(id NetworkGetIdArgType, name NetworkGetNameArgType, status Netwo // NewNetworkWithDefaults instantiates a new Network object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkWithDefaults() *Network { this := Network{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetCreatedAt() (res NetworkGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -298,22 +377,26 @@ func (o *Network) GetCreatedAt() (res NetworkGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetCreatedAtOk() (ret NetworkGetCreatedAtRetType, ok bool) { return getNetworkGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetCreatedAt(v NetworkGetCreatedAtRetType) { setNetworkGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDhcp returns the Dhcp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetDhcp() (res NetworkgetDhcpRetType) { res, _ = o.GetDhcpOk() return @@ -321,22 +404,26 @@ func (o *Network) GetDhcp() (res NetworkgetDhcpRetType) { // GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetDhcpOk() (ret NetworkgetDhcpRetType, ok bool) { return getNetworkgetDhcpAttributeTypeOk(o.Dhcp) } // HasDhcp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) HasDhcp() bool { _, ok := o.GetDhcpOk() return ok } // SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetDhcp(v NetworkgetDhcpRetType) { setNetworkgetDhcpAttributeType(&o.Dhcp, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetId() (ret NetworkGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -344,16 +431,19 @@ func (o *Network) GetId() (ret NetworkGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetIdOk() (ret NetworkGetIdRetType, ok bool) { return getNetworkGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetId(v NetworkGetIdRetType) { setNetworkGetIdAttributeType(&o.Id, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetIpv4() (res NetworkGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -361,22 +451,26 @@ func (o *Network) GetIpv4() (res NetworkGetIpv4RetType) { // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetIpv4Ok() (ret NetworkGetIpv4RetType, ok bool) { return getNetworkGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given NetworkIPv4 and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetIpv4(v NetworkGetIpv4RetType) { setNetworkGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetIpv6() (res NetworkGetIpv6RetType) { res, _ = o.GetIpv6Ok() return @@ -384,22 +478,26 @@ func (o *Network) GetIpv6() (res NetworkGetIpv6RetType) { // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetIpv6Ok() (ret NetworkGetIpv6RetType, ok bool) { return getNetworkGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) HasIpv6() bool { _, ok := o.GetIpv6Ok() return ok } // SetIpv6 gets a reference to the given NetworkIPv6 and assigns it to the Ipv6 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetIpv6(v NetworkGetIpv6RetType) { setNetworkGetIpv6AttributeType(&o.Ipv6, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetLabels() (res NetworkGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -407,22 +505,26 @@ func (o *Network) GetLabels() (res NetworkGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetLabelsOk() (ret NetworkGetLabelsRetType, ok bool) { return getNetworkGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetLabels(v NetworkGetLabelsRetType) { setNetworkGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetName() (ret NetworkGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -430,16 +532,19 @@ func (o *Network) GetName() (ret NetworkGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetNameOk() (ret NetworkGetNameRetType, ok bool) { return getNetworkGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetName(v NetworkGetNameRetType) { setNetworkGetNameAttributeType(&o.Name, v) } // GetRouted returns the Routed field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetRouted() (res NetworkgetRoutedRetType) { res, _ = o.GetRoutedOk() return @@ -447,22 +552,26 @@ func (o *Network) GetRouted() (res NetworkgetRoutedRetType) { // GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetRoutedOk() (ret NetworkgetRoutedRetType, ok bool) { return getNetworkgetRoutedAttributeTypeOk(o.Routed) } // HasRouted returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) HasRouted() bool { _, ok := o.GetRoutedOk() return ok } // SetRouted gets a reference to the given bool and assigns it to the Routed field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetRouted(v NetworkgetRoutedRetType) { setNetworkgetRoutedAttributeType(&o.Routed, v) } // GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetRoutingTableId() (res NetworkGetRoutingTableIdRetType) { res, _ = o.GetRoutingTableIdOk() return @@ -470,22 +579,26 @@ func (o *Network) GetRoutingTableId() (res NetworkGetRoutingTableIdRetType) { // GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetRoutingTableIdOk() (ret NetworkGetRoutingTableIdRetType, ok bool) { return getNetworkGetRoutingTableIdAttributeTypeOk(o.RoutingTableId) } // HasRoutingTableId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) HasRoutingTableId() bool { _, ok := o.GetRoutingTableIdOk() return ok } // SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetRoutingTableId(v NetworkGetRoutingTableIdRetType) { setNetworkGetRoutingTableIdAttributeType(&o.RoutingTableId, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetStatus() (ret NetworkGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -493,16 +606,19 @@ func (o *Network) GetStatus() (ret NetworkGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetStatusOk() (ret NetworkGetStatusRetType, ok bool) { return getNetworkGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetStatus(v NetworkGetStatusRetType) { setNetworkGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetUpdatedAt() (res NetworkGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -510,21 +626,25 @@ func (o *Network) GetUpdatedAt() (res NetworkGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) GetUpdatedAtOk() (ret NetworkGetUpdatedAtRetType, ok bool) { return getNetworkGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Network) SetUpdatedAt(v NetworkGetUpdatedAtRetType) { setNetworkGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Network) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -563,37 +683,45 @@ func (o Network) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNetwork struct { value *Network isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetwork) Get() *Network { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetwork) Set(val *Network) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetwork) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetwork) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNetwork(val *Network) *NullableNetwork { return &NullableNetwork{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetwork) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetwork) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_network_area.go b/services/iaas/model_network_area.go index ba04be3eb..f78d940c3 100644 --- a/services/iaas/model_network_area.go +++ b/services/iaas/model_network_area.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &NetworkArea{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkAreaGetCreatedAtAttributeTypeOk(arg NetworkAreaGetCreatedAtAttributeType) (ret NetworkAreaGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getNetworkAreaGetCreatedAtAttributeTypeOk(arg NetworkAreaGetCreatedAtAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkAreaGetCreatedAtAttributeType(arg *NetworkAreaGetCreatedAtAttributeType, val NetworkAreaGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setNetworkAreaGetCreatedAtAttributeType(arg *NetworkAreaGetCreatedAtAttribu */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkAreaGetIdAttributeTypeOk(arg NetworkAreaGetIdAttributeType) (ret NetworkAreaGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getNetworkAreaGetIdAttributeTypeOk(arg NetworkAreaGetIdAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkAreaGetIdAttributeType(arg *NetworkAreaGetIdAttributeType, val NetworkAreaGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetIdRetType = string /* @@ -64,10 +78,16 @@ type NetworkAreaGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkAreaGetLabelsAttributeTypeOk(arg NetworkAreaGetLabelsAttributeType) (ret NetworkAreaGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getNetworkAreaGetLabelsAttributeTypeOk(arg NetworkAreaGetLabelsAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkAreaGetLabelsAttributeType(arg *NetworkAreaGetLabelsAttributeType, val NetworkAreaGetLabelsRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setNetworkAreaGetLabelsAttributeType(arg *NetworkAreaGetLabelsAttributeType */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkAreaGetNameAttributeTypeOk(arg NetworkAreaGetNameAttributeType) (ret NetworkAreaGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getNetworkAreaGetNameAttributeTypeOk(arg NetworkAreaGetNameAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkAreaGetNameAttributeType(arg *NetworkAreaGetNameAttributeType, val NetworkAreaGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetNameRetType = string /* @@ -105,10 +132,16 @@ type NetworkAreaGetNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetProjectCountAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetProjectCountArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetProjectCountRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkAreaGetProjectCountAttributeTypeOk(arg NetworkAreaGetProjectCountAttributeType) (ret NetworkAreaGetProjectCountRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getNetworkAreaGetProjectCountAttributeTypeOk(arg NetworkAreaGetProjectCount return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkAreaGetProjectCountAttributeType(arg *NetworkAreaGetProjectCountAttributeType, val NetworkAreaGetProjectCountRetType) { *arg = &val } @@ -125,10 +159,16 @@ func setNetworkAreaGetProjectCountAttributeType(arg *NetworkAreaGetProjectCountA */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkAreaGetUpdatedAtAttributeTypeOk(arg NetworkAreaGetUpdatedAtAttributeType) (ret NetworkAreaGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -136,17 +176,19 @@ func getNetworkAreaGetUpdatedAtAttributeTypeOk(arg NetworkAreaGetUpdatedAtAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkAreaGetUpdatedAtAttributeType(arg *NetworkAreaGetUpdatedAtAttributeType, val NetworkAreaGetUpdatedAtRetType) { *arg = &val } // NetworkArea Object that represents a network area. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkArea struct { // Date-time when resource was created. CreatedAt NetworkAreaGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). Id NetworkAreaGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels NetworkAreaGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED Name NetworkAreaGetNameAttributeType `json:"name" required:"true"` @@ -156,12 +198,14 @@ type NetworkArea struct { UpdatedAt NetworkAreaGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NetworkArea NetworkArea // NewNetworkArea instantiates a new NetworkArea object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkArea(name NetworkAreaGetNameArgType) *NetworkArea { this := NetworkArea{} setNetworkAreaGetNameAttributeType(&this.Name, name) @@ -171,12 +215,14 @@ func NewNetworkArea(name NetworkAreaGetNameArgType) *NetworkArea { // NewNetworkAreaWithDefaults instantiates a new NetworkArea object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkAreaWithDefaults() *NetworkArea { this := NetworkArea{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetCreatedAt() (res NetworkAreaGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -184,22 +230,26 @@ func (o *NetworkArea) GetCreatedAt() (res NetworkAreaGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetCreatedAtOk() (ret NetworkAreaGetCreatedAtRetType, ok bool) { return getNetworkAreaGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) SetCreatedAt(v NetworkAreaGetCreatedAtRetType) { setNetworkAreaGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetId() (res NetworkAreaGetIdRetType) { res, _ = o.GetIdOk() return @@ -207,22 +257,26 @@ func (o *NetworkArea) GetId() (res NetworkAreaGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetIdOk() (ret NetworkAreaGetIdRetType, ok bool) { return getNetworkAreaGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) SetId(v NetworkAreaGetIdRetType) { setNetworkAreaGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetLabels() (res NetworkAreaGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -230,22 +284,26 @@ func (o *NetworkArea) GetLabels() (res NetworkAreaGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetLabelsOk() (ret NetworkAreaGetLabelsRetType, ok bool) { return getNetworkAreaGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) SetLabels(v NetworkAreaGetLabelsRetType) { setNetworkAreaGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetName() (ret NetworkAreaGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -253,16 +311,19 @@ func (o *NetworkArea) GetName() (ret NetworkAreaGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetNameOk() (ret NetworkAreaGetNameRetType, ok bool) { return getNetworkAreaGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) SetName(v NetworkAreaGetNameRetType) { setNetworkAreaGetNameAttributeType(&o.Name, v) } // GetProjectCount returns the ProjectCount field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetProjectCount() (res NetworkAreaGetProjectCountRetType) { res, _ = o.GetProjectCountOk() return @@ -270,22 +331,26 @@ func (o *NetworkArea) GetProjectCount() (res NetworkAreaGetProjectCountRetType) // GetProjectCountOk returns a tuple with the ProjectCount field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetProjectCountOk() (ret NetworkAreaGetProjectCountRetType, ok bool) { return getNetworkAreaGetProjectCountAttributeTypeOk(o.ProjectCount) } // HasProjectCount returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) HasProjectCount() bool { _, ok := o.GetProjectCountOk() return ok } // SetProjectCount gets a reference to the given int64 and assigns it to the ProjectCount field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) SetProjectCount(v NetworkAreaGetProjectCountRetType) { setNetworkAreaGetProjectCountAttributeType(&o.ProjectCount, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetUpdatedAt() (res NetworkAreaGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -293,21 +358,25 @@ func (o *NetworkArea) GetUpdatedAt() (res NetworkAreaGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) GetUpdatedAtOk() (ret NetworkAreaGetUpdatedAtRetType, ok bool) { return getNetworkAreaGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkArea) SetUpdatedAt(v NetworkAreaGetUpdatedAtRetType) { setNetworkAreaGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NetworkArea) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkAreaGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -331,37 +400,45 @@ func (o NetworkArea) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNetworkArea struct { value *NetworkArea isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkArea) Get() *NetworkArea { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkArea) Set(val *NetworkArea) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkArea) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkArea) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNetworkArea(val *NetworkArea) *NullableNetworkArea { return &NullableNetworkArea{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkArea) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkArea) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_network_area_list_response.go b/services/iaas/model_network_area_list_response.go index 41efb20c9..87cf2393d 100644 --- a/services/iaas/model_network_area_list_response.go +++ b/services/iaas/model_network_area_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &NetworkAreaListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaListResponseGetItemsAttributeType = *[]NetworkArea + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaListResponseGetItemsArgType = []NetworkArea + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaListResponseGetItemsRetType = []NetworkArea +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkAreaListResponseGetItemsAttributeTypeOk(arg NetworkAreaListResponseGetItemsAttributeType) (ret NetworkAreaListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getNetworkAreaListResponseGetItemsAttributeTypeOk(arg NetworkAreaListRespon return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkAreaListResponseGetItemsAttributeType(arg *NetworkAreaListResponseGetItemsAttributeType, val NetworkAreaListResponseGetItemsRetType) { *arg = &val } // NetworkAreaListResponse Network area list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkAreaListResponse struct { // A list of network areas. // REQUIRED Items NetworkAreaListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NetworkAreaListResponse NetworkAreaListResponse // NewNetworkAreaListResponse instantiates a new NetworkAreaListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkAreaListResponse(items NetworkAreaListResponseGetItemsArgType) *NetworkAreaListResponse { this := NetworkAreaListResponse{} setNetworkAreaListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewNetworkAreaListResponse(items NetworkAreaListResponseGetItemsArgType) *N // NewNetworkAreaListResponseWithDefaults instantiates a new NetworkAreaListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkAreaListResponseWithDefaults() *NetworkAreaListResponse { this := NetworkAreaListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkAreaListResponse) GetItems() (ret NetworkAreaListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *NetworkAreaListResponse) GetItems() (ret NetworkAreaListResponseGetItem // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkAreaListResponse) GetItemsOk() (ret NetworkAreaListResponseGetItemsRetType, ok bool) { return getNetworkAreaListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkAreaListResponse) SetItems(v NetworkAreaListResponseGetItemsRetType) { setNetworkAreaListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NetworkAreaListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkAreaListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o NetworkAreaListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNetworkAreaListResponse struct { value *NetworkAreaListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkAreaListResponse) Get() *NetworkAreaListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkAreaListResponse) Set(val *NetworkAreaListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkAreaListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkAreaListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNetworkAreaListResponse(val *NetworkAreaListResponse) *NullableNetworkAreaListResponse { return &NullableNetworkAreaListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkAreaListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkAreaListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_network_ipv4.go b/services/iaas/model_network_ipv4.go index e29985e4d..e79d607e1 100644 --- a/services/iaas/model_network_ipv4.go +++ b/services/iaas/model_network_ipv4.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &NetworkIPv4{} */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetGatewayAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkIPv4GetGatewayAttributeTypeOk(arg NetworkIPv4GetGatewayAttributeType) (ret NetworkIPv4GetGatewayRetType, ok bool) { if arg == nil { return nil, false @@ -31,6 +34,7 @@ func getNetworkIPv4GetGatewayAttributeTypeOk(arg NetworkIPv4GetGatewayAttributeT return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkIPv4GetGatewayAttributeType(arg *NetworkIPv4GetGatewayAttributeType, val NetworkIPv4GetGatewayRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -39,7 +43,10 @@ func setNetworkIPv4GetGatewayAttributeType(arg *NetworkIPv4GetGatewayAttributeTy } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetGatewayArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetGatewayRetType = *string /* @@ -47,10 +54,16 @@ type NetworkIPv4GetGatewayRetType = *string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkIPv4GetNameserversAttributeTypeOk(arg NetworkIPv4GetNameserversAttributeType) (ret NetworkIPv4GetNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -58,6 +71,7 @@ func getNetworkIPv4GetNameserversAttributeTypeOk(arg NetworkIPv4GetNameserversAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkIPv4GetNameserversAttributeType(arg *NetworkIPv4GetNameserversAttributeType, val NetworkIPv4GetNameserversRetType) { *arg = &val } @@ -67,10 +81,16 @@ func setNetworkIPv4GetNameserversAttributeType(arg *NetworkIPv4GetNameserversAtt */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetPrefixesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetPrefixesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetPrefixesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkIPv4GetPrefixesAttributeTypeOk(arg NetworkIPv4GetPrefixesAttributeType) (ret NetworkIPv4GetPrefixesRetType, ok bool) { if arg == nil { return ret, false @@ -78,6 +98,7 @@ func getNetworkIPv4GetPrefixesAttributeTypeOk(arg NetworkIPv4GetPrefixesAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkIPv4GetPrefixesAttributeType(arg *NetworkIPv4GetPrefixesAttributeType, val NetworkIPv4GetPrefixesRetType) { *arg = &val } @@ -87,8 +108,10 @@ func setNetworkIPv4GetPrefixesAttributeType(arg *NetworkIPv4GetPrefixesAttribute */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetPublicIpAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkIPv4GetPublicIpAttributeTypeOk(arg NetworkIPv4GetPublicIpAttributeType) (ret NetworkIPv4GetPublicIpRetType, ok bool) { if arg == nil { return ret, false @@ -96,14 +119,19 @@ func getNetworkIPv4GetPublicIpAttributeTypeOk(arg NetworkIPv4GetPublicIpAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkIPv4GetPublicIpAttributeType(arg *NetworkIPv4GetPublicIpAttributeType, val NetworkIPv4GetPublicIpRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetPublicIpArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4GetPublicIpRetType = string // NetworkIPv4 Object that represents the IPv4 part of a network. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv4 struct { // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway NetworkIPv4GetGatewayAttributeType `json:"gateway,omitempty"` @@ -115,12 +143,14 @@ type NetworkIPv4 struct { PublicIp NetworkIPv4GetPublicIpAttributeType `json:"publicIp,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NetworkIPv4 NetworkIPv4 // NewNetworkIPv4 instantiates a new NetworkIPv4 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkIPv4(prefixes NetworkIPv4GetPrefixesArgType) *NetworkIPv4 { this := NetworkIPv4{} setNetworkIPv4GetPrefixesAttributeType(&this.Prefixes, prefixes) @@ -130,12 +160,14 @@ func NewNetworkIPv4(prefixes NetworkIPv4GetPrefixesArgType) *NetworkIPv4 { // NewNetworkIPv4WithDefaults instantiates a new NetworkIPv4 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkIPv4WithDefaults() *NetworkIPv4 { this := NetworkIPv4{} return &this } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) GetGateway() (res NetworkIPv4GetGatewayRetType) { res, _ = o.GetGatewayOk() return @@ -144,32 +176,38 @@ func (o *NetworkIPv4) GetGateway() (res NetworkIPv4GetGatewayRetType) { // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) GetGatewayOk() (ret NetworkIPv4GetGatewayRetType, ok bool) { return getNetworkIPv4GetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) HasGateway() bool { _, ok := o.GetGatewayOk() return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) SetGateway(v NetworkIPv4GetGatewayRetType) { setNetworkIPv4GetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) SetGatewayNil() { o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) UnsetGateway() { o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) GetNameservers() (res NetworkIPv4GetNameserversRetType) { res, _ = o.GetNameserversOk() return @@ -177,22 +215,26 @@ func (o *NetworkIPv4) GetNameservers() (res NetworkIPv4GetNameserversRetType) { // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) GetNameserversOk() (ret NetworkIPv4GetNameserversRetType, ok bool) { return getNetworkIPv4GetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) SetNameservers(v NetworkIPv4GetNameserversRetType) { setNetworkIPv4GetNameserversAttributeType(&o.Nameservers, v) } // GetPrefixes returns the Prefixes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) GetPrefixes() (ret NetworkIPv4GetPrefixesRetType) { ret, _ = o.GetPrefixesOk() return ret @@ -200,16 +242,19 @@ func (o *NetworkIPv4) GetPrefixes() (ret NetworkIPv4GetPrefixesRetType) { // GetPrefixesOk returns a tuple with the Prefixes field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) GetPrefixesOk() (ret NetworkIPv4GetPrefixesRetType, ok bool) { return getNetworkIPv4GetPrefixesAttributeTypeOk(o.Prefixes) } // SetPrefixes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) SetPrefixes(v NetworkIPv4GetPrefixesRetType) { setNetworkIPv4GetPrefixesAttributeType(&o.Prefixes, v) } // GetPublicIp returns the PublicIp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) GetPublicIp() (res NetworkIPv4GetPublicIpRetType) { res, _ = o.GetPublicIpOk() return @@ -217,21 +262,25 @@ func (o *NetworkIPv4) GetPublicIp() (res NetworkIPv4GetPublicIpRetType) { // GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) GetPublicIpOk() (ret NetworkIPv4GetPublicIpRetType, ok bool) { return getNetworkIPv4GetPublicIpAttributeTypeOk(o.PublicIp) } // HasPublicIp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) HasPublicIp() bool { _, ok := o.GetPublicIpOk() return ok } // SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv4) SetPublicIp(v NetworkIPv4GetPublicIpRetType) { setNetworkIPv4GetPublicIpAttributeType(&o.PublicIp, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NetworkIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkIPv4GetGatewayAttributeTypeOk(o.Gateway); ok { @@ -249,37 +298,45 @@ func (o NetworkIPv4) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNetworkIPv4 struct { value *NetworkIPv4 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkIPv4) Get() *NetworkIPv4 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkIPv4) Set(val *NetworkIPv4) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkIPv4) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkIPv4) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNetworkIPv4(val *NetworkIPv4) *NullableNetworkIPv4 { return &NullableNetworkIPv4{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkIPv4) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkIPv4) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_network_ipv6.go b/services/iaas/model_network_ipv6.go index af815c708..a438606b7 100644 --- a/services/iaas/model_network_ipv6.go +++ b/services/iaas/model_network_ipv6.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &NetworkIPv6{} */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetGatewayAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkIPv6GetGatewayAttributeTypeOk(arg NetworkIPv6GetGatewayAttributeType) (ret NetworkIPv6GetGatewayRetType, ok bool) { if arg == nil { return nil, false @@ -31,6 +34,7 @@ func getNetworkIPv6GetGatewayAttributeTypeOk(arg NetworkIPv6GetGatewayAttributeT return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkIPv6GetGatewayAttributeType(arg *NetworkIPv6GetGatewayAttributeType, val NetworkIPv6GetGatewayRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -39,7 +43,10 @@ func setNetworkIPv6GetGatewayAttributeType(arg *NetworkIPv6GetGatewayAttributeTy } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetGatewayArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetGatewayRetType = *string /* @@ -47,10 +54,16 @@ type NetworkIPv6GetGatewayRetType = *string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkIPv6GetNameserversAttributeTypeOk(arg NetworkIPv6GetNameserversAttributeType) (ret NetworkIPv6GetNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -58,6 +71,7 @@ func getNetworkIPv6GetNameserversAttributeTypeOk(arg NetworkIPv6GetNameserversAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkIPv6GetNameserversAttributeType(arg *NetworkIPv6GetNameserversAttributeType, val NetworkIPv6GetNameserversRetType) { *arg = &val } @@ -67,10 +81,16 @@ func setNetworkIPv6GetNameserversAttributeType(arg *NetworkIPv6GetNameserversAtt */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetPrefixesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetPrefixesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6GetPrefixesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkIPv6GetPrefixesAttributeTypeOk(arg NetworkIPv6GetPrefixesAttributeType) (ret NetworkIPv6GetPrefixesRetType, ok bool) { if arg == nil { return ret, false @@ -78,11 +98,13 @@ func getNetworkIPv6GetPrefixesAttributeTypeOk(arg NetworkIPv6GetPrefixesAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkIPv6GetPrefixesAttributeType(arg *NetworkIPv6GetPrefixesAttributeType, val NetworkIPv6GetPrefixesRetType) { *arg = &val } // NetworkIPv6 Object that represents the IPv6 part of a network. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkIPv6 struct { // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway NetworkIPv6GetGatewayAttributeType `json:"gateway,omitempty"` @@ -92,12 +114,14 @@ type NetworkIPv6 struct { Prefixes NetworkIPv6GetPrefixesAttributeType `json:"prefixes" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NetworkIPv6 NetworkIPv6 // NewNetworkIPv6 instantiates a new NetworkIPv6 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkIPv6(prefixes NetworkIPv6GetPrefixesArgType) *NetworkIPv6 { this := NetworkIPv6{} setNetworkIPv6GetPrefixesAttributeType(&this.Prefixes, prefixes) @@ -107,12 +131,14 @@ func NewNetworkIPv6(prefixes NetworkIPv6GetPrefixesArgType) *NetworkIPv6 { // NewNetworkIPv6WithDefaults instantiates a new NetworkIPv6 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkIPv6WithDefaults() *NetworkIPv6 { this := NetworkIPv6{} return &this } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) GetGateway() (res NetworkIPv6GetGatewayRetType) { res, _ = o.GetGatewayOk() return @@ -121,32 +147,38 @@ func (o *NetworkIPv6) GetGateway() (res NetworkIPv6GetGatewayRetType) { // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) GetGatewayOk() (ret NetworkIPv6GetGatewayRetType, ok bool) { return getNetworkIPv6GetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) HasGateway() bool { _, ok := o.GetGatewayOk() return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) SetGateway(v NetworkIPv6GetGatewayRetType) { setNetworkIPv6GetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) SetGatewayNil() { o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) UnsetGateway() { o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) GetNameservers() (res NetworkIPv6GetNameserversRetType) { res, _ = o.GetNameserversOk() return @@ -154,22 +186,26 @@ func (o *NetworkIPv6) GetNameservers() (res NetworkIPv6GetNameserversRetType) { // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) GetNameserversOk() (ret NetworkIPv6GetNameserversRetType, ok bool) { return getNetworkIPv6GetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) SetNameservers(v NetworkIPv6GetNameserversRetType) { setNetworkIPv6GetNameserversAttributeType(&o.Nameservers, v) } // GetPrefixes returns the Prefixes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) GetPrefixes() (ret NetworkIPv6GetPrefixesRetType) { ret, _ = o.GetPrefixesOk() return ret @@ -177,15 +213,18 @@ func (o *NetworkIPv6) GetPrefixes() (ret NetworkIPv6GetPrefixesRetType) { // GetPrefixesOk returns a tuple with the Prefixes field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) GetPrefixesOk() (ret NetworkIPv6GetPrefixesRetType, ok bool) { return getNetworkIPv6GetPrefixesAttributeTypeOk(o.Prefixes) } // SetPrefixes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkIPv6) SetPrefixes(v NetworkIPv6GetPrefixesRetType) { setNetworkIPv6GetPrefixesAttributeType(&o.Prefixes, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NetworkIPv6) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkIPv6GetGatewayAttributeTypeOk(o.Gateway); ok { @@ -200,37 +239,45 @@ func (o NetworkIPv6) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNetworkIPv6 struct { value *NetworkIPv6 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkIPv6) Get() *NetworkIPv6 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkIPv6) Set(val *NetworkIPv6) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkIPv6) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkIPv6) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNetworkIPv6(val *NetworkIPv6) *NullableNetworkIPv6 { return &NullableNetworkIPv6{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkIPv6) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkIPv6) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_network_list_response.go b/services/iaas/model_network_list_response.go index c09e64f21..fe887151d 100644 --- a/services/iaas/model_network_list_response.go +++ b/services/iaas/model_network_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &NetworkListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkListResponseGetItemsAttributeType = *[]Network + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkListResponseGetItemsArgType = []Network + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkListResponseGetItemsRetType = []Network +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkListResponseGetItemsAttributeTypeOk(arg NetworkListResponseGetItemsAttributeType) (ret NetworkListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getNetworkListResponseGetItemsAttributeTypeOk(arg NetworkListResponseGetIte return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkListResponseGetItemsAttributeType(arg *NetworkListResponseGetItemsAttributeType, val NetworkListResponseGetItemsRetType) { *arg = &val } // NetworkListResponse Network list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkListResponse struct { // A list of networks. // REQUIRED Items NetworkListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NetworkListResponse NetworkListResponse // NewNetworkListResponse instantiates a new NetworkListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkListResponse(items NetworkListResponseGetItemsArgType) *NetworkListResponse { this := NetworkListResponse{} setNetworkListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewNetworkListResponse(items NetworkListResponseGetItemsArgType) *NetworkLi // NewNetworkListResponseWithDefaults instantiates a new NetworkListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkListResponseWithDefaults() *NetworkListResponse { this := NetworkListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkListResponse) GetItems() (ret NetworkListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *NetworkListResponse) GetItems() (ret NetworkListResponseGetItemsRetType // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkListResponse) GetItemsOk() (ret NetworkListResponseGetItemsRetType, ok bool) { return getNetworkListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkListResponse) SetItems(v NetworkListResponseGetItemsRetType) { setNetworkListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NetworkListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o NetworkListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNetworkListResponse struct { value *NetworkListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkListResponse) Get() *NetworkListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkListResponse) Set(val *NetworkListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNetworkListResponse(val *NetworkListResponse) *NullableNetworkListResponse { return &NullableNetworkListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_network_range.go b/services/iaas/model_network_range.go index dac418482..b50029b5d 100644 --- a/services/iaas/model_network_range.go +++ b/services/iaas/model_network_range.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &NetworkRange{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkRangeGetCreatedAtAttributeTypeOk(arg NetworkRangeGetCreatedAtAttributeType) (ret NetworkRangeGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getNetworkRangeGetCreatedAtAttributeTypeOk(arg NetworkRangeGetCreatedAtAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkRangeGetCreatedAtAttributeType(arg *NetworkRangeGetCreatedAtAttributeType, val NetworkRangeGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setNetworkRangeGetCreatedAtAttributeType(arg *NetworkRangeGetCreatedAtAttri */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkRangeGetIdAttributeTypeOk(arg NetworkRangeGetIdAttributeType) (ret NetworkRangeGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getNetworkRangeGetIdAttributeTypeOk(arg NetworkRangeGetIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkRangeGetIdAttributeType(arg *NetworkRangeGetIdAttributeType, val NetworkRangeGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetIdRetType = string /* @@ -64,8 +78,10 @@ type NetworkRangeGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetPrefixAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkRangeGetPrefixAttributeTypeOk(arg NetworkRangeGetPrefixAttributeType) (ret NetworkRangeGetPrefixRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getNetworkRangeGetPrefixAttributeTypeOk(arg NetworkRangeGetPrefixAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkRangeGetPrefixAttributeType(arg *NetworkRangeGetPrefixAttributeType, val NetworkRangeGetPrefixRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetPrefixArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetPrefixRetType = string /* @@ -85,10 +105,16 @@ type NetworkRangeGetPrefixRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkRangeGetUpdatedAtAttributeTypeOk(arg NetworkRangeGetUpdatedAtAttributeType) (ret NetworkRangeGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -96,11 +122,13 @@ func getNetworkRangeGetUpdatedAtAttributeTypeOk(arg NetworkRangeGetUpdatedAtAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkRangeGetUpdatedAtAttributeType(arg *NetworkRangeGetUpdatedAtAttributeType, val NetworkRangeGetUpdatedAtRetType) { *arg = &val } // NetworkRange Object that represents a network range. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRange struct { // Date-time when resource was created. CreatedAt NetworkRangeGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -113,12 +141,14 @@ type NetworkRange struct { UpdatedAt NetworkRangeGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NetworkRange NetworkRange // NewNetworkRange instantiates a new NetworkRange object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkRange(prefix NetworkRangeGetPrefixArgType) *NetworkRange { this := NetworkRange{} setNetworkRangeGetPrefixAttributeType(&this.Prefix, prefix) @@ -128,12 +158,14 @@ func NewNetworkRange(prefix NetworkRangeGetPrefixArgType) *NetworkRange { // NewNetworkRangeWithDefaults instantiates a new NetworkRange object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkRangeWithDefaults() *NetworkRange { this := NetworkRange{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) GetCreatedAt() (res NetworkRangeGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -141,22 +173,26 @@ func (o *NetworkRange) GetCreatedAt() (res NetworkRangeGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) GetCreatedAtOk() (ret NetworkRangeGetCreatedAtRetType, ok bool) { return getNetworkRangeGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) SetCreatedAt(v NetworkRangeGetCreatedAtRetType) { setNetworkRangeGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) GetId() (res NetworkRangeGetIdRetType) { res, _ = o.GetIdOk() return @@ -164,22 +200,26 @@ func (o *NetworkRange) GetId() (res NetworkRangeGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) GetIdOk() (ret NetworkRangeGetIdRetType, ok bool) { return getNetworkRangeGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) SetId(v NetworkRangeGetIdRetType) { setNetworkRangeGetIdAttributeType(&o.Id, v) } // GetPrefix returns the Prefix field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) GetPrefix() (ret NetworkRangeGetPrefixRetType) { ret, _ = o.GetPrefixOk() return ret @@ -187,16 +227,19 @@ func (o *NetworkRange) GetPrefix() (ret NetworkRangeGetPrefixRetType) { // GetPrefixOk returns a tuple with the Prefix field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) GetPrefixOk() (ret NetworkRangeGetPrefixRetType, ok bool) { return getNetworkRangeGetPrefixAttributeTypeOk(o.Prefix) } // SetPrefix sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) SetPrefix(v NetworkRangeGetPrefixRetType) { setNetworkRangeGetPrefixAttributeType(&o.Prefix, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) GetUpdatedAt() (res NetworkRangeGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -204,21 +247,25 @@ func (o *NetworkRange) GetUpdatedAt() (res NetworkRangeGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) GetUpdatedAtOk() (ret NetworkRangeGetUpdatedAtRetType, ok bool) { return getNetworkRangeGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRange) SetUpdatedAt(v NetworkRangeGetUpdatedAtRetType) { setNetworkRangeGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NetworkRange) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkRangeGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -236,37 +283,45 @@ func (o NetworkRange) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNetworkRange struct { value *NetworkRange isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkRange) Get() *NetworkRange { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkRange) Set(val *NetworkRange) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkRange) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkRange) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNetworkRange(val *NetworkRange) *NullableNetworkRange { return &NullableNetworkRange{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkRange) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkRange) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_network_range_list_response.go b/services/iaas/model_network_range_list_response.go index 723ed45d0..a2433e985 100644 --- a/services/iaas/model_network_range_list_response.go +++ b/services/iaas/model_network_range_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &NetworkRangeListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeListResponseGetItemsAttributeType = *[]NetworkRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeListResponseGetItemsArgType = []NetworkRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeListResponseGetItemsRetType = []NetworkRange +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNetworkRangeListResponseGetItemsAttributeTypeOk(arg NetworkRangeListResponseGetItemsAttributeType) (ret NetworkRangeListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getNetworkRangeListResponseGetItemsAttributeTypeOk(arg NetworkRangeListResp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNetworkRangeListResponseGetItemsAttributeType(arg *NetworkRangeListResponseGetItemsAttributeType, val NetworkRangeListResponseGetItemsRetType) { *arg = &val } // NetworkRangeListResponse Network Range list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NetworkRangeListResponse struct { // A list of network ranges. // REQUIRED Items NetworkRangeListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NetworkRangeListResponse NetworkRangeListResponse // NewNetworkRangeListResponse instantiates a new NetworkRangeListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkRangeListResponse(items NetworkRangeListResponseGetItemsArgType) *NetworkRangeListResponse { this := NetworkRangeListResponse{} setNetworkRangeListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewNetworkRangeListResponse(items NetworkRangeListResponseGetItemsArgType) // NewNetworkRangeListResponseWithDefaults instantiates a new NetworkRangeListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNetworkRangeListResponseWithDefaults() *NetworkRangeListResponse { this := NetworkRangeListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRangeListResponse) GetItems() (ret NetworkRangeListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *NetworkRangeListResponse) GetItems() (ret NetworkRangeListResponseGetIt // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRangeListResponse) GetItemsOk() (ret NetworkRangeListResponseGetItemsRetType, ok bool) { return getNetworkRangeListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NetworkRangeListResponse) SetItems(v NetworkRangeListResponseGetItemsRetType) { setNetworkRangeListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NetworkRangeListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNetworkRangeListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o NetworkRangeListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNetworkRangeListResponse struct { value *NetworkRangeListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkRangeListResponse) Get() *NetworkRangeListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkRangeListResponse) Set(val *NetworkRangeListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkRangeListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkRangeListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNetworkRangeListResponse(val *NetworkRangeListResponse) *NullableNetworkRangeListResponse { return &NullableNetworkRangeListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNetworkRangeListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNetworkRangeListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_nexthop_blackhole.go b/services/iaas/model_nexthop_blackhole.go index cd23f141f..506547cbd 100644 --- a/services/iaas/model_nexthop_blackhole.go +++ b/services/iaas/model_nexthop_blackhole.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &NexthopBlackhole{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopBlackholeGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNexthopBlackholeGetTypeAttributeTypeOk(arg NexthopBlackholeGetTypeAttributeType) (ret NexthopBlackholeGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,25 +34,32 @@ func getNexthopBlackholeGetTypeAttributeTypeOk(arg NexthopBlackholeGetTypeAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNexthopBlackholeGetTypeAttributeType(arg *NexthopBlackholeGetTypeAttributeType, val NexthopBlackholeGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopBlackholeGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopBlackholeGetTypeRetType = string // NexthopBlackhole Object that represents a blackhole route. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopBlackhole struct { // REQUIRED Type NexthopBlackholeGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NexthopBlackhole NexthopBlackhole // NewNexthopBlackhole instantiates a new NexthopBlackhole object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNexthopBlackhole(types NexthopBlackholeGetTypeArgType) *NexthopBlackhole { this := NexthopBlackhole{} setNexthopBlackholeGetTypeAttributeType(&this.Type, types) @@ -59,12 +69,14 @@ func NewNexthopBlackhole(types NexthopBlackholeGetTypeArgType) *NexthopBlackhole // NewNexthopBlackholeWithDefaults instantiates a new NexthopBlackhole object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNexthopBlackholeWithDefaults() *NexthopBlackhole { this := NexthopBlackhole{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopBlackhole) GetType() (ret NexthopBlackholeGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -72,15 +84,18 @@ func (o *NexthopBlackhole) GetType() (ret NexthopBlackholeGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopBlackhole) GetTypeOk() (ret NexthopBlackholeGetTypeRetType, ok bool) { return getNexthopBlackholeGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopBlackhole) SetType(v NexthopBlackholeGetTypeRetType) { setNexthopBlackholeGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NexthopBlackhole) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNexthopBlackholeGetTypeAttributeTypeOk(o.Type); ok { @@ -89,37 +104,45 @@ func (o NexthopBlackhole) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNexthopBlackhole struct { value *NexthopBlackhole isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopBlackhole) Get() *NexthopBlackhole { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopBlackhole) Set(val *NexthopBlackhole) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopBlackhole) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopBlackhole) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNexthopBlackhole(val *NexthopBlackhole) *NullableNexthopBlackhole { return &NullableNexthopBlackhole{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopBlackhole) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopBlackhole) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_nexthop_internet.go b/services/iaas/model_nexthop_internet.go index ec9502645..50edd59bb 100644 --- a/services/iaas/model_nexthop_internet.go +++ b/services/iaas/model_nexthop_internet.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &NexthopInternet{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopInternetGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNexthopInternetGetTypeAttributeTypeOk(arg NexthopInternetGetTypeAttributeType) (ret NexthopInternetGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,25 +34,32 @@ func getNexthopInternetGetTypeAttributeTypeOk(arg NexthopInternetGetTypeAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNexthopInternetGetTypeAttributeType(arg *NexthopInternetGetTypeAttributeType, val NexthopInternetGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopInternetGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopInternetGetTypeRetType = string // NexthopInternet Object that represents a route to the internet. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopInternet struct { // REQUIRED Type NexthopInternetGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NexthopInternet NexthopInternet // NewNexthopInternet instantiates a new NexthopInternet object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNexthopInternet(types NexthopInternetGetTypeArgType) *NexthopInternet { this := NexthopInternet{} setNexthopInternetGetTypeAttributeType(&this.Type, types) @@ -59,12 +69,14 @@ func NewNexthopInternet(types NexthopInternetGetTypeArgType) *NexthopInternet { // NewNexthopInternetWithDefaults instantiates a new NexthopInternet object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNexthopInternetWithDefaults() *NexthopInternet { this := NexthopInternet{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopInternet) GetType() (ret NexthopInternetGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -72,15 +84,18 @@ func (o *NexthopInternet) GetType() (ret NexthopInternetGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopInternet) GetTypeOk() (ret NexthopInternetGetTypeRetType, ok bool) { return getNexthopInternetGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopInternet) SetType(v NexthopInternetGetTypeRetType) { setNexthopInternetGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NexthopInternet) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNexthopInternetGetTypeAttributeTypeOk(o.Type); ok { @@ -89,37 +104,45 @@ func (o NexthopInternet) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNexthopInternet struct { value *NexthopInternet isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopInternet) Get() *NexthopInternet { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopInternet) Set(val *NexthopInternet) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopInternet) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopInternet) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNexthopInternet(val *NexthopInternet) *NullableNexthopInternet { return &NullableNexthopInternet{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopInternet) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopInternet) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_nexthop_ipv4.go b/services/iaas/model_nexthop_ipv4.go index 4cb4ccb25..0a2a28f54 100644 --- a/services/iaas/model_nexthop_ipv4.go +++ b/services/iaas/model_nexthop_ipv4.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &NexthopIPv4{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv4GetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNexthopIPv4GetTypeAttributeTypeOk(arg NexthopIPv4GetTypeAttributeType) (ret NexthopIPv4GetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getNexthopIPv4GetTypeAttributeTypeOk(arg NexthopIPv4GetTypeAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNexthopIPv4GetTypeAttributeType(arg *NexthopIPv4GetTypeAttributeType, val NexthopIPv4GetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv4GetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv4GetTypeRetType = string /* @@ -43,8 +50,10 @@ type NexthopIPv4GetTypeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv4GetValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNexthopIPv4GetValueAttributeTypeOk(arg NexthopIPv4GetValueAttributeType) (ret NexthopIPv4GetValueRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getNexthopIPv4GetValueAttributeTypeOk(arg NexthopIPv4GetValueAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNexthopIPv4GetValueAttributeType(arg *NexthopIPv4GetValueAttributeType, val NexthopIPv4GetValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv4GetValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv4GetValueRetType = string // NexthopIPv4 Object that represents an IPv4 address. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv4 struct { // REQUIRED Type NexthopIPv4GetTypeAttributeType `json:"type" required:"true"` @@ -68,12 +82,14 @@ type NexthopIPv4 struct { Value NexthopIPv4GetValueAttributeType `json:"value" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NexthopIPv4 NexthopIPv4 // NewNexthopIPv4 instantiates a new NexthopIPv4 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNexthopIPv4(types NexthopIPv4GetTypeArgType, value NexthopIPv4GetValueArgType) *NexthopIPv4 { this := NexthopIPv4{} setNexthopIPv4GetTypeAttributeType(&this.Type, types) @@ -84,12 +100,14 @@ func NewNexthopIPv4(types NexthopIPv4GetTypeArgType, value NexthopIPv4GetValueAr // NewNexthopIPv4WithDefaults instantiates a new NexthopIPv4 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNexthopIPv4WithDefaults() *NexthopIPv4 { this := NexthopIPv4{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv4) GetType() (ret NexthopIPv4GetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -97,16 +115,19 @@ func (o *NexthopIPv4) GetType() (ret NexthopIPv4GetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv4) GetTypeOk() (ret NexthopIPv4GetTypeRetType, ok bool) { return getNexthopIPv4GetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv4) SetType(v NexthopIPv4GetTypeRetType) { setNexthopIPv4GetTypeAttributeType(&o.Type, v) } // GetValue returns the Value field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv4) GetValue() (ret NexthopIPv4GetValueRetType) { ret, _ = o.GetValueOk() return ret @@ -114,15 +135,18 @@ func (o *NexthopIPv4) GetValue() (ret NexthopIPv4GetValueRetType) { // GetValueOk returns a tuple with the Value field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv4) GetValueOk() (ret NexthopIPv4GetValueRetType, ok bool) { return getNexthopIPv4GetValueAttributeTypeOk(o.Value) } // SetValue sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv4) SetValue(v NexthopIPv4GetValueRetType) { setNexthopIPv4GetValueAttributeType(&o.Value, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NexthopIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNexthopIPv4GetTypeAttributeTypeOk(o.Type); ok { @@ -134,37 +158,45 @@ func (o NexthopIPv4) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNexthopIPv4 struct { value *NexthopIPv4 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopIPv4) Get() *NexthopIPv4 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopIPv4) Set(val *NexthopIPv4) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopIPv4) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopIPv4) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNexthopIPv4(val *NexthopIPv4) *NullableNexthopIPv4 { return &NullableNexthopIPv4{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopIPv4) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopIPv4) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_nexthop_ipv6.go b/services/iaas/model_nexthop_ipv6.go index 48f650da0..a66290df0 100644 --- a/services/iaas/model_nexthop_ipv6.go +++ b/services/iaas/model_nexthop_ipv6.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &NexthopIPv6{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv6GetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNexthopIPv6GetTypeAttributeTypeOk(arg NexthopIPv6GetTypeAttributeType) (ret NexthopIPv6GetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getNexthopIPv6GetTypeAttributeTypeOk(arg NexthopIPv6GetTypeAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNexthopIPv6GetTypeAttributeType(arg *NexthopIPv6GetTypeAttributeType, val NexthopIPv6GetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv6GetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv6GetTypeRetType = string /* @@ -43,8 +50,10 @@ type NexthopIPv6GetTypeRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv6GetValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNexthopIPv6GetValueAttributeTypeOk(arg NexthopIPv6GetValueAttributeType) (ret NexthopIPv6GetValueRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getNexthopIPv6GetValueAttributeTypeOk(arg NexthopIPv6GetValueAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNexthopIPv6GetValueAttributeType(arg *NexthopIPv6GetValueAttributeType, val NexthopIPv6GetValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv6GetValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv6GetValueRetType = string // NexthopIPv6 Object that represents an IPv6 address. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NexthopIPv6 struct { // REQUIRED Type NexthopIPv6GetTypeAttributeType `json:"type" required:"true"` @@ -68,12 +82,14 @@ type NexthopIPv6 struct { Value NexthopIPv6GetValueAttributeType `json:"value" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NexthopIPv6 NexthopIPv6 // NewNexthopIPv6 instantiates a new NexthopIPv6 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNexthopIPv6(types NexthopIPv6GetTypeArgType, value NexthopIPv6GetValueArgType) *NexthopIPv6 { this := NexthopIPv6{} setNexthopIPv6GetTypeAttributeType(&this.Type, types) @@ -84,12 +100,14 @@ func NewNexthopIPv6(types NexthopIPv6GetTypeArgType, value NexthopIPv6GetValueAr // NewNexthopIPv6WithDefaults instantiates a new NexthopIPv6 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNexthopIPv6WithDefaults() *NexthopIPv6 { this := NexthopIPv6{} return &this } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv6) GetType() (ret NexthopIPv6GetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -97,16 +115,19 @@ func (o *NexthopIPv6) GetType() (ret NexthopIPv6GetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv6) GetTypeOk() (ret NexthopIPv6GetTypeRetType, ok bool) { return getNexthopIPv6GetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv6) SetType(v NexthopIPv6GetTypeRetType) { setNexthopIPv6GetTypeAttributeType(&o.Type, v) } // GetValue returns the Value field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv6) GetValue() (ret NexthopIPv6GetValueRetType) { ret, _ = o.GetValueOk() return ret @@ -114,15 +135,18 @@ func (o *NexthopIPv6) GetValue() (ret NexthopIPv6GetValueRetType) { // GetValueOk returns a tuple with the Value field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv6) GetValueOk() (ret NexthopIPv6GetValueRetType, ok bool) { return getNexthopIPv6GetValueAttributeTypeOk(o.Value) } // SetValue sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NexthopIPv6) SetValue(v NexthopIPv6GetValueRetType) { setNexthopIPv6GetValueAttributeType(&o.Value, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NexthopIPv6) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNexthopIPv6GetTypeAttributeTypeOk(o.Type); ok { @@ -134,37 +158,45 @@ func (o NexthopIPv6) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNexthopIPv6 struct { value *NexthopIPv6 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopIPv6) Get() *NexthopIPv6 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopIPv6) Set(val *NexthopIPv6) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopIPv6) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopIPv6) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNexthopIPv6(val *NexthopIPv6) *NullableNexthopIPv6 { return &NullableNexthopIPv6{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNexthopIPv6) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNexthopIPv6) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_nic.go b/services/iaas/model_nic.go index 8781804cd..a1676a331 100644 --- a/services/iaas/model_nic.go +++ b/services/iaas/model_nic.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &NIC{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetAllowedAddressesAttributeType = *[]AllowedAddressesInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetAllowedAddressesArgType = []AllowedAddressesInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetAllowedAddressesRetType = []AllowedAddressesInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetAllowedAddressesAttributeTypeOk(arg NICGetAllowedAddressesAttributeType) (ret NICGetAllowedAddressesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getNICGetAllowedAddressesAttributeTypeOk(arg NICGetAllowedAddressesAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetAllowedAddressesAttributeType(arg *NICGetAllowedAddressesAttributeType, val NICGetAllowedAddressesRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setNICGetAllowedAddressesAttributeType(arg *NICGetAllowedAddressesAttribute */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetDescriptionAttributeTypeOk(arg NICGetDescriptionAttributeType) (ret NICGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getNICGetDescriptionAttributeTypeOk(arg NICGetDescriptionAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetDescriptionAttributeType(arg *NICGetDescriptionAttributeType, val NICGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetDescriptionRetType = string /* @@ -63,8 +77,10 @@ type NICGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetDeviceAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetDeviceAttributeTypeOk(arg NICGetDeviceAttributeType) (ret NICGetDeviceRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getNICGetDeviceAttributeTypeOk(arg NICGetDeviceAttributeType) (ret NICGetDe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetDeviceAttributeType(arg *NICGetDeviceAttributeType, val NICGetDeviceRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetDeviceArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetDeviceRetType = string /* @@ -84,8 +104,10 @@ type NICGetDeviceRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetIdAttributeTypeOk(arg NICGetIdAttributeType) (ret NICGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +115,15 @@ func getNICGetIdAttributeTypeOk(arg NICGetIdAttributeType) (ret NICGetIdRetType, return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetIdAttributeType(arg *NICGetIdAttributeType, val NICGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIdRetType = string /* @@ -105,8 +131,10 @@ type NICGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIpv4AttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetIpv4AttributeTypeOk(arg NICGetIpv4AttributeType) (ret NICGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -114,11 +142,15 @@ func getNICGetIpv4AttributeTypeOk(arg NICGetIpv4AttributeType) (ret NICGetIpv4Re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetIpv4AttributeType(arg *NICGetIpv4AttributeType, val NICGetIpv4RetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIpv4ArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIpv4RetType = string /* @@ -126,8 +158,10 @@ type NICGetIpv4RetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIpv6AttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetIpv6AttributeTypeOk(arg NICGetIpv6AttributeType) (ret NICGetIpv6RetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +169,15 @@ func getNICGetIpv6AttributeTypeOk(arg NICGetIpv6AttributeType) (ret NICGetIpv6Re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetIpv6AttributeType(arg *NICGetIpv6AttributeType, val NICGetIpv6RetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIpv6ArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetIpv6RetType = string /* @@ -147,10 +185,16 @@ type NICGetIpv6RetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetLabelsAttributeTypeOk(arg NICGetLabelsAttributeType) (ret NICGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -158,6 +202,7 @@ func getNICGetLabelsAttributeTypeOk(arg NICGetLabelsAttributeType) (ret NICGetLa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetLabelsAttributeType(arg *NICGetLabelsAttributeType, val NICGetLabelsRetType) { *arg = &val } @@ -167,8 +212,10 @@ func setNICGetLabelsAttributeType(arg *NICGetLabelsAttributeType, val NICGetLabe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetMacAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetMacAttributeTypeOk(arg NICGetMacAttributeType) (ret NICGetMacRetType, ok bool) { if arg == nil { return ret, false @@ -176,11 +223,15 @@ func getNICGetMacAttributeTypeOk(arg NICGetMacAttributeType) (ret NICGetMacRetTy return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetMacAttributeType(arg *NICGetMacAttributeType, val NICGetMacRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetMacArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetMacRetType = string /* @@ -188,8 +239,10 @@ type NICGetMacRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetNameAttributeTypeOk(arg NICGetNameAttributeType) (ret NICGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +250,15 @@ func getNICGetNameAttributeTypeOk(arg NICGetNameAttributeType) (ret NICGetNameRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetNameAttributeType(arg *NICGetNameAttributeType, val NICGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetNameRetType = string /* @@ -209,8 +266,10 @@ type NICGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetNetworkIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetNetworkIdAttributeTypeOk(arg NICGetNetworkIdAttributeType) (ret NICGetNetworkIdRetType, ok bool) { if arg == nil { return ret, false @@ -218,11 +277,15 @@ func getNICGetNetworkIdAttributeTypeOk(arg NICGetNetworkIdAttributeType) (ret NI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetNetworkIdAttributeType(arg *NICGetNetworkIdAttributeType, val NICGetNetworkIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetNetworkIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetNetworkIdRetType = string /* @@ -230,10 +293,16 @@ type NICGetNetworkIdRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICgetNicSecurityAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICgetNicSecurityArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICgetNicSecurityRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICgetNicSecurityAttributeTypeOk(arg NICgetNicSecurityAttributeType) (ret NICgetNicSecurityRetType, ok bool) { if arg == nil { return ret, false @@ -241,6 +310,7 @@ func getNICgetNicSecurityAttributeTypeOk(arg NICgetNicSecurityAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICgetNicSecurityAttributeType(arg *NICgetNicSecurityAttributeType, val NICgetNicSecurityRetType) { *arg = &val } @@ -250,10 +320,16 @@ func setNICgetNicSecurityAttributeType(arg *NICgetNicSecurityAttributeType, val */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetSecurityGroupsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetSecurityGroupsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetSecurityGroupsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetSecurityGroupsAttributeTypeOk(arg NICGetSecurityGroupsAttributeType) (ret NICGetSecurityGroupsRetType, ok bool) { if arg == nil { return ret, false @@ -261,6 +337,7 @@ func getNICGetSecurityGroupsAttributeTypeOk(arg NICGetSecurityGroupsAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetSecurityGroupsAttributeType(arg *NICGetSecurityGroupsAttributeType, val NICGetSecurityGroupsRetType) { *arg = &val } @@ -270,8 +347,10 @@ func setNICGetSecurityGroupsAttributeType(arg *NICGetSecurityGroupsAttributeType */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetStatusAttributeTypeOk(arg NICGetStatusAttributeType) (ret NICGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -279,11 +358,15 @@ func getNICGetStatusAttributeTypeOk(arg NICGetStatusAttributeType) (ret NICGetSt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetStatusAttributeType(arg *NICGetStatusAttributeType, val NICGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetStatusRetType = string /* @@ -291,8 +374,10 @@ type NICGetStatusRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICGetTypeAttributeTypeOk(arg NICGetTypeAttributeType) (ret NICGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -300,14 +385,19 @@ func getNICGetTypeAttributeTypeOk(arg NICGetTypeAttributeType) (ret NICGetTypeRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICGetTypeAttributeType(arg *NICGetTypeAttributeType, val NICGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICGetTypeRetType = string // NIC Object that represents a network interface. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NIC struct { // A list of IPs or CIDR notations. AllowedAddresses NICGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` @@ -321,7 +411,7 @@ type NIC struct { Ipv4 NICGetIpv4AttributeType `json:"ipv4,omitempty"` // String that represents an IPv6 address. Ipv6 NICGetIpv6AttributeType `json:"ipv6,omitempty"` - // 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. + // 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. Labels NICGetLabelsAttributeType `json:"labels,omitempty"` // Object that represents an MAC address. Mac NICGetMacAttributeType `json:"mac,omitempty"` @@ -343,6 +433,7 @@ type NIC struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNIC() *NIC { this := NIC{} return &this @@ -351,6 +442,7 @@ func NewNIC() *NIC { // NewNICWithDefaults instantiates a new NIC object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNICWithDefaults() *NIC { this := NIC{} var nicSecurity bool = true @@ -359,6 +451,7 @@ func NewNICWithDefaults() *NIC { } // GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetAllowedAddresses() (res NICGetAllowedAddressesRetType) { res, _ = o.GetAllowedAddressesOk() return @@ -366,22 +459,26 @@ func (o *NIC) GetAllowedAddresses() (res NICGetAllowedAddressesRetType) { // GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetAllowedAddressesOk() (ret NICGetAllowedAddressesRetType, ok bool) { return getNICGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) } // HasAllowedAddresses returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasAllowedAddresses() bool { _, ok := o.GetAllowedAddressesOk() return ok } // SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetAllowedAddresses(v NICGetAllowedAddressesRetType) { setNICGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetDescription() (res NICGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -389,22 +486,26 @@ func (o *NIC) GetDescription() (res NICGetDescriptionRetType) { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetDescriptionOk() (ret NICGetDescriptionRetType, ok bool) { return getNICGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetDescription(v NICGetDescriptionRetType) { setNICGetDescriptionAttributeType(&o.Description, v) } // GetDevice returns the Device field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetDevice() (res NICGetDeviceRetType) { res, _ = o.GetDeviceOk() return @@ -412,22 +513,26 @@ func (o *NIC) GetDevice() (res NICGetDeviceRetType) { // GetDeviceOk returns a tuple with the Device field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetDeviceOk() (ret NICGetDeviceRetType, ok bool) { return getNICGetDeviceAttributeTypeOk(o.Device) } // HasDevice returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasDevice() bool { _, ok := o.GetDeviceOk() return ok } // SetDevice gets a reference to the given string and assigns it to the Device field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetDevice(v NICGetDeviceRetType) { setNICGetDeviceAttributeType(&o.Device, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetId() (res NICGetIdRetType) { res, _ = o.GetIdOk() return @@ -435,22 +540,26 @@ func (o *NIC) GetId() (res NICGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetIdOk() (ret NICGetIdRetType, ok bool) { return getNICGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetId(v NICGetIdRetType) { setNICGetIdAttributeType(&o.Id, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetIpv4() (res NICGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -458,22 +567,26 @@ func (o *NIC) GetIpv4() (res NICGetIpv4RetType) { // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetIpv4Ok() (ret NICGetIpv4RetType, ok bool) { return getNICGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetIpv4(v NICGetIpv4RetType) { setNICGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetIpv6() (res NICGetIpv6RetType) { res, _ = o.GetIpv6Ok() return @@ -481,22 +594,26 @@ func (o *NIC) GetIpv6() (res NICGetIpv6RetType) { // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetIpv6Ok() (ret NICGetIpv6RetType, ok bool) { return getNICGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasIpv6() bool { _, ok := o.GetIpv6Ok() return ok } // SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetIpv6(v NICGetIpv6RetType) { setNICGetIpv6AttributeType(&o.Ipv6, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetLabels() (res NICGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -504,22 +621,26 @@ func (o *NIC) GetLabels() (res NICGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetLabelsOk() (ret NICGetLabelsRetType, ok bool) { return getNICGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetLabels(v NICGetLabelsRetType) { setNICGetLabelsAttributeType(&o.Labels, v) } // GetMac returns the Mac field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetMac() (res NICGetMacRetType) { res, _ = o.GetMacOk() return @@ -527,22 +648,26 @@ func (o *NIC) GetMac() (res NICGetMacRetType) { // GetMacOk returns a tuple with the Mac field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetMacOk() (ret NICGetMacRetType, ok bool) { return getNICGetMacAttributeTypeOk(o.Mac) } // HasMac returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasMac() bool { _, ok := o.GetMacOk() return ok } // SetMac gets a reference to the given string and assigns it to the Mac field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetMac(v NICGetMacRetType) { setNICGetMacAttributeType(&o.Mac, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetName() (res NICGetNameRetType) { res, _ = o.GetNameOk() return @@ -550,22 +675,26 @@ func (o *NIC) GetName() (res NICGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetNameOk() (ret NICGetNameRetType, ok bool) { return getNICGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetName(v NICGetNameRetType) { setNICGetNameAttributeType(&o.Name, v) } // GetNetworkId returns the NetworkId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetNetworkId() (res NICGetNetworkIdRetType) { res, _ = o.GetNetworkIdOk() return @@ -573,22 +702,26 @@ func (o *NIC) GetNetworkId() (res NICGetNetworkIdRetType) { // GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetNetworkIdOk() (ret NICGetNetworkIdRetType, ok bool) { return getNICGetNetworkIdAttributeTypeOk(o.NetworkId) } // HasNetworkId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasNetworkId() bool { _, ok := o.GetNetworkIdOk() return ok } // SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetNetworkId(v NICGetNetworkIdRetType) { setNICGetNetworkIdAttributeType(&o.NetworkId, v) } // GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetNicSecurity() (res NICgetNicSecurityRetType) { res, _ = o.GetNicSecurityOk() return @@ -596,22 +729,26 @@ func (o *NIC) GetNicSecurity() (res NICgetNicSecurityRetType) { // GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetNicSecurityOk() (ret NICgetNicSecurityRetType, ok bool) { return getNICgetNicSecurityAttributeTypeOk(o.NicSecurity) } // HasNicSecurity returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasNicSecurity() bool { _, ok := o.GetNicSecurityOk() return ok } // SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetNicSecurity(v NICgetNicSecurityRetType) { setNICgetNicSecurityAttributeType(&o.NicSecurity, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetSecurityGroups() (res NICGetSecurityGroupsRetType) { res, _ = o.GetSecurityGroupsOk() return @@ -619,22 +756,26 @@ func (o *NIC) GetSecurityGroups() (res NICGetSecurityGroupsRetType) { // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetSecurityGroupsOk() (ret NICGetSecurityGroupsRetType, ok bool) { return getNICGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasSecurityGroups() bool { _, ok := o.GetSecurityGroupsOk() return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetSecurityGroups(v NICGetSecurityGroupsRetType) { setNICGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetStatus() (res NICGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -642,22 +783,26 @@ func (o *NIC) GetStatus() (res NICGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetStatusOk() (ret NICGetStatusRetType, ok bool) { return getNICGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetStatus(v NICGetStatusRetType) { setNICGetStatusAttributeType(&o.Status, v) } // GetType returns the Type field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetType() (res NICGetTypeRetType) { res, _ = o.GetTypeOk() return @@ -665,21 +810,25 @@ func (o *NIC) GetType() (res NICGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) GetTypeOk() (ret NICGetTypeRetType, ok bool) { return getNICGetTypeAttributeTypeOk(o.Type) } // HasType returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) HasType() bool { _, ok := o.GetTypeOk() return ok } // SetType gets a reference to the given string and assigns it to the Type field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NIC) SetType(v NICGetTypeRetType) { setNICGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NIC) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNICGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { @@ -727,37 +876,45 @@ func (o NIC) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNIC struct { value *NIC isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNIC) Get() *NIC { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNIC) Set(val *NIC) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNIC) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNIC) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNIC(val *NIC) *NullableNIC { return &NullableNIC{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNIC) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNIC) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_nic_list_response.go b/services/iaas/model_nic_list_response.go index 6dd5b975c..49790d5c8 100644 --- a/services/iaas/model_nic_list_response.go +++ b/services/iaas/model_nic_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &NICListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICListResponseGetItemsAttributeType = *[]NIC + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICListResponseGetItemsArgType = []NIC + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICListResponseGetItemsRetType = []NIC +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getNICListResponseGetItemsAttributeTypeOk(arg NICListResponseGetItemsAttributeType) (ret NICListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getNICListResponseGetItemsAttributeTypeOk(arg NICListResponseGetItemsAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setNICListResponseGetItemsAttributeType(arg *NICListResponseGetItemsAttributeType, val NICListResponseGetItemsRetType) { *arg = &val } // NICListResponse NIC list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NICListResponse struct { // A list of network interfaces. // REQUIRED Items NICListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _NICListResponse NICListResponse // NewNICListResponse instantiates a new NICListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNICListResponse(items NICListResponseGetItemsArgType) *NICListResponse { this := NICListResponse{} setNICListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewNICListResponse(items NICListResponseGetItemsArgType) *NICListResponse { // NewNICListResponseWithDefaults instantiates a new NICListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNICListResponseWithDefaults() *NICListResponse { this := NICListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NICListResponse) GetItems() (ret NICListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *NICListResponse) GetItems() (ret NICListResponseGetItemsRetType) { // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NICListResponse) GetItemsOk() (ret NICListResponseGetItemsRetType, ok bool) { return getNICListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *NICListResponse) SetItems(v NICListResponseGetItemsRetType) { setNICListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o NICListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getNICListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o NICListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableNICListResponse struct { value *NICListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNICListResponse) Get() *NICListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNICListResponse) Set(val *NICListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNICListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNICListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableNICListResponse(val *NICListResponse) *NullableNICListResponse { return &NullableNICListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableNICListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableNICListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_partial_update_network_area_payload.go b/services/iaas/model_partial_update_network_area_payload.go index eff6e5de0..4b162fed3 100644 --- a/services/iaas/model_partial_update_network_area_payload.go +++ b/services/iaas/model_partial_update_network_area_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PartialUpdateNetworkAreaPayload{} */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkAreaPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkAreaPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkAreaPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(arg PartialUpdateNetworkAreaPayloadGetLabelsAttributeType) (ret PartialUpdateNetworkAreaPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(arg PartialUpdat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkAreaPayloadGetLabelsAttributeType(arg *PartialUpdateNetworkAreaPayloadGetLabelsAttributeType, val PartialUpdateNetworkAreaPayloadGetLabelsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setPartialUpdateNetworkAreaPayloadGetLabelsAttributeType(arg *PartialUpdate */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkAreaPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(arg PartialUpdateNetworkAreaPayloadGetNameAttributeType) (ret PartialUpdateNetworkAreaPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -51,16 +61,21 @@ func getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(arg PartialUpdateN return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkAreaPayloadGetNameAttributeType(arg *PartialUpdateNetworkAreaPayloadGetNameAttributeType, val PartialUpdateNetworkAreaPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkAreaPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkAreaPayloadGetNameRetType = string // PartialUpdateNetworkAreaPayload Object that represents the network area update request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkAreaPayload struct { - // 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. + // 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. Labels PartialUpdateNetworkAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` Name PartialUpdateNetworkAreaPayloadGetNameAttributeType `json:"name,omitempty"` } @@ -69,6 +84,7 @@ type PartialUpdateNetworkAreaPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPartialUpdateNetworkAreaPayload() *PartialUpdateNetworkAreaPayload { this := PartialUpdateNetworkAreaPayload{} return &this @@ -77,12 +93,14 @@ func NewPartialUpdateNetworkAreaPayload() *PartialUpdateNetworkAreaPayload { // NewPartialUpdateNetworkAreaPayloadWithDefaults instantiates a new PartialUpdateNetworkAreaPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPartialUpdateNetworkAreaPayloadWithDefaults() *PartialUpdateNetworkAreaPayload { this := PartialUpdateNetworkAreaPayload{} return &this } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkAreaPayload) GetLabels() (res PartialUpdateNetworkAreaPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -90,22 +108,26 @@ func (o *PartialUpdateNetworkAreaPayload) GetLabels() (res PartialUpdateNetworkA // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkAreaPayload) GetLabelsOk() (ret PartialUpdateNetworkAreaPayloadGetLabelsRetType, ok bool) { return getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkAreaPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkAreaPayload) SetLabels(v PartialUpdateNetworkAreaPayloadGetLabelsRetType) { setPartialUpdateNetworkAreaPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkAreaPayload) GetName() (res PartialUpdateNetworkAreaPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -113,21 +135,25 @@ func (o *PartialUpdateNetworkAreaPayload) GetName() (res PartialUpdateNetworkAre // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkAreaPayload) GetNameOk() (ret PartialUpdateNetworkAreaPayloadGetNameRetType, ok bool) { return getPartialUpdateNetworkAreaPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkAreaPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkAreaPayload) SetName(v PartialUpdateNetworkAreaPayloadGetNameRetType) { setPartialUpdateNetworkAreaPayloadGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PartialUpdateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPartialUpdateNetworkAreaPayloadGetLabelsAttributeTypeOk(o.Labels); ok { @@ -139,37 +165,45 @@ func (o PartialUpdateNetworkAreaPayload) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePartialUpdateNetworkAreaPayload struct { value *PartialUpdateNetworkAreaPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateNetworkAreaPayload) Get() *PartialUpdateNetworkAreaPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateNetworkAreaPayload) Set(val *PartialUpdateNetworkAreaPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateNetworkAreaPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateNetworkAreaPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePartialUpdateNetworkAreaPayload(val *PartialUpdateNetworkAreaPayload) *NullablePartialUpdateNetworkAreaPayload { return &NullablePartialUpdateNetworkAreaPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateNetworkAreaPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_partial_update_network_payload.go b/services/iaas/model_partial_update_network_payload.go index 6775d6f80..0101b05c8 100644 --- a/services/iaas/model_partial_update_network_payload.go +++ b/services/iaas/model_partial_update_network_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PartialUpdateNetworkPayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadgetDhcpAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadgetDhcpArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadgetDhcpRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(arg PartialUpdateNetworkPayloadgetDhcpAttributeType) (ret PartialUpdateNetworkPayloadgetDhcpRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(arg PartialUpdateNetwo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkPayloadgetDhcpAttributeType(arg *PartialUpdateNetworkPayloadgetDhcpAttributeType, val PartialUpdateNetworkPayloadgetDhcpRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setPartialUpdateNetworkPayloadgetDhcpAttributeType(arg *PartialUpdateNetwor */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetIpv4AttributeType = *UpdateNetworkIPv4Body + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetIpv4ArgType = UpdateNetworkIPv4Body + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetIpv4RetType = UpdateNetworkIPv4Body +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkPayloadGetIpv4AttributeTypeOk(arg PartialUpdateNetworkPayloadGetIpv4AttributeType) (ret PartialUpdateNetworkPayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getPartialUpdateNetworkPayloadGetIpv4AttributeTypeOk(arg PartialUpdateNetwo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkPayloadGetIpv4AttributeType(arg *PartialUpdateNetworkPayloadGetIpv4AttributeType, val PartialUpdateNetworkPayloadGetIpv4RetType) { *arg = &val } @@ -62,10 +77,16 @@ func setPartialUpdateNetworkPayloadGetIpv4AttributeType(arg *PartialUpdateNetwor */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetIpv6AttributeType = *UpdateNetworkIPv6Body + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetIpv6ArgType = UpdateNetworkIPv6Body + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetIpv6RetType = UpdateNetworkIPv6Body +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkPayloadGetIpv6AttributeTypeOk(arg PartialUpdateNetworkPayloadGetIpv6AttributeType) (ret PartialUpdateNetworkPayloadGetIpv6RetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getPartialUpdateNetworkPayloadGetIpv6AttributeTypeOk(arg PartialUpdateNetwo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkPayloadGetIpv6AttributeType(arg *PartialUpdateNetworkPayloadGetIpv6AttributeType, val PartialUpdateNetworkPayloadGetIpv6RetType) { *arg = &val } @@ -82,10 +104,16 @@ func setPartialUpdateNetworkPayloadGetIpv6AttributeType(arg *PartialUpdateNetwor */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkPayloadGetLabelsAttributeTypeOk(arg PartialUpdateNetworkPayloadGetLabelsAttributeType) (ret PartialUpdateNetworkPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -93,6 +121,7 @@ func getPartialUpdateNetworkPayloadGetLabelsAttributeTypeOk(arg PartialUpdateNet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkPayloadGetLabelsAttributeType(arg *PartialUpdateNetworkPayloadGetLabelsAttributeType, val PartialUpdateNetworkPayloadGetLabelsRetType) { *arg = &val } @@ -102,8 +131,10 @@ func setPartialUpdateNetworkPayloadGetLabelsAttributeType(arg *PartialUpdateNetw */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkPayloadGetNameAttributeTypeOk(arg PartialUpdateNetworkPayloadGetNameAttributeType) (ret PartialUpdateNetworkPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -111,11 +142,15 @@ func getPartialUpdateNetworkPayloadGetNameAttributeTypeOk(arg PartialUpdateNetwo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkPayloadGetNameAttributeType(arg *PartialUpdateNetworkPayloadGetNameAttributeType, val PartialUpdateNetworkPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetNameRetType = string /* @@ -123,10 +158,16 @@ type PartialUpdateNetworkPayloadGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadgetRoutedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadgetRoutedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadgetRoutedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkPayloadgetRoutedAttributeTypeOk(arg PartialUpdateNetworkPayloadgetRoutedAttributeType) (ret PartialUpdateNetworkPayloadgetRoutedRetType, ok bool) { if arg == nil { return ret, false @@ -134,6 +175,7 @@ func getPartialUpdateNetworkPayloadgetRoutedAttributeTypeOk(arg PartialUpdateNet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkPayloadgetRoutedAttributeType(arg *PartialUpdateNetworkPayloadgetRoutedAttributeType, val PartialUpdateNetworkPayloadgetRoutedRetType) { *arg = &val } @@ -143,8 +185,10 @@ func setPartialUpdateNetworkPayloadgetRoutedAttributeType(arg *PartialUpdateNetw */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetRoutingTableIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPartialUpdateNetworkPayloadGetRoutingTableIdAttributeTypeOk(arg PartialUpdateNetworkPayloadGetRoutingTableIdAttributeType) (ret PartialUpdateNetworkPayloadGetRoutingTableIdRetType, ok bool) { if arg == nil { return ret, false @@ -152,20 +196,25 @@ func getPartialUpdateNetworkPayloadGetRoutingTableIdAttributeTypeOk(arg PartialU return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPartialUpdateNetworkPayloadGetRoutingTableIdAttributeType(arg *PartialUpdateNetworkPayloadGetRoutingTableIdAttributeType, val PartialUpdateNetworkPayloadGetRoutingTableIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetRoutingTableIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayloadGetRoutingTableIdRetType = string // PartialUpdateNetworkPayload Object that represents the request body for a network update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PartialUpdateNetworkPayload struct { // Enable or disable DHCP for a network. Dhcp PartialUpdateNetworkPayloadgetDhcpAttributeType `json:"dhcp,omitempty"` Ipv4 PartialUpdateNetworkPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` Ipv6 PartialUpdateNetworkPayloadGetIpv6AttributeType `json:"ipv6,omitempty"` - // 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. + // 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. Labels PartialUpdateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name PartialUpdateNetworkPayloadGetNameAttributeType `json:"name,omitempty"` @@ -179,6 +228,7 @@ type PartialUpdateNetworkPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPartialUpdateNetworkPayload() *PartialUpdateNetworkPayload { this := PartialUpdateNetworkPayload{} return &this @@ -187,12 +237,14 @@ func NewPartialUpdateNetworkPayload() *PartialUpdateNetworkPayload { // NewPartialUpdateNetworkPayloadWithDefaults instantiates a new PartialUpdateNetworkPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { this := PartialUpdateNetworkPayload{} return &this } // GetDhcp returns the Dhcp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetDhcp() (res PartialUpdateNetworkPayloadgetDhcpRetType) { res, _ = o.GetDhcpOk() return @@ -200,22 +252,26 @@ func (o *PartialUpdateNetworkPayload) GetDhcp() (res PartialUpdateNetworkPayload // GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetDhcpOk() (ret PartialUpdateNetworkPayloadgetDhcpRetType, ok bool) { return getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp) } // HasDhcp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) HasDhcp() bool { _, ok := o.GetDhcpOk() return ok } // SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) SetDhcp(v PartialUpdateNetworkPayloadgetDhcpRetType) { setPartialUpdateNetworkPayloadgetDhcpAttributeType(&o.Dhcp, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetIpv4() (res PartialUpdateNetworkPayloadGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -223,22 +279,26 @@ func (o *PartialUpdateNetworkPayload) GetIpv4() (res PartialUpdateNetworkPayload // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetIpv4Ok() (ret PartialUpdateNetworkPayloadGetIpv4RetType, ok bool) { return getPartialUpdateNetworkPayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) SetIpv4(v PartialUpdateNetworkPayloadGetIpv4RetType) { setPartialUpdateNetworkPayloadGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetIpv6() (res PartialUpdateNetworkPayloadGetIpv6RetType) { res, _ = o.GetIpv6Ok() return @@ -246,22 +306,26 @@ func (o *PartialUpdateNetworkPayload) GetIpv6() (res PartialUpdateNetworkPayload // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetIpv6Ok() (ret PartialUpdateNetworkPayloadGetIpv6RetType, ok bool) { return getPartialUpdateNetworkPayloadGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) HasIpv6() bool { _, ok := o.GetIpv6Ok() return ok } // SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) SetIpv6(v PartialUpdateNetworkPayloadGetIpv6RetType) { setPartialUpdateNetworkPayloadGetIpv6AttributeType(&o.Ipv6, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetLabels() (res PartialUpdateNetworkPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -269,22 +333,26 @@ func (o *PartialUpdateNetworkPayload) GetLabels() (res PartialUpdateNetworkPaylo // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetLabelsOk() (ret PartialUpdateNetworkPayloadGetLabelsRetType, ok bool) { return getPartialUpdateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) SetLabels(v PartialUpdateNetworkPayloadGetLabelsRetType) { setPartialUpdateNetworkPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetName() (res PartialUpdateNetworkPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -292,22 +360,26 @@ func (o *PartialUpdateNetworkPayload) GetName() (res PartialUpdateNetworkPayload // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetNameOk() (ret PartialUpdateNetworkPayloadGetNameRetType, ok bool) { return getPartialUpdateNetworkPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) SetName(v PartialUpdateNetworkPayloadGetNameRetType) { setPartialUpdateNetworkPayloadGetNameAttributeType(&o.Name, v) } // GetRouted returns the Routed field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetRouted() (res PartialUpdateNetworkPayloadgetRoutedRetType) { res, _ = o.GetRoutedOk() return @@ -315,22 +387,26 @@ func (o *PartialUpdateNetworkPayload) GetRouted() (res PartialUpdateNetworkPaylo // GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetRoutedOk() (ret PartialUpdateNetworkPayloadgetRoutedRetType, ok bool) { return getPartialUpdateNetworkPayloadgetRoutedAttributeTypeOk(o.Routed) } // HasRouted returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) HasRouted() bool { _, ok := o.GetRoutedOk() return ok } // SetRouted gets a reference to the given bool and assigns it to the Routed field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) SetRouted(v PartialUpdateNetworkPayloadgetRoutedRetType) { setPartialUpdateNetworkPayloadgetRoutedAttributeType(&o.Routed, v) } // GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetRoutingTableId() (res PartialUpdateNetworkPayloadGetRoutingTableIdRetType) { res, _ = o.GetRoutingTableIdOk() return @@ -338,21 +414,25 @@ func (o *PartialUpdateNetworkPayload) GetRoutingTableId() (res PartialUpdateNetw // GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) GetRoutingTableIdOk() (ret PartialUpdateNetworkPayloadGetRoutingTableIdRetType, ok bool) { return getPartialUpdateNetworkPayloadGetRoutingTableIdAttributeTypeOk(o.RoutingTableId) } // HasRoutingTableId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) HasRoutingTableId() bool { _, ok := o.GetRoutingTableIdOk() return ok } // SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PartialUpdateNetworkPayload) SetRoutingTableId(v PartialUpdateNetworkPayloadGetRoutingTableIdRetType) { setPartialUpdateNetworkPayloadGetRoutingTableIdAttributeType(&o.RoutingTableId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp); ok { @@ -379,37 +459,45 @@ func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePartialUpdateNetworkPayload struct { value *PartialUpdateNetworkPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateNetworkPayload) Get() *PartialUpdateNetworkPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateNetworkPayload) Set(val *PartialUpdateNetworkPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateNetworkPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateNetworkPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePartialUpdateNetworkPayload(val *PartialUpdateNetworkPayload) *NullablePartialUpdateNetworkPayload { return &NullablePartialUpdateNetworkPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePartialUpdateNetworkPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_port_range.go b/services/iaas/model_port_range.go index c01000e6a..d3f3b8a94 100644 --- a/services/iaas/model_port_range.go +++ b/services/iaas/model_port_range.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PortRange{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PortRangeGetMaxAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PortRangeGetMaxArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PortRangeGetMaxRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPortRangeGetMaxAttributeTypeOk(arg PortRangeGetMaxAttributeType) (ret PortRangeGetMaxRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getPortRangeGetMaxAttributeTypeOk(arg PortRangeGetMaxAttributeType) (ret Po return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPortRangeGetMaxAttributeType(arg *PortRangeGetMaxAttributeType, val PortRangeGetMaxRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setPortRangeGetMaxAttributeType(arg *PortRangeGetMaxAttributeType, val Port */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PortRangeGetMinAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PortRangeGetMinArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PortRangeGetMinRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPortRangeGetMinAttributeTypeOk(arg PortRangeGetMinAttributeType) (ret PortRangeGetMinRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getPortRangeGetMinAttributeTypeOk(arg PortRangeGetMinAttributeType) (ret Po return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPortRangeGetMinAttributeType(arg *PortRangeGetMinAttributeType, val PortRangeGetMinRetType) { *arg = &val } // PortRange Object that represents a range of ports. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PortRange struct { // The maximum port number. Should be greater or equal to the minimum. // REQUIRED @@ -67,12 +83,14 @@ type PortRange struct { Min PortRangeGetMinAttributeType `json:"min" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PortRange PortRange // NewPortRange instantiates a new PortRange object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPortRange(max PortRangeGetMaxArgType, min PortRangeGetMinArgType) *PortRange { this := PortRange{} setPortRangeGetMaxAttributeType(&this.Max, max) @@ -83,12 +101,14 @@ func NewPortRange(max PortRangeGetMaxArgType, min PortRangeGetMinArgType) *PortR // NewPortRangeWithDefaults instantiates a new PortRange object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPortRangeWithDefaults() *PortRange { this := PortRange{} return &this } // GetMax returns the Max field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PortRange) GetMax() (ret PortRangeGetMaxRetType) { ret, _ = o.GetMaxOk() return ret @@ -96,16 +116,19 @@ func (o *PortRange) GetMax() (ret PortRangeGetMaxRetType) { // GetMaxOk returns a tuple with the Max field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PortRange) GetMaxOk() (ret PortRangeGetMaxRetType, ok bool) { return getPortRangeGetMaxAttributeTypeOk(o.Max) } // SetMax sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PortRange) SetMax(v PortRangeGetMaxRetType) { setPortRangeGetMaxAttributeType(&o.Max, v) } // GetMin returns the Min field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PortRange) GetMin() (ret PortRangeGetMinRetType) { ret, _ = o.GetMinOk() return ret @@ -113,15 +136,18 @@ func (o *PortRange) GetMin() (ret PortRangeGetMinRetType) { // GetMinOk returns a tuple with the Min field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PortRange) GetMinOk() (ret PortRangeGetMinRetType, ok bool) { return getPortRangeGetMinAttributeTypeOk(o.Min) } // SetMin sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PortRange) SetMin(v PortRangeGetMinRetType) { setPortRangeGetMinAttributeType(&o.Min, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PortRange) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPortRangeGetMaxAttributeTypeOk(o.Max); ok { @@ -133,37 +159,45 @@ func (o PortRange) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePortRange struct { value *PortRange isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePortRange) Get() *PortRange { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePortRange) Set(val *PortRange) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePortRange) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePortRange) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePortRange(val *PortRange) *NullablePortRange { return &NullablePortRange{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePortRange) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePortRange) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_project.go b/services/iaas/model_project.go index 216a17742..dbf141ace 100644 --- a/services/iaas/model_project.go +++ b/services/iaas/model_project.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &Project{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetAreaIdAttributeType = *AreaId + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetAreaIdArgType = AreaId + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetAreaIdRetType = AreaId +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProjectGetAreaIdAttributeTypeOk(arg ProjectGetAreaIdAttributeType) (ret ProjectGetAreaIdRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getProjectGetAreaIdAttributeTypeOk(arg ProjectGetAreaIdAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProjectGetAreaIdAttributeType(arg *ProjectGetAreaIdAttributeType, val ProjectGetAreaIdRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setProjectGetAreaIdAttributeType(arg *ProjectGetAreaIdAttributeType, val Pr */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProjectGetCreatedAtAttributeTypeOk(arg ProjectGetCreatedAtAttributeType) (ret ProjectGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getProjectGetCreatedAtAttributeTypeOk(arg ProjectGetCreatedAtAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProjectGetCreatedAtAttributeType(arg *ProjectGetCreatedAtAttributeType, val ProjectGetCreatedAtRetType) { *arg = &val } @@ -63,8 +78,10 @@ func setProjectGetCreatedAtAttributeType(arg *ProjectGetCreatedAtAttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProjectGetIdAttributeTypeOk(arg ProjectGetIdAttributeType) (ret ProjectGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +89,15 @@ func getProjectGetIdAttributeTypeOk(arg ProjectGetIdAttributeType) (ret ProjectG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProjectGetIdAttributeType(arg *ProjectGetIdAttributeType, val ProjectGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetIdRetType = string /* @@ -84,10 +105,16 @@ type ProjectGetIdRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectgetInternetAccessAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectgetInternetAccessArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectgetInternetAccessRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProjectgetInternetAccessAttributeTypeOk(arg ProjectgetInternetAccessAttributeType) (ret ProjectgetInternetAccessRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +122,7 @@ func getProjectgetInternetAccessAttributeTypeOk(arg ProjectgetInternetAccessAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProjectgetInternetAccessAttributeType(arg *ProjectgetInternetAccessAttributeType, val ProjectgetInternetAccessRetType) { *arg = &val } @@ -104,8 +132,10 @@ func setProjectgetInternetAccessAttributeType(arg *ProjectgetInternetAccessAttri */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProjectGetStatusAttributeTypeOk(arg ProjectGetStatusAttributeType) (ret ProjectGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +143,15 @@ func getProjectGetStatusAttributeTypeOk(arg ProjectGetStatusAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProjectGetStatusAttributeType(arg *ProjectGetStatusAttributeType, val ProjectGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetStatusRetType = string /* @@ -125,10 +159,16 @@ type ProjectGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProjectGetUpdatedAtAttributeTypeOk(arg ProjectGetUpdatedAtAttributeType) (ret ProjectGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -136,11 +176,13 @@ func getProjectGetUpdatedAtAttributeTypeOk(arg ProjectGetUpdatedAtAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProjectGetUpdatedAtAttributeType(arg *ProjectGetUpdatedAtAttributeType, val ProjectGetUpdatedAtRetType) { *arg = &val } // Project Object that represents a STACKIT project. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Project struct { // REQUIRED AreaId ProjectGetAreaIdAttributeType `json:"areaId" required:"true"` @@ -157,12 +199,14 @@ type Project struct { UpdatedAt ProjectGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Project Project // NewProject instantiates a new Project object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewProject(areaId ProjectGetAreaIdArgType, id ProjectGetIdArgType, status ProjectGetStatusArgType) *Project { this := Project{} setProjectGetAreaIdAttributeType(&this.AreaId, areaId) @@ -174,12 +218,14 @@ func NewProject(areaId ProjectGetAreaIdArgType, id ProjectGetIdArgType, status P // NewProjectWithDefaults instantiates a new Project object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewProjectWithDefaults() *Project { this := Project{} return &this } // GetAreaId returns the AreaId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetAreaId() (ret ProjectGetAreaIdRetType) { ret, _ = o.GetAreaIdOk() return ret @@ -187,16 +233,19 @@ func (o *Project) GetAreaId() (ret ProjectGetAreaIdRetType) { // GetAreaIdOk returns a tuple with the AreaId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetAreaIdOk() (ret ProjectGetAreaIdRetType, ok bool) { return getProjectGetAreaIdAttributeTypeOk(o.AreaId) } // SetAreaId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) SetAreaId(v ProjectGetAreaIdRetType) { setProjectGetAreaIdAttributeType(&o.AreaId, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetCreatedAt() (res ProjectGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -204,22 +253,26 @@ func (o *Project) GetCreatedAt() (res ProjectGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetCreatedAtOk() (ret ProjectGetCreatedAtRetType, ok bool) { return getProjectGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) SetCreatedAt(v ProjectGetCreatedAtRetType) { setProjectGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetId() (ret ProjectGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -227,16 +280,19 @@ func (o *Project) GetId() (ret ProjectGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetIdOk() (ret ProjectGetIdRetType, ok bool) { return getProjectGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) SetId(v ProjectGetIdRetType) { setProjectGetIdAttributeType(&o.Id, v) } // GetInternetAccess returns the InternetAccess field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetInternetAccess() (res ProjectgetInternetAccessRetType) { res, _ = o.GetInternetAccessOk() return @@ -244,22 +300,26 @@ func (o *Project) GetInternetAccess() (res ProjectgetInternetAccessRetType) { // GetInternetAccessOk returns a tuple with the InternetAccess field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetInternetAccessOk() (ret ProjectgetInternetAccessRetType, ok bool) { return getProjectgetInternetAccessAttributeTypeOk(o.InternetAccess) } // HasInternetAccess returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) HasInternetAccess() bool { _, ok := o.GetInternetAccessOk() return ok } // SetInternetAccess gets a reference to the given bool and assigns it to the InternetAccess field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) SetInternetAccess(v ProjectgetInternetAccessRetType) { setProjectgetInternetAccessAttributeType(&o.InternetAccess, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetStatus() (ret ProjectGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -267,16 +327,19 @@ func (o *Project) GetStatus() (ret ProjectGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetStatusOk() (ret ProjectGetStatusRetType, ok bool) { return getProjectGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) SetStatus(v ProjectGetStatusRetType) { setProjectGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetUpdatedAt() (res ProjectGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -284,21 +347,25 @@ func (o *Project) GetUpdatedAt() (res ProjectGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) GetUpdatedAtOk() (ret ProjectGetUpdatedAtRetType, ok bool) { return getProjectGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Project) SetUpdatedAt(v ProjectGetUpdatedAtRetType) { setProjectGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Project) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getProjectGetAreaIdAttributeTypeOk(o.AreaId); ok { @@ -322,37 +389,45 @@ func (o Project) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableProject struct { value *Project isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProject) Get() *Project { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProject) Set(val *Project) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProject) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProject) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableProject(val *Project) *NullableProject { return &NullableProject{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProject) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProject) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_project_list_response.go b/services/iaas/model_project_list_response.go index 4de8d5c93..bcac36997 100644 --- a/services/iaas/model_project_list_response.go +++ b/services/iaas/model_project_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ProjectListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectListResponseGetItemsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectListResponseGetItemsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectListResponseGetItemsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProjectListResponseGetItemsAttributeTypeOk(arg ProjectListResponseGetItemsAttributeType) (ret ProjectListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getProjectListResponseGetItemsAttributeTypeOk(arg ProjectListResponseGetIte return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProjectListResponseGetItemsAttributeType(arg *ProjectListResponseGetItemsAttributeType, val ProjectListResponseGetItemsRetType) { *arg = &val } // ProjectListResponse Project list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProjectListResponse struct { // A list of STACKIT projects. // REQUIRED Items ProjectListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ProjectListResponse ProjectListResponse // NewProjectListResponse instantiates a new ProjectListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewProjectListResponse(items ProjectListResponseGetItemsArgType) *ProjectListResponse { this := ProjectListResponse{} setProjectListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewProjectListResponse(items ProjectListResponseGetItemsArgType) *ProjectLi // NewProjectListResponseWithDefaults instantiates a new ProjectListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewProjectListResponseWithDefaults() *ProjectListResponse { this := ProjectListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ProjectListResponse) GetItems() (ret ProjectListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *ProjectListResponse) GetItems() (ret ProjectListResponseGetItemsRetType // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ProjectListResponse) GetItemsOk() (ret ProjectListResponseGetItemsRetType, ok bool) { return getProjectListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ProjectListResponse) SetItems(v ProjectListResponseGetItemsRetType) { setProjectListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ProjectListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getProjectListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o ProjectListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableProjectListResponse struct { value *ProjectListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProjectListResponse) Get() *ProjectListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProjectListResponse) Set(val *ProjectListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProjectListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProjectListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableProjectListResponse(val *ProjectListResponse) *NullableProjectListResponse { return &NullableProjectListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProjectListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProjectListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_protocol.go b/services/iaas/model_protocol.go index 5dff069fc..9aa2574be 100644 --- a/services/iaas/model_protocol.go +++ b/services/iaas/model_protocol.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &Protocol{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProtocolGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProtocolGetNameAttributeTypeOk(arg ProtocolGetNameAttributeType) (ret ProtocolGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getProtocolGetNameAttributeTypeOk(arg ProtocolGetNameAttributeType) (ret Pr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProtocolGetNameAttributeType(arg *ProtocolGetNameAttributeType, val ProtocolGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProtocolGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProtocolGetNameRetType = string /* @@ -43,10 +50,16 @@ type ProtocolGetNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProtocolGetNumberAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProtocolGetNumberArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ProtocolGetNumberRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getProtocolGetNumberAttributeTypeOk(arg ProtocolGetNumberAttributeType) (ret ProtocolGetNumberRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getProtocolGetNumberAttributeTypeOk(arg ProtocolGetNumberAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setProtocolGetNumberAttributeType(arg *ProtocolGetNumberAttributeType, val ProtocolGetNumberRetType) { *arg = &val } // Protocol The schema for a protocol of a security group rule. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Protocol struct { // The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`. Name ProtocolGetNameAttributeType `json:"name,omitempty"` @@ -70,6 +85,7 @@ type Protocol struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewProtocol() *Protocol { this := Protocol{} return &this @@ -78,12 +94,14 @@ func NewProtocol() *Protocol { // NewProtocolWithDefaults instantiates a new Protocol object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewProtocolWithDefaults() *Protocol { this := Protocol{} return &this } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Protocol) GetName() (res ProtocolGetNameRetType) { res, _ = o.GetNameOk() return @@ -91,22 +109,26 @@ func (o *Protocol) GetName() (res ProtocolGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Protocol) GetNameOk() (ret ProtocolGetNameRetType, ok bool) { return getProtocolGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Protocol) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Protocol) SetName(v ProtocolGetNameRetType) { setProtocolGetNameAttributeType(&o.Name, v) } // GetNumber returns the Number field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Protocol) GetNumber() (res ProtocolGetNumberRetType) { res, _ = o.GetNumberOk() return @@ -114,21 +136,25 @@ func (o *Protocol) GetNumber() (res ProtocolGetNumberRetType) { // GetNumberOk returns a tuple with the Number field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Protocol) GetNumberOk() (ret ProtocolGetNumberRetType, ok bool) { return getProtocolGetNumberAttributeTypeOk(o.Number) } // HasNumber returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Protocol) HasNumber() bool { _, ok := o.GetNumberOk() return ok } // SetNumber gets a reference to the given int64 and assigns it to the Number field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Protocol) SetNumber(v ProtocolGetNumberRetType) { setProtocolGetNumberAttributeType(&o.Number, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Protocol) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getProtocolGetNameAttributeTypeOk(o.Name); ok { @@ -140,37 +166,45 @@ func (o Protocol) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableProtocol struct { value *Protocol isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProtocol) Get() *Protocol { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProtocol) Set(val *Protocol) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProtocol) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProtocol) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableProtocol(val *Protocol) *NullableProtocol { return &NullableProtocol{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableProtocol) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableProtocol) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_public_ip.go b/services/iaas/model_public_ip.go index 5a1e7c20b..0f40f84f7 100644 --- a/services/iaas/model_public_ip.go +++ b/services/iaas/model_public_ip.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &PublicIp{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPublicIpGetIdAttributeTypeOk(arg PublicIpGetIdAttributeType) (ret PublicIpGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getPublicIpGetIdAttributeTypeOk(arg PublicIpGetIdAttributeType) (ret Public return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPublicIpGetIdAttributeType(arg *PublicIpGetIdAttributeType, val PublicIpGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetIdRetType = string /* @@ -43,8 +50,10 @@ type PublicIpGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetIpAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPublicIpGetIpAttributeTypeOk(arg PublicIpGetIpAttributeType) (ret PublicIpGetIpRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getPublicIpGetIpAttributeTypeOk(arg PublicIpGetIpAttributeType) (ret Public return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPublicIpGetIpAttributeType(arg *PublicIpGetIpAttributeType, val PublicIpGetIpRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetIpArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetIpRetType = string /* @@ -64,10 +77,16 @@ type PublicIpGetIpRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPublicIpGetLabelsAttributeTypeOk(arg PublicIpGetLabelsAttributeType) (ret PublicIpGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +94,7 @@ func getPublicIpGetLabelsAttributeTypeOk(arg PublicIpGetLabelsAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPublicIpGetLabelsAttributeType(arg *PublicIpGetLabelsAttributeType, val PublicIpGetLabelsRetType) { *arg = &val } @@ -84,8 +104,10 @@ func setPublicIpGetLabelsAttributeType(arg *PublicIpGetLabelsAttributeType, val */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetNetworkInterfaceAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPublicIpGetNetworkInterfaceAttributeTypeOk(arg PublicIpGetNetworkInterfaceAttributeType) (ret PublicIpGetNetworkInterfaceRetType, ok bool) { if arg == nil { return nil, false @@ -93,6 +115,7 @@ func getPublicIpGetNetworkInterfaceAttributeTypeOk(arg PublicIpGetNetworkInterfa return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPublicIpGetNetworkInterfaceAttributeType(arg *PublicIpGetNetworkInterfaceAttributeType, val PublicIpGetNetworkInterfaceRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -101,16 +124,20 @@ func setPublicIpGetNetworkInterfaceAttributeType(arg *PublicIpGetNetworkInterfac } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetNetworkInterfaceArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpGetNetworkInterfaceRetType = *string // PublicIp Object that represents a public IP. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIp struct { // Universally Unique Identifier (UUID). Id PublicIpGetIdAttributeType `json:"id,omitempty"` // String that represents an IPv4 address. Ip PublicIpGetIpAttributeType `json:"ip,omitempty"` - // 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. + // 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. Labels PublicIpGetLabelsAttributeType `json:"labels,omitempty"` // Universally Unique Identifier (UUID). NetworkInterface PublicIpGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` @@ -120,6 +147,7 @@ type PublicIp struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPublicIp() *PublicIp { this := PublicIp{} return &this @@ -128,12 +156,14 @@ func NewPublicIp() *PublicIp { // NewPublicIpWithDefaults instantiates a new PublicIp object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPublicIpWithDefaults() *PublicIp { this := PublicIp{} return &this } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) GetId() (res PublicIpGetIdRetType) { res, _ = o.GetIdOk() return @@ -141,22 +171,26 @@ func (o *PublicIp) GetId() (res PublicIpGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) GetIdOk() (ret PublicIpGetIdRetType, ok bool) { return getPublicIpGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) SetId(v PublicIpGetIdRetType) { setPublicIpGetIdAttributeType(&o.Id, v) } // GetIp returns the Ip field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) GetIp() (res PublicIpGetIpRetType) { res, _ = o.GetIpOk() return @@ -164,22 +198,26 @@ func (o *PublicIp) GetIp() (res PublicIpGetIpRetType) { // GetIpOk returns a tuple with the Ip field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) GetIpOk() (ret PublicIpGetIpRetType, ok bool) { return getPublicIpGetIpAttributeTypeOk(o.Ip) } // HasIp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) HasIp() bool { _, ok := o.GetIpOk() return ok } // SetIp gets a reference to the given string and assigns it to the Ip field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) SetIp(v PublicIpGetIpRetType) { setPublicIpGetIpAttributeType(&o.Ip, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) GetLabels() (res PublicIpGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -187,22 +225,26 @@ func (o *PublicIp) GetLabels() (res PublicIpGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) GetLabelsOk() (ret PublicIpGetLabelsRetType, ok bool) { return getPublicIpGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) SetLabels(v PublicIpGetLabelsRetType) { setPublicIpGetLabelsAttributeType(&o.Labels, v) } // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) GetNetworkInterface() (res PublicIpGetNetworkInterfaceRetType) { res, _ = o.GetNetworkInterfaceOk() return @@ -211,31 +253,37 @@ func (o *PublicIp) GetNetworkInterface() (res PublicIpGetNetworkInterfaceRetType // GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) GetNetworkInterfaceOk() (ret PublicIpGetNetworkInterfaceRetType, ok bool) { return getPublicIpGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) } // HasNetworkInterface returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) HasNetworkInterface() bool { _, ok := o.GetNetworkInterfaceOk() return ok } // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) SetNetworkInterface(v PublicIpGetNetworkInterfaceRetType) { setPublicIpGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) SetNetworkInterfaceNil() { o.NetworkInterface = nil } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIp) UnsetNetworkInterface() { o.NetworkInterface = nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PublicIp) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPublicIpGetIdAttributeTypeOk(o.Id); ok { @@ -253,37 +301,45 @@ func (o PublicIp) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePublicIp struct { value *PublicIp isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicIp) Get() *PublicIp { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicIp) Set(val *PublicIp) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicIp) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicIp) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePublicIp(val *PublicIp) *NullablePublicIp { return &NullablePublicIp{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicIp) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicIp) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_public_ip_list_response.go b/services/iaas/model_public_ip_list_response.go index c3c33bd32..5a00d6f0a 100644 --- a/services/iaas/model_public_ip_list_response.go +++ b/services/iaas/model_public_ip_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PublicIpListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpListResponseGetItemsAttributeType = *[]PublicIp + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpListResponseGetItemsArgType = []PublicIp + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpListResponseGetItemsRetType = []PublicIp +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPublicIpListResponseGetItemsAttributeTypeOk(arg PublicIpListResponseGetItemsAttributeType) (ret PublicIpListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getPublicIpListResponseGetItemsAttributeTypeOk(arg PublicIpListResponseGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPublicIpListResponseGetItemsAttributeType(arg *PublicIpListResponseGetItemsAttributeType, val PublicIpListResponseGetItemsRetType) { *arg = &val } // PublicIpListResponse Public IP list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicIpListResponse struct { // A list of public IPs. // REQUIRED Items PublicIpListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PublicIpListResponse PublicIpListResponse // NewPublicIpListResponse instantiates a new PublicIpListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPublicIpListResponse(items PublicIpListResponseGetItemsArgType) *PublicIpListResponse { this := PublicIpListResponse{} setPublicIpListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewPublicIpListResponse(items PublicIpListResponseGetItemsArgType) *PublicI // NewPublicIpListResponseWithDefaults instantiates a new PublicIpListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPublicIpListResponseWithDefaults() *PublicIpListResponse { this := PublicIpListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIpListResponse) GetItems() (ret PublicIpListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *PublicIpListResponse) GetItems() (ret PublicIpListResponseGetItemsRetTy // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIpListResponse) GetItemsOk() (ret PublicIpListResponseGetItemsRetType, ok bool) { return getPublicIpListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicIpListResponse) SetItems(v PublicIpListResponseGetItemsRetType) { setPublicIpListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PublicIpListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPublicIpListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o PublicIpListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePublicIpListResponse struct { value *PublicIpListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicIpListResponse) Get() *PublicIpListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicIpListResponse) Set(val *PublicIpListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicIpListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicIpListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePublicIpListResponse(val *PublicIpListResponse) *NullablePublicIpListResponse { return &NullablePublicIpListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicIpListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicIpListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_public_network.go b/services/iaas/model_public_network.go index 4dc0854e4..1ca2be057 100644 --- a/services/iaas/model_public_network.go +++ b/services/iaas/model_public_network.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &PublicNetwork{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkGetCidrAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPublicNetworkGetCidrAttributeTypeOk(arg PublicNetworkGetCidrAttributeType) (ret PublicNetworkGetCidrRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getPublicNetworkGetCidrAttributeTypeOk(arg PublicNetworkGetCidrAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPublicNetworkGetCidrAttributeType(arg *PublicNetworkGetCidrAttributeType, val PublicNetworkGetCidrRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkGetCidrArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkGetCidrRetType = string /* @@ -43,8 +50,10 @@ type PublicNetworkGetCidrRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkGetRegionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPublicNetworkGetRegionAttributeTypeOk(arg PublicNetworkGetRegionAttributeType) (ret PublicNetworkGetRegionRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getPublicNetworkGetRegionAttributeTypeOk(arg PublicNetworkGetRegionAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPublicNetworkGetRegionAttributeType(arg *PublicNetworkGetRegionAttributeType, val PublicNetworkGetRegionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkGetRegionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkGetRegionRetType = string // PublicNetwork Public network. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetwork struct { // Classless Inter-Domain Routing (CIDR). // REQUIRED @@ -69,12 +83,14 @@ type PublicNetwork struct { Region PublicNetworkGetRegionAttributeType `json:"region" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PublicNetwork PublicNetwork // NewPublicNetwork instantiates a new PublicNetwork object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPublicNetwork(cidr PublicNetworkGetCidrArgType, region PublicNetworkGetRegionArgType) *PublicNetwork { this := PublicNetwork{} setPublicNetworkGetCidrAttributeType(&this.Cidr, cidr) @@ -85,12 +101,14 @@ func NewPublicNetwork(cidr PublicNetworkGetCidrArgType, region PublicNetworkGetR // NewPublicNetworkWithDefaults instantiates a new PublicNetwork object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPublicNetworkWithDefaults() *PublicNetwork { this := PublicNetwork{} return &this } // GetCidr returns the Cidr field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetwork) GetCidr() (ret PublicNetworkGetCidrRetType) { ret, _ = o.GetCidrOk() return ret @@ -98,16 +116,19 @@ func (o *PublicNetwork) GetCidr() (ret PublicNetworkGetCidrRetType) { // GetCidrOk returns a tuple with the Cidr field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetwork) GetCidrOk() (ret PublicNetworkGetCidrRetType, ok bool) { return getPublicNetworkGetCidrAttributeTypeOk(o.Cidr) } // SetCidr sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetwork) SetCidr(v PublicNetworkGetCidrRetType) { setPublicNetworkGetCidrAttributeType(&o.Cidr, v) } // GetRegion returns the Region field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetwork) GetRegion() (ret PublicNetworkGetRegionRetType) { ret, _ = o.GetRegionOk() return ret @@ -115,15 +136,18 @@ func (o *PublicNetwork) GetRegion() (ret PublicNetworkGetRegionRetType) { // GetRegionOk returns a tuple with the Region field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetwork) GetRegionOk() (ret PublicNetworkGetRegionRetType, ok bool) { return getPublicNetworkGetRegionAttributeTypeOk(o.Region) } // SetRegion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetwork) SetRegion(v PublicNetworkGetRegionRetType) { setPublicNetworkGetRegionAttributeType(&o.Region, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PublicNetwork) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPublicNetworkGetCidrAttributeTypeOk(o.Cidr); ok { @@ -135,37 +159,45 @@ func (o PublicNetwork) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePublicNetwork struct { value *PublicNetwork isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicNetwork) Get() *PublicNetwork { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicNetwork) Set(val *PublicNetwork) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicNetwork) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicNetwork) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePublicNetwork(val *PublicNetwork) *NullablePublicNetwork { return &NullablePublicNetwork{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicNetwork) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicNetwork) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_public_network_list_response.go b/services/iaas/model_public_network_list_response.go index 9135187ed..557fb7917 100644 --- a/services/iaas/model_public_network_list_response.go +++ b/services/iaas/model_public_network_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PublicNetworkListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkListResponseGetItemsAttributeType = *[]PublicNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkListResponseGetItemsArgType = []PublicNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkListResponseGetItemsRetType = []PublicNetwork +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPublicNetworkListResponseGetItemsAttributeTypeOk(arg PublicNetworkListResponseGetItemsAttributeType) (ret PublicNetworkListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getPublicNetworkListResponseGetItemsAttributeTypeOk(arg PublicNetworkListRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPublicNetworkListResponseGetItemsAttributeType(arg *PublicNetworkListResponseGetItemsAttributeType, val PublicNetworkListResponseGetItemsRetType) { *arg = &val } // PublicNetworkListResponse Public network list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PublicNetworkListResponse struct { // A list of public networks. // REQUIRED Items PublicNetworkListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PublicNetworkListResponse PublicNetworkListResponse // NewPublicNetworkListResponse instantiates a new PublicNetworkListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPublicNetworkListResponse(items PublicNetworkListResponseGetItemsArgType) *PublicNetworkListResponse { this := PublicNetworkListResponse{} setPublicNetworkListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewPublicNetworkListResponse(items PublicNetworkListResponseGetItemsArgType // NewPublicNetworkListResponseWithDefaults instantiates a new PublicNetworkListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewPublicNetworkListResponseWithDefaults() *PublicNetworkListResponse { this := PublicNetworkListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetworkListResponse) GetItems() (ret PublicNetworkListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *PublicNetworkListResponse) GetItems() (ret PublicNetworkListResponseGet // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetworkListResponse) GetItemsOk() (ret PublicNetworkListResponseGetItemsRetType, ok bool) { return getPublicNetworkListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PublicNetworkListResponse) SetItems(v PublicNetworkListResponseGetItemsRetType) { setPublicNetworkListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PublicNetworkListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPublicNetworkListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o PublicNetworkListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePublicNetworkListResponse struct { value *PublicNetworkListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicNetworkListResponse) Get() *PublicNetworkListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicNetworkListResponse) Set(val *PublicNetworkListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicNetworkListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicNetworkListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullablePublicNetworkListResponse(val *PublicNetworkListResponse) *NullablePublicNetworkListResponse { return &NullablePublicNetworkListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePublicNetworkListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePublicNetworkListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota.go b/services/iaas/model_quota.go index 01101100b..cd62d2b03 100644 --- a/services/iaas/model_quota.go +++ b/services/iaas/model_quota.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &Quota{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaGetLimitAttributeTypeOk(arg QuotaGetLimitAttributeType) (ret QuotaGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaGetLimitAttributeTypeOk(arg QuotaGetLimitAttributeType) (ret QuotaG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaGetLimitAttributeType(arg *QuotaGetLimitAttributeType, val QuotaGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaGetLimitAttributeType(arg *QuotaGetLimitAttributeType, val QuotaGet */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaGetUsageAttributeTypeOk(arg QuotaGetUsageAttributeType) (ret QuotaGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaGetUsageAttributeTypeOk(arg QuotaGetUsageAttributeType) (ret QuotaG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaGetUsageAttributeType(arg *QuotaGetUsageAttributeType, val QuotaGetUsageRetType) { *arg = &val } // Quota Object that represents a single resource quota. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Quota struct { // REQUIRED Limit QuotaGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type Quota struct { Usage QuotaGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Quota Quota // NewQuota instantiates a new Quota object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuota(limit QuotaGetLimitArgType, usage QuotaGetUsageArgType) *Quota { this := Quota{} setQuotaGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuota(limit QuotaGetLimitArgType, usage QuotaGetUsageArgType) *Quota { // NewQuotaWithDefaults instantiates a new Quota object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaWithDefaults() *Quota { this := Quota{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Quota) GetLimit() (ret QuotaGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *Quota) GetLimit() (ret QuotaGetLimitRetType) { // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Quota) GetLimitOk() (ret QuotaGetLimitRetType, ok bool) { return getQuotaGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Quota) SetLimit(v QuotaGetLimitRetType) { setQuotaGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Quota) GetUsage() (ret QuotaGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *Quota) GetUsage() (ret QuotaGetUsageRetType) { // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Quota) GetUsageOk() (ret QuotaGetUsageRetType, ok bool) { return getQuotaGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Quota) SetUsage(v QuotaGetUsageRetType) { setQuotaGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Quota) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o Quota) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuota struct { value *Quota isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuota) Get() *Quota { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuota) Set(val *Quota) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuota) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuota) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuota(val *Quota) *NullableQuota { return &NullableQuota{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuota) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuota) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list.go b/services/iaas/model_quota_list.go index eb0f7c1e0..55bb1c5e1 100644 --- a/services/iaas/model_quota_list.go +++ b/services/iaas/model_quota_list.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaList{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetBackupGigabytesAttributeType = *QuotaListBackupGigabytes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetBackupGigabytesArgType = QuotaListBackupGigabytes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetBackupGigabytesRetType = QuotaListBackupGigabytes +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetBackupGigabytesAttributeTypeOk(arg QuotaListGetBackupGigabytesAttributeType) (ret QuotaListGetBackupGigabytesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListGetBackupGigabytesAttributeTypeOk(arg QuotaListGetBackupGigabyt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetBackupGigabytesAttributeType(arg *QuotaListGetBackupGigabytesAttributeType, val QuotaListGetBackupGigabytesRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListGetBackupGigabytesAttributeType(arg *QuotaListGetBackupGigabyte */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetBackupsAttributeType = *QuotaListBackups + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetBackupsArgType = QuotaListBackups + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetBackupsRetType = QuotaListBackups +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetBackupsAttributeTypeOk(arg QuotaListGetBackupsAttributeType) (ret QuotaListGetBackupsRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getQuotaListGetBackupsAttributeTypeOk(arg QuotaListGetBackupsAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetBackupsAttributeType(arg *QuotaListGetBackupsAttributeType, val QuotaListGetBackupsRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setQuotaListGetBackupsAttributeType(arg *QuotaListGetBackupsAttributeType, */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetGigabytesAttributeType = *QuotaListGigabytes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetGigabytesArgType = QuotaListGigabytes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetGigabytesRetType = QuotaListGigabytes +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetGigabytesAttributeTypeOk(arg QuotaListGetGigabytesAttributeType) (ret QuotaListGetGigabytesRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getQuotaListGetGigabytesAttributeTypeOk(arg QuotaListGetGigabytesAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetGigabytesAttributeType(arg *QuotaListGetGigabytesAttributeType, val QuotaListGetGigabytesRetType) { *arg = &val } @@ -82,10 +104,16 @@ func setQuotaListGetGigabytesAttributeType(arg *QuotaListGetGigabytesAttributeTy */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetNetworksAttributeType = *QuotaListNetworks + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetNetworksArgType = QuotaListNetworks + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetNetworksRetType = QuotaListNetworks +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetNetworksAttributeTypeOk(arg QuotaListGetNetworksAttributeType) (ret QuotaListGetNetworksRetType, ok bool) { if arg == nil { return ret, false @@ -93,6 +121,7 @@ func getQuotaListGetNetworksAttributeTypeOk(arg QuotaListGetNetworksAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetNetworksAttributeType(arg *QuotaListGetNetworksAttributeType, val QuotaListGetNetworksRetType) { *arg = &val } @@ -102,10 +131,16 @@ func setQuotaListGetNetworksAttributeType(arg *QuotaListGetNetworksAttributeType */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetNicsAttributeType = *QuotaListNics + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetNicsArgType = QuotaListNics + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetNicsRetType = QuotaListNics +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetNicsAttributeTypeOk(arg QuotaListGetNicsAttributeType) (ret QuotaListGetNicsRetType, ok bool) { if arg == nil { return ret, false @@ -113,6 +148,7 @@ func getQuotaListGetNicsAttributeTypeOk(arg QuotaListGetNicsAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetNicsAttributeType(arg *QuotaListGetNicsAttributeType, val QuotaListGetNicsRetType) { *arg = &val } @@ -122,10 +158,16 @@ func setQuotaListGetNicsAttributeType(arg *QuotaListGetNicsAttributeType, val Qu */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetPublicIpsAttributeType = *QuotaListPublicIps + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetPublicIpsArgType = QuotaListPublicIps + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetPublicIpsRetType = QuotaListPublicIps +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetPublicIpsAttributeTypeOk(arg QuotaListGetPublicIpsAttributeType) (ret QuotaListGetPublicIpsRetType, ok bool) { if arg == nil { return ret, false @@ -133,6 +175,7 @@ func getQuotaListGetPublicIpsAttributeTypeOk(arg QuotaListGetPublicIpsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetPublicIpsAttributeType(arg *QuotaListGetPublicIpsAttributeType, val QuotaListGetPublicIpsRetType) { *arg = &val } @@ -142,10 +185,16 @@ func setQuotaListGetPublicIpsAttributeType(arg *QuotaListGetPublicIpsAttributeTy */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetRamAttributeType = *QuotaListRam + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetRamArgType = QuotaListRam + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetRamRetType = QuotaListRam +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetRamAttributeTypeOk(arg QuotaListGetRamAttributeType) (ret QuotaListGetRamRetType, ok bool) { if arg == nil { return ret, false @@ -153,6 +202,7 @@ func getQuotaListGetRamAttributeTypeOk(arg QuotaListGetRamAttributeType) (ret Qu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetRamAttributeType(arg *QuotaListGetRamAttributeType, val QuotaListGetRamRetType) { *arg = &val } @@ -162,10 +212,16 @@ func setQuotaListGetRamAttributeType(arg *QuotaListGetRamAttributeType, val Quot */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSecurityGroupRulesAttributeType = *QuotaListSecurityGroupRules + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSecurityGroupRulesArgType = QuotaListSecurityGroupRules + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSecurityGroupRulesRetType = QuotaListSecurityGroupRules +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetSecurityGroupRulesAttributeTypeOk(arg QuotaListGetSecurityGroupRulesAttributeType) (ret QuotaListGetSecurityGroupRulesRetType, ok bool) { if arg == nil { return ret, false @@ -173,6 +229,7 @@ func getQuotaListGetSecurityGroupRulesAttributeTypeOk(arg QuotaListGetSecurityGr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetSecurityGroupRulesAttributeType(arg *QuotaListGetSecurityGroupRulesAttributeType, val QuotaListGetSecurityGroupRulesRetType) { *arg = &val } @@ -182,10 +239,16 @@ func setQuotaListGetSecurityGroupRulesAttributeType(arg *QuotaListGetSecurityGro */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSecurityGroupsAttributeType = *QuotaListSecurityGroups + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSecurityGroupsArgType = QuotaListSecurityGroups + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSecurityGroupsRetType = QuotaListSecurityGroups +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetSecurityGroupsAttributeTypeOk(arg QuotaListGetSecurityGroupsAttributeType) (ret QuotaListGetSecurityGroupsRetType, ok bool) { if arg == nil { return ret, false @@ -193,6 +256,7 @@ func getQuotaListGetSecurityGroupsAttributeTypeOk(arg QuotaListGetSecurityGroups return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetSecurityGroupsAttributeType(arg *QuotaListGetSecurityGroupsAttributeType, val QuotaListGetSecurityGroupsRetType) { *arg = &val } @@ -202,10 +266,16 @@ func setQuotaListGetSecurityGroupsAttributeType(arg *QuotaListGetSecurityGroupsA */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSnapshotsAttributeType = *QuotaListSnapshots + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSnapshotsArgType = QuotaListSnapshots + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetSnapshotsRetType = QuotaListSnapshots +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetSnapshotsAttributeTypeOk(arg QuotaListGetSnapshotsAttributeType) (ret QuotaListGetSnapshotsRetType, ok bool) { if arg == nil { return ret, false @@ -213,6 +283,7 @@ func getQuotaListGetSnapshotsAttributeTypeOk(arg QuotaListGetSnapshotsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetSnapshotsAttributeType(arg *QuotaListGetSnapshotsAttributeType, val QuotaListGetSnapshotsRetType) { *arg = &val } @@ -222,10 +293,16 @@ func setQuotaListGetSnapshotsAttributeType(arg *QuotaListGetSnapshotsAttributeTy */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetVcpuAttributeType = *QuotaListVcpu + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetVcpuArgType = QuotaListVcpu + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetVcpuRetType = QuotaListVcpu +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetVcpuAttributeTypeOk(arg QuotaListGetVcpuAttributeType) (ret QuotaListGetVcpuRetType, ok bool) { if arg == nil { return ret, false @@ -233,6 +310,7 @@ func getQuotaListGetVcpuAttributeTypeOk(arg QuotaListGetVcpuAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetVcpuAttributeType(arg *QuotaListGetVcpuAttributeType, val QuotaListGetVcpuRetType) { *arg = &val } @@ -242,10 +320,16 @@ func setQuotaListGetVcpuAttributeType(arg *QuotaListGetVcpuAttributeType, val Qu */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetVolumesAttributeType = *QuotaListVolumes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetVolumesArgType = QuotaListVolumes + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGetVolumesRetType = QuotaListVolumes +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGetVolumesAttributeTypeOk(arg QuotaListGetVolumesAttributeType) (ret QuotaListGetVolumesRetType, ok bool) { if arg == nil { return ret, false @@ -253,11 +337,13 @@ func getQuotaListGetVolumesAttributeTypeOk(arg QuotaListGetVolumesAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGetVolumesAttributeType(arg *QuotaListGetVolumesAttributeType, val QuotaListGetVolumesRetType) { *arg = &val } // QuotaList Object that represents the quotas for a project. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaList struct { // REQUIRED BackupGigabytes QuotaListGetBackupGigabytesAttributeType `json:"backupGigabytes" required:"true"` @@ -285,12 +371,14 @@ type QuotaList struct { Volumes QuotaListGetVolumesAttributeType `json:"volumes" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaList QuotaList // NewQuotaList instantiates a new QuotaList object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaList(backupGigabytes QuotaListGetBackupGigabytesArgType, backups QuotaListGetBackupsArgType, gigabytes QuotaListGetGigabytesArgType, networks QuotaListGetNetworksArgType, nics QuotaListGetNicsArgType, publicIps QuotaListGetPublicIpsArgType, ram QuotaListGetRamArgType, securityGroupRules QuotaListGetSecurityGroupRulesArgType, securityGroups QuotaListGetSecurityGroupsArgType, snapshots QuotaListGetSnapshotsArgType, vcpu QuotaListGetVcpuArgType, volumes QuotaListGetVolumesArgType) *QuotaList { this := QuotaList{} setQuotaListGetBackupGigabytesAttributeType(&this.BackupGigabytes, backupGigabytes) @@ -311,12 +399,14 @@ func NewQuotaList(backupGigabytes QuotaListGetBackupGigabytesArgType, backups Qu // NewQuotaListWithDefaults instantiates a new QuotaList object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListWithDefaults() *QuotaList { this := QuotaList{} return &this } // GetBackupGigabytes returns the BackupGigabytes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetBackupGigabytes() (ret QuotaListGetBackupGigabytesRetType) { ret, _ = o.GetBackupGigabytesOk() return ret @@ -324,16 +414,19 @@ func (o *QuotaList) GetBackupGigabytes() (ret QuotaListGetBackupGigabytesRetType // GetBackupGigabytesOk returns a tuple with the BackupGigabytes field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetBackupGigabytesOk() (ret QuotaListGetBackupGigabytesRetType, ok bool) { return getQuotaListGetBackupGigabytesAttributeTypeOk(o.BackupGigabytes) } // SetBackupGigabytes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetBackupGigabytes(v QuotaListGetBackupGigabytesRetType) { setQuotaListGetBackupGigabytesAttributeType(&o.BackupGigabytes, v) } // GetBackups returns the Backups field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetBackups() (ret QuotaListGetBackupsRetType) { ret, _ = o.GetBackupsOk() return ret @@ -341,16 +434,19 @@ func (o *QuotaList) GetBackups() (ret QuotaListGetBackupsRetType) { // GetBackupsOk returns a tuple with the Backups field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetBackupsOk() (ret QuotaListGetBackupsRetType, ok bool) { return getQuotaListGetBackupsAttributeTypeOk(o.Backups) } // SetBackups sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetBackups(v QuotaListGetBackupsRetType) { setQuotaListGetBackupsAttributeType(&o.Backups, v) } // GetGigabytes returns the Gigabytes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetGigabytes() (ret QuotaListGetGigabytesRetType) { ret, _ = o.GetGigabytesOk() return ret @@ -358,16 +454,19 @@ func (o *QuotaList) GetGigabytes() (ret QuotaListGetGigabytesRetType) { // GetGigabytesOk returns a tuple with the Gigabytes field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetGigabytesOk() (ret QuotaListGetGigabytesRetType, ok bool) { return getQuotaListGetGigabytesAttributeTypeOk(o.Gigabytes) } // SetGigabytes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetGigabytes(v QuotaListGetGigabytesRetType) { setQuotaListGetGigabytesAttributeType(&o.Gigabytes, v) } // GetNetworks returns the Networks field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetNetworks() (ret QuotaListGetNetworksRetType) { ret, _ = o.GetNetworksOk() return ret @@ -375,16 +474,19 @@ func (o *QuotaList) GetNetworks() (ret QuotaListGetNetworksRetType) { // GetNetworksOk returns a tuple with the Networks field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetNetworksOk() (ret QuotaListGetNetworksRetType, ok bool) { return getQuotaListGetNetworksAttributeTypeOk(o.Networks) } // SetNetworks sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetNetworks(v QuotaListGetNetworksRetType) { setQuotaListGetNetworksAttributeType(&o.Networks, v) } // GetNics returns the Nics field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetNics() (ret QuotaListGetNicsRetType) { ret, _ = o.GetNicsOk() return ret @@ -392,16 +494,19 @@ func (o *QuotaList) GetNics() (ret QuotaListGetNicsRetType) { // GetNicsOk returns a tuple with the Nics field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetNicsOk() (ret QuotaListGetNicsRetType, ok bool) { return getQuotaListGetNicsAttributeTypeOk(o.Nics) } // SetNics sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetNics(v QuotaListGetNicsRetType) { setQuotaListGetNicsAttributeType(&o.Nics, v) } // GetPublicIps returns the PublicIps field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetPublicIps() (ret QuotaListGetPublicIpsRetType) { ret, _ = o.GetPublicIpsOk() return ret @@ -409,16 +514,19 @@ func (o *QuotaList) GetPublicIps() (ret QuotaListGetPublicIpsRetType) { // GetPublicIpsOk returns a tuple with the PublicIps field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetPublicIpsOk() (ret QuotaListGetPublicIpsRetType, ok bool) { return getQuotaListGetPublicIpsAttributeTypeOk(o.PublicIps) } // SetPublicIps sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetPublicIps(v QuotaListGetPublicIpsRetType) { setQuotaListGetPublicIpsAttributeType(&o.PublicIps, v) } // GetRam returns the Ram field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetRam() (ret QuotaListGetRamRetType) { ret, _ = o.GetRamOk() return ret @@ -426,16 +534,19 @@ func (o *QuotaList) GetRam() (ret QuotaListGetRamRetType) { // GetRamOk returns a tuple with the Ram field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetRamOk() (ret QuotaListGetRamRetType, ok bool) { return getQuotaListGetRamAttributeTypeOk(o.Ram) } // SetRam sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetRam(v QuotaListGetRamRetType) { setQuotaListGetRamAttributeType(&o.Ram, v) } // GetSecurityGroupRules returns the SecurityGroupRules field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetSecurityGroupRules() (ret QuotaListGetSecurityGroupRulesRetType) { ret, _ = o.GetSecurityGroupRulesOk() return ret @@ -443,16 +554,19 @@ func (o *QuotaList) GetSecurityGroupRules() (ret QuotaListGetSecurityGroupRulesR // GetSecurityGroupRulesOk returns a tuple with the SecurityGroupRules field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetSecurityGroupRulesOk() (ret QuotaListGetSecurityGroupRulesRetType, ok bool) { return getQuotaListGetSecurityGroupRulesAttributeTypeOk(o.SecurityGroupRules) } // SetSecurityGroupRules sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetSecurityGroupRules(v QuotaListGetSecurityGroupRulesRetType) { setQuotaListGetSecurityGroupRulesAttributeType(&o.SecurityGroupRules, v) } // GetSecurityGroups returns the SecurityGroups field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetSecurityGroups() (ret QuotaListGetSecurityGroupsRetType) { ret, _ = o.GetSecurityGroupsOk() return ret @@ -460,16 +574,19 @@ func (o *QuotaList) GetSecurityGroups() (ret QuotaListGetSecurityGroupsRetType) // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetSecurityGroupsOk() (ret QuotaListGetSecurityGroupsRetType, ok bool) { return getQuotaListGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // SetSecurityGroups sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetSecurityGroups(v QuotaListGetSecurityGroupsRetType) { setQuotaListGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetSnapshots returns the Snapshots field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetSnapshots() (ret QuotaListGetSnapshotsRetType) { ret, _ = o.GetSnapshotsOk() return ret @@ -477,16 +594,19 @@ func (o *QuotaList) GetSnapshots() (ret QuotaListGetSnapshotsRetType) { // GetSnapshotsOk returns a tuple with the Snapshots field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetSnapshotsOk() (ret QuotaListGetSnapshotsRetType, ok bool) { return getQuotaListGetSnapshotsAttributeTypeOk(o.Snapshots) } // SetSnapshots sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetSnapshots(v QuotaListGetSnapshotsRetType) { setQuotaListGetSnapshotsAttributeType(&o.Snapshots, v) } // GetVcpu returns the Vcpu field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetVcpu() (ret QuotaListGetVcpuRetType) { ret, _ = o.GetVcpuOk() return ret @@ -494,16 +614,19 @@ func (o *QuotaList) GetVcpu() (ret QuotaListGetVcpuRetType) { // GetVcpuOk returns a tuple with the Vcpu field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetVcpuOk() (ret QuotaListGetVcpuRetType, ok bool) { return getQuotaListGetVcpuAttributeTypeOk(o.Vcpu) } // SetVcpu sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetVcpu(v QuotaListGetVcpuRetType) { setQuotaListGetVcpuAttributeType(&o.Vcpu, v) } // GetVolumes returns the Volumes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetVolumes() (ret QuotaListGetVolumesRetType) { ret, _ = o.GetVolumesOk() return ret @@ -511,15 +634,18 @@ func (o *QuotaList) GetVolumes() (ret QuotaListGetVolumesRetType) { // GetVolumesOk returns a tuple with the Volumes field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) GetVolumesOk() (ret QuotaListGetVolumesRetType, ok bool) { return getQuotaListGetVolumesAttributeTypeOk(o.Volumes) } // SetVolumes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaList) SetVolumes(v QuotaListGetVolumesRetType) { setQuotaListGetVolumesAttributeType(&o.Volumes, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaList) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListGetBackupGigabytesAttributeTypeOk(o.BackupGigabytes); ok { @@ -561,37 +687,45 @@ func (o QuotaList) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaList struct { value *QuotaList isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaList) Get() *QuotaList { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaList) Set(val *QuotaList) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaList) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaList) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaList(val *QuotaList) *NullableQuotaList { return &NullableQuotaList{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaList) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaList) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_backup_gigabytes.go b/services/iaas/model_quota_list_backup_gigabytes.go index 4738947af..56e3c9822 100644 --- a/services/iaas/model_quota_list_backup_gigabytes.go +++ b/services/iaas/model_quota_list_backup_gigabytes.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListBackupGigabytes{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupGigabytesGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupGigabytesGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupGigabytesGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListBackupGigabytesGetLimitAttributeTypeOk(arg QuotaListBackupGigabytesGetLimitAttributeType) (ret QuotaListBackupGigabytesGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListBackupGigabytesGetLimitAttributeTypeOk(arg QuotaListBackupGigab return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListBackupGigabytesGetLimitAttributeType(arg *QuotaListBackupGigabytesGetLimitAttributeType, val QuotaListBackupGigabytesGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListBackupGigabytesGetLimitAttributeType(arg *QuotaListBackupGigaby */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupGigabytesGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupGigabytesGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupGigabytesGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListBackupGigabytesGetUsageAttributeTypeOk(arg QuotaListBackupGigabytesGetUsageAttributeType) (ret QuotaListBackupGigabytesGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListBackupGigabytesGetUsageAttributeTypeOk(arg QuotaListBackupGigab return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListBackupGigabytesGetUsageAttributeType(arg *QuotaListBackupGigabytesGetUsageAttributeType, val QuotaListBackupGigabytesGetUsageRetType) { *arg = &val } // QuotaListBackupGigabytes Total size in GiB of backups. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupGigabytes struct { // REQUIRED Limit QuotaListBackupGigabytesGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListBackupGigabytes struct { Usage QuotaListBackupGigabytesGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListBackupGigabytes QuotaListBackupGigabytes // NewQuotaListBackupGigabytes instantiates a new QuotaListBackupGigabytes object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListBackupGigabytes(limit QuotaListBackupGigabytesGetLimitArgType, usage QuotaListBackupGigabytesGetUsageArgType) *QuotaListBackupGigabytes { this := QuotaListBackupGigabytes{} setQuotaListBackupGigabytesGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListBackupGigabytes(limit QuotaListBackupGigabytesGetLimitArgType, // NewQuotaListBackupGigabytesWithDefaults instantiates a new QuotaListBackupGigabytes object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListBackupGigabytesWithDefaults() *QuotaListBackupGigabytes { this := QuotaListBackupGigabytes{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackupGigabytes) GetLimit() (ret QuotaListBackupGigabytesGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListBackupGigabytes) GetLimit() (ret QuotaListBackupGigabytesGetLi // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackupGigabytes) GetLimitOk() (ret QuotaListBackupGigabytesGetLimitRetType, ok bool) { return getQuotaListBackupGigabytesGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackupGigabytes) SetLimit(v QuotaListBackupGigabytesGetLimitRetType) { setQuotaListBackupGigabytesGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackupGigabytes) GetUsage() (ret QuotaListBackupGigabytesGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListBackupGigabytes) GetUsage() (ret QuotaListBackupGigabytesGetUs // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackupGigabytes) GetUsageOk() (ret QuotaListBackupGigabytesGetUsageRetType, ok bool) { return getQuotaListBackupGigabytesGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackupGigabytes) SetUsage(v QuotaListBackupGigabytesGetUsageRetType) { setQuotaListBackupGigabytesGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListBackupGigabytes) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListBackupGigabytesGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListBackupGigabytes) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListBackupGigabytes struct { value *QuotaListBackupGigabytes isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListBackupGigabytes) Get() *QuotaListBackupGigabytes { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListBackupGigabytes) Set(val *QuotaListBackupGigabytes) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListBackupGigabytes) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListBackupGigabytes) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListBackupGigabytes(val *QuotaListBackupGigabytes) *NullableQuotaListBackupGigabytes { return &NullableQuotaListBackupGigabytes{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListBackupGigabytes) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListBackupGigabytes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_backups.go b/services/iaas/model_quota_list_backups.go index fad464a82..2289d5217 100644 --- a/services/iaas/model_quota_list_backups.go +++ b/services/iaas/model_quota_list_backups.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListBackups{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupsGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupsGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupsGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListBackupsGetLimitAttributeTypeOk(arg QuotaListBackupsGetLimitAttributeType) (ret QuotaListBackupsGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListBackupsGetLimitAttributeTypeOk(arg QuotaListBackupsGetLimitAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListBackupsGetLimitAttributeType(arg *QuotaListBackupsGetLimitAttributeType, val QuotaListBackupsGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListBackupsGetLimitAttributeType(arg *QuotaListBackupsGetLimitAttri */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupsGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupsGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackupsGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListBackupsGetUsageAttributeTypeOk(arg QuotaListBackupsGetUsageAttributeType) (ret QuotaListBackupsGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListBackupsGetUsageAttributeTypeOk(arg QuotaListBackupsGetUsageAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListBackupsGetUsageAttributeType(arg *QuotaListBackupsGetUsageAttributeType, val QuotaListBackupsGetUsageRetType) { *arg = &val } // QuotaListBackups Number of backups. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListBackups struct { // REQUIRED Limit QuotaListBackupsGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListBackups struct { Usage QuotaListBackupsGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListBackups QuotaListBackups // NewQuotaListBackups instantiates a new QuotaListBackups object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListBackups(limit QuotaListBackupsGetLimitArgType, usage QuotaListBackupsGetUsageArgType) *QuotaListBackups { this := QuotaListBackups{} setQuotaListBackupsGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListBackups(limit QuotaListBackupsGetLimitArgType, usage QuotaListB // NewQuotaListBackupsWithDefaults instantiates a new QuotaListBackups object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListBackupsWithDefaults() *QuotaListBackups { this := QuotaListBackups{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackups) GetLimit() (ret QuotaListBackupsGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListBackups) GetLimit() (ret QuotaListBackupsGetLimitRetType) { // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackups) GetLimitOk() (ret QuotaListBackupsGetLimitRetType, ok bool) { return getQuotaListBackupsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackups) SetLimit(v QuotaListBackupsGetLimitRetType) { setQuotaListBackupsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackups) GetUsage() (ret QuotaListBackupsGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListBackups) GetUsage() (ret QuotaListBackupsGetUsageRetType) { // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackups) GetUsageOk() (ret QuotaListBackupsGetUsageRetType, ok bool) { return getQuotaListBackupsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListBackups) SetUsage(v QuotaListBackupsGetUsageRetType) { setQuotaListBackupsGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListBackups) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListBackupsGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListBackups) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListBackups struct { value *QuotaListBackups isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListBackups) Get() *QuotaListBackups { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListBackups) Set(val *QuotaListBackups) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListBackups) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListBackups) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListBackups(val *QuotaListBackups) *NullableQuotaListBackups { return &NullableQuotaListBackups{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListBackups) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListBackups) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_gigabytes.go b/services/iaas/model_quota_list_gigabytes.go index 0fab93f0b..d99f222c0 100644 --- a/services/iaas/model_quota_list_gigabytes.go +++ b/services/iaas/model_quota_list_gigabytes.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListGigabytes{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGigabytesGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGigabytesGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGigabytesGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGigabytesGetLimitAttributeTypeOk(arg QuotaListGigabytesGetLimitAttributeType) (ret QuotaListGigabytesGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListGigabytesGetLimitAttributeTypeOk(arg QuotaListGigabytesGetLimit return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGigabytesGetLimitAttributeType(arg *QuotaListGigabytesGetLimitAttributeType, val QuotaListGigabytesGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListGigabytesGetLimitAttributeType(arg *QuotaListGigabytesGetLimitA */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGigabytesGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGigabytesGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGigabytesGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListGigabytesGetUsageAttributeTypeOk(arg QuotaListGigabytesGetUsageAttributeType) (ret QuotaListGigabytesGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListGigabytesGetUsageAttributeTypeOk(arg QuotaListGigabytesGetUsage return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListGigabytesGetUsageAttributeType(arg *QuotaListGigabytesGetUsageAttributeType, val QuotaListGigabytesGetUsageRetType) { *arg = &val } // QuotaListGigabytes Total size in GiB of volumes and snapshots. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListGigabytes struct { // REQUIRED Limit QuotaListGigabytesGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListGigabytes struct { Usage QuotaListGigabytesGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListGigabytes QuotaListGigabytes // NewQuotaListGigabytes instantiates a new QuotaListGigabytes object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListGigabytes(limit QuotaListGigabytesGetLimitArgType, usage QuotaListGigabytesGetUsageArgType) *QuotaListGigabytes { this := QuotaListGigabytes{} setQuotaListGigabytesGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListGigabytes(limit QuotaListGigabytesGetLimitArgType, usage QuotaL // NewQuotaListGigabytesWithDefaults instantiates a new QuotaListGigabytes object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListGigabytesWithDefaults() *QuotaListGigabytes { this := QuotaListGigabytes{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListGigabytes) GetLimit() (ret QuotaListGigabytesGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListGigabytes) GetLimit() (ret QuotaListGigabytesGetLimitRetType) // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListGigabytes) GetLimitOk() (ret QuotaListGigabytesGetLimitRetType, ok bool) { return getQuotaListGigabytesGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListGigabytes) SetLimit(v QuotaListGigabytesGetLimitRetType) { setQuotaListGigabytesGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListGigabytes) GetUsage() (ret QuotaListGigabytesGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListGigabytes) GetUsage() (ret QuotaListGigabytesGetUsageRetType) // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListGigabytes) GetUsageOk() (ret QuotaListGigabytesGetUsageRetType, ok bool) { return getQuotaListGigabytesGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListGigabytes) SetUsage(v QuotaListGigabytesGetUsageRetType) { setQuotaListGigabytesGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListGigabytes) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListGigabytesGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListGigabytes) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListGigabytes struct { value *QuotaListGigabytes isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListGigabytes) Get() *QuotaListGigabytes { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListGigabytes) Set(val *QuotaListGigabytes) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListGigabytes) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListGigabytes) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListGigabytes(val *QuotaListGigabytes) *NullableQuotaListGigabytes { return &NullableQuotaListGigabytes{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListGigabytes) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListGigabytes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_networks.go b/services/iaas/model_quota_list_networks.go index 79bac556a..ab7a93374 100644 --- a/services/iaas/model_quota_list_networks.go +++ b/services/iaas/model_quota_list_networks.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListNetworks{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNetworksGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNetworksGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNetworksGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListNetworksGetLimitAttributeTypeOk(arg QuotaListNetworksGetLimitAttributeType) (ret QuotaListNetworksGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListNetworksGetLimitAttributeTypeOk(arg QuotaListNetworksGetLimitAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListNetworksGetLimitAttributeType(arg *QuotaListNetworksGetLimitAttributeType, val QuotaListNetworksGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListNetworksGetLimitAttributeType(arg *QuotaListNetworksGetLimitAtt */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNetworksGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNetworksGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNetworksGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListNetworksGetUsageAttributeTypeOk(arg QuotaListNetworksGetUsageAttributeType) (ret QuotaListNetworksGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListNetworksGetUsageAttributeTypeOk(arg QuotaListNetworksGetUsageAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListNetworksGetUsageAttributeType(arg *QuotaListNetworksGetUsageAttributeType, val QuotaListNetworksGetUsageRetType) { *arg = &val } // QuotaListNetworks Number of networks. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNetworks struct { // REQUIRED Limit QuotaListNetworksGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListNetworks struct { Usage QuotaListNetworksGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListNetworks QuotaListNetworks // NewQuotaListNetworks instantiates a new QuotaListNetworks object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListNetworks(limit QuotaListNetworksGetLimitArgType, usage QuotaListNetworksGetUsageArgType) *QuotaListNetworks { this := QuotaListNetworks{} setQuotaListNetworksGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListNetworks(limit QuotaListNetworksGetLimitArgType, usage QuotaLis // NewQuotaListNetworksWithDefaults instantiates a new QuotaListNetworks object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListNetworksWithDefaults() *QuotaListNetworks { this := QuotaListNetworks{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNetworks) GetLimit() (ret QuotaListNetworksGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListNetworks) GetLimit() (ret QuotaListNetworksGetLimitRetType) { // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNetworks) GetLimitOk() (ret QuotaListNetworksGetLimitRetType, ok bool) { return getQuotaListNetworksGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNetworks) SetLimit(v QuotaListNetworksGetLimitRetType) { setQuotaListNetworksGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNetworks) GetUsage() (ret QuotaListNetworksGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListNetworks) GetUsage() (ret QuotaListNetworksGetUsageRetType) { // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNetworks) GetUsageOk() (ret QuotaListNetworksGetUsageRetType, ok bool) { return getQuotaListNetworksGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNetworks) SetUsage(v QuotaListNetworksGetUsageRetType) { setQuotaListNetworksGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListNetworks) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListNetworksGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListNetworks) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListNetworks struct { value *QuotaListNetworks isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListNetworks) Get() *QuotaListNetworks { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListNetworks) Set(val *QuotaListNetworks) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListNetworks) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListNetworks) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListNetworks(val *QuotaListNetworks) *NullableQuotaListNetworks { return &NullableQuotaListNetworks{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListNetworks) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListNetworks) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_nics.go b/services/iaas/model_quota_list_nics.go index 3f29e59f9..45b5eea02 100644 --- a/services/iaas/model_quota_list_nics.go +++ b/services/iaas/model_quota_list_nics.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListNics{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNicsGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNicsGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNicsGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListNicsGetLimitAttributeTypeOk(arg QuotaListNicsGetLimitAttributeType) (ret QuotaListNicsGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListNicsGetLimitAttributeTypeOk(arg QuotaListNicsGetLimitAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListNicsGetLimitAttributeType(arg *QuotaListNicsGetLimitAttributeType, val QuotaListNicsGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListNicsGetLimitAttributeType(arg *QuotaListNicsGetLimitAttributeTy */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNicsGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNicsGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNicsGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListNicsGetUsageAttributeTypeOk(arg QuotaListNicsGetUsageAttributeType) (ret QuotaListNicsGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListNicsGetUsageAttributeTypeOk(arg QuotaListNicsGetUsageAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListNicsGetUsageAttributeType(arg *QuotaListNicsGetUsageAttributeType, val QuotaListNicsGetUsageRetType) { *arg = &val } // QuotaListNics Number of network interfaces. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListNics struct { // REQUIRED Limit QuotaListNicsGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListNics struct { Usage QuotaListNicsGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListNics QuotaListNics // NewQuotaListNics instantiates a new QuotaListNics object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListNics(limit QuotaListNicsGetLimitArgType, usage QuotaListNicsGetUsageArgType) *QuotaListNics { this := QuotaListNics{} setQuotaListNicsGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListNics(limit QuotaListNicsGetLimitArgType, usage QuotaListNicsGet // NewQuotaListNicsWithDefaults instantiates a new QuotaListNics object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListNicsWithDefaults() *QuotaListNics { this := QuotaListNics{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNics) GetLimit() (ret QuotaListNicsGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListNics) GetLimit() (ret QuotaListNicsGetLimitRetType) { // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNics) GetLimitOk() (ret QuotaListNicsGetLimitRetType, ok bool) { return getQuotaListNicsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNics) SetLimit(v QuotaListNicsGetLimitRetType) { setQuotaListNicsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNics) GetUsage() (ret QuotaListNicsGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListNics) GetUsage() (ret QuotaListNicsGetUsageRetType) { // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNics) GetUsageOk() (ret QuotaListNicsGetUsageRetType, ok bool) { return getQuotaListNicsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListNics) SetUsage(v QuotaListNicsGetUsageRetType) { setQuotaListNicsGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListNics) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListNicsGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListNics) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListNics struct { value *QuotaListNics isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListNics) Get() *QuotaListNics { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListNics) Set(val *QuotaListNics) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListNics) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListNics) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListNics(val *QuotaListNics) *NullableQuotaListNics { return &NullableQuotaListNics{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListNics) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListNics) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_public_ips.go b/services/iaas/model_quota_list_public_ips.go index 290c9546b..690ce2645 100644 --- a/services/iaas/model_quota_list_public_ips.go +++ b/services/iaas/model_quota_list_public_ips.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListPublicIps{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListPublicIpsGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListPublicIpsGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListPublicIpsGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListPublicIpsGetLimitAttributeTypeOk(arg QuotaListPublicIpsGetLimitAttributeType) (ret QuotaListPublicIpsGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListPublicIpsGetLimitAttributeTypeOk(arg QuotaListPublicIpsGetLimit return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListPublicIpsGetLimitAttributeType(arg *QuotaListPublicIpsGetLimitAttributeType, val QuotaListPublicIpsGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListPublicIpsGetLimitAttributeType(arg *QuotaListPublicIpsGetLimitA */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListPublicIpsGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListPublicIpsGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListPublicIpsGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListPublicIpsGetUsageAttributeTypeOk(arg QuotaListPublicIpsGetUsageAttributeType) (ret QuotaListPublicIpsGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListPublicIpsGetUsageAttributeTypeOk(arg QuotaListPublicIpsGetUsage return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListPublicIpsGetUsageAttributeType(arg *QuotaListPublicIpsGetUsageAttributeType, val QuotaListPublicIpsGetUsageRetType) { *arg = &val } // QuotaListPublicIps Number of public IP addresses. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListPublicIps struct { // REQUIRED Limit QuotaListPublicIpsGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListPublicIps struct { Usage QuotaListPublicIpsGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListPublicIps QuotaListPublicIps // NewQuotaListPublicIps instantiates a new QuotaListPublicIps object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListPublicIps(limit QuotaListPublicIpsGetLimitArgType, usage QuotaListPublicIpsGetUsageArgType) *QuotaListPublicIps { this := QuotaListPublicIps{} setQuotaListPublicIpsGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListPublicIps(limit QuotaListPublicIpsGetLimitArgType, usage QuotaL // NewQuotaListPublicIpsWithDefaults instantiates a new QuotaListPublicIps object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListPublicIpsWithDefaults() *QuotaListPublicIps { this := QuotaListPublicIps{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListPublicIps) GetLimit() (ret QuotaListPublicIpsGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListPublicIps) GetLimit() (ret QuotaListPublicIpsGetLimitRetType) // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListPublicIps) GetLimitOk() (ret QuotaListPublicIpsGetLimitRetType, ok bool) { return getQuotaListPublicIpsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListPublicIps) SetLimit(v QuotaListPublicIpsGetLimitRetType) { setQuotaListPublicIpsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListPublicIps) GetUsage() (ret QuotaListPublicIpsGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListPublicIps) GetUsage() (ret QuotaListPublicIpsGetUsageRetType) // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListPublicIps) GetUsageOk() (ret QuotaListPublicIpsGetUsageRetType, ok bool) { return getQuotaListPublicIpsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListPublicIps) SetUsage(v QuotaListPublicIpsGetUsageRetType) { setQuotaListPublicIpsGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListPublicIps) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListPublicIpsGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListPublicIps) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListPublicIps struct { value *QuotaListPublicIps isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListPublicIps) Get() *QuotaListPublicIps { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListPublicIps) Set(val *QuotaListPublicIps) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListPublicIps) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListPublicIps) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListPublicIps(val *QuotaListPublicIps) *NullableQuotaListPublicIps { return &NullableQuotaListPublicIps{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListPublicIps) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListPublicIps) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_ram.go b/services/iaas/model_quota_list_ram.go index fce02d359..46cbf34cd 100644 --- a/services/iaas/model_quota_list_ram.go +++ b/services/iaas/model_quota_list_ram.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListRam{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListRamGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListRamGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListRamGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListRamGetLimitAttributeTypeOk(arg QuotaListRamGetLimitAttributeType) (ret QuotaListRamGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListRamGetLimitAttributeTypeOk(arg QuotaListRamGetLimitAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListRamGetLimitAttributeType(arg *QuotaListRamGetLimitAttributeType, val QuotaListRamGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListRamGetLimitAttributeType(arg *QuotaListRamGetLimitAttributeType */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListRamGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListRamGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListRamGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListRamGetUsageAttributeTypeOk(arg QuotaListRamGetUsageAttributeType) (ret QuotaListRamGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListRamGetUsageAttributeTypeOk(arg QuotaListRamGetUsageAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListRamGetUsageAttributeType(arg *QuotaListRamGetUsageAttributeType, val QuotaListRamGetUsageRetType) { *arg = &val } // QuotaListRam Amount of server RAM in MiB. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListRam struct { // REQUIRED Limit QuotaListRamGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListRam struct { Usage QuotaListRamGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListRam QuotaListRam // NewQuotaListRam instantiates a new QuotaListRam object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListRam(limit QuotaListRamGetLimitArgType, usage QuotaListRamGetUsageArgType) *QuotaListRam { this := QuotaListRam{} setQuotaListRamGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListRam(limit QuotaListRamGetLimitArgType, usage QuotaListRamGetUsa // NewQuotaListRamWithDefaults instantiates a new QuotaListRam object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListRamWithDefaults() *QuotaListRam { this := QuotaListRam{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListRam) GetLimit() (ret QuotaListRamGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListRam) GetLimit() (ret QuotaListRamGetLimitRetType) { // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListRam) GetLimitOk() (ret QuotaListRamGetLimitRetType, ok bool) { return getQuotaListRamGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListRam) SetLimit(v QuotaListRamGetLimitRetType) { setQuotaListRamGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListRam) GetUsage() (ret QuotaListRamGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListRam) GetUsage() (ret QuotaListRamGetUsageRetType) { // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListRam) GetUsageOk() (ret QuotaListRamGetUsageRetType, ok bool) { return getQuotaListRamGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListRam) SetUsage(v QuotaListRamGetUsageRetType) { setQuotaListRamGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListRam) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListRamGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListRam) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListRam struct { value *QuotaListRam isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListRam) Get() *QuotaListRam { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListRam) Set(val *QuotaListRam) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListRam) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListRam) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListRam(val *QuotaListRam) *NullableQuotaListRam { return &NullableQuotaListRam{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListRam) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListRam) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_response.go b/services/iaas/model_quota_list_response.go index c24b2339a..41b1fed4e 100644 --- a/services/iaas/model_quota_list_response.go +++ b/services/iaas/model_quota_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListResponse{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListResponseGetQuotasAttributeType = *QuotaList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListResponseGetQuotasArgType = QuotaList + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListResponseGetQuotasRetType = QuotaList +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListResponseGetQuotasAttributeTypeOk(arg QuotaListResponseGetQuotasAttributeType) (ret QuotaListResponseGetQuotasRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getQuotaListResponseGetQuotasAttributeTypeOk(arg QuotaListResponseGetQuotas return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListResponseGetQuotasAttributeType(arg *QuotaListResponseGetQuotasAttributeType, val QuotaListResponseGetQuotasRetType) { *arg = &val } // QuotaListResponse Quotas list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListResponse struct { // REQUIRED Quotas QuotaListResponseGetQuotasAttributeType `json:"quotas" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListResponse QuotaListResponse // NewQuotaListResponse instantiates a new QuotaListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListResponse(quotas QuotaListResponseGetQuotasArgType) *QuotaListResponse { this := QuotaListResponse{} setQuotaListResponseGetQuotasAttributeType(&this.Quotas, quotas) @@ -58,12 +69,14 @@ func NewQuotaListResponse(quotas QuotaListResponseGetQuotasArgType) *QuotaListRe // NewQuotaListResponseWithDefaults instantiates a new QuotaListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListResponseWithDefaults() *QuotaListResponse { this := QuotaListResponse{} return &this } // GetQuotas returns the Quotas field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListResponse) GetQuotas() (ret QuotaListResponseGetQuotasRetType) { ret, _ = o.GetQuotasOk() return ret @@ -71,15 +84,18 @@ func (o *QuotaListResponse) GetQuotas() (ret QuotaListResponseGetQuotasRetType) // GetQuotasOk returns a tuple with the Quotas field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListResponse) GetQuotasOk() (ret QuotaListResponseGetQuotasRetType, ok bool) { return getQuotaListResponseGetQuotasAttributeTypeOk(o.Quotas) } // SetQuotas sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListResponse) SetQuotas(v QuotaListResponseGetQuotasRetType) { setQuotaListResponseGetQuotasAttributeType(&o.Quotas, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListResponseGetQuotasAttributeTypeOk(o.Quotas); ok { @@ -88,37 +104,45 @@ func (o QuotaListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListResponse struct { value *QuotaListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListResponse) Get() *QuotaListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListResponse) Set(val *QuotaListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListResponse(val *QuotaListResponse) *NullableQuotaListResponse { return &NullableQuotaListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_security_group_rules.go b/services/iaas/model_quota_list_security_group_rules.go index eed9d1eba..f668a4654 100644 --- a/services/iaas/model_quota_list_security_group_rules.go +++ b/services/iaas/model_quota_list_security_group_rules.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListSecurityGroupRules{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupRulesGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupRulesGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupRulesGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(arg QuotaListSecurityGroupRulesGetLimitAttributeType) (ret QuotaListSecurityGroupRulesGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(arg QuotaListSecurity return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListSecurityGroupRulesGetLimitAttributeType(arg *QuotaListSecurityGroupRulesGetLimitAttributeType, val QuotaListSecurityGroupRulesGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListSecurityGroupRulesGetLimitAttributeType(arg *QuotaListSecurityG */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupRulesGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupRulesGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupRulesGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(arg QuotaListSecurityGroupRulesGetUsageAttributeType) (ret QuotaListSecurityGroupRulesGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(arg QuotaListSecurity return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListSecurityGroupRulesGetUsageAttributeType(arg *QuotaListSecurityGroupRulesGetUsageAttributeType, val QuotaListSecurityGroupRulesGetUsageRetType) { *arg = &val } // QuotaListSecurityGroupRules Number of security group rules. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupRules struct { // REQUIRED Limit QuotaListSecurityGroupRulesGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListSecurityGroupRules struct { Usage QuotaListSecurityGroupRulesGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListSecurityGroupRules QuotaListSecurityGroupRules // NewQuotaListSecurityGroupRules instantiates a new QuotaListSecurityGroupRules object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListSecurityGroupRules(limit QuotaListSecurityGroupRulesGetLimitArgType, usage QuotaListSecurityGroupRulesGetUsageArgType) *QuotaListSecurityGroupRules { this := QuotaListSecurityGroupRules{} setQuotaListSecurityGroupRulesGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListSecurityGroupRules(limit QuotaListSecurityGroupRulesGetLimitArg // NewQuotaListSecurityGroupRulesWithDefaults instantiates a new QuotaListSecurityGroupRules object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListSecurityGroupRulesWithDefaults() *QuotaListSecurityGroupRules { this := QuotaListSecurityGroupRules{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroupRules) GetLimit() (ret QuotaListSecurityGroupRulesGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListSecurityGroupRules) GetLimit() (ret QuotaListSecurityGroupRule // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroupRules) GetLimitOk() (ret QuotaListSecurityGroupRulesGetLimitRetType, ok bool) { return getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroupRules) SetLimit(v QuotaListSecurityGroupRulesGetLimitRetType) { setQuotaListSecurityGroupRulesGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroupRules) GetUsage() (ret QuotaListSecurityGroupRulesGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListSecurityGroupRules) GetUsage() (ret QuotaListSecurityGroupRule // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroupRules) GetUsageOk() (ret QuotaListSecurityGroupRulesGetUsageRetType, ok bool) { return getQuotaListSecurityGroupRulesGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroupRules) SetUsage(v QuotaListSecurityGroupRulesGetUsageRetType) { setQuotaListSecurityGroupRulesGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListSecurityGroupRules) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListSecurityGroupRulesGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListSecurityGroupRules) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListSecurityGroupRules struct { value *QuotaListSecurityGroupRules isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSecurityGroupRules) Get() *QuotaListSecurityGroupRules { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSecurityGroupRules) Set(val *QuotaListSecurityGroupRules) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSecurityGroupRules) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSecurityGroupRules) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListSecurityGroupRules(val *QuotaListSecurityGroupRules) *NullableQuotaListSecurityGroupRules { return &NullableQuotaListSecurityGroupRules{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSecurityGroupRules) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSecurityGroupRules) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_security_groups.go b/services/iaas/model_quota_list_security_groups.go index 8665ce043..9e714e3d8 100644 --- a/services/iaas/model_quota_list_security_groups.go +++ b/services/iaas/model_quota_list_security_groups.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListSecurityGroups{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupsGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupsGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupsGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListSecurityGroupsGetLimitAttributeTypeOk(arg QuotaListSecurityGroupsGetLimitAttributeType) (ret QuotaListSecurityGroupsGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListSecurityGroupsGetLimitAttributeTypeOk(arg QuotaListSecurityGrou return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListSecurityGroupsGetLimitAttributeType(arg *QuotaListSecurityGroupsGetLimitAttributeType, val QuotaListSecurityGroupsGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListSecurityGroupsGetLimitAttributeType(arg *QuotaListSecurityGroup */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupsGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupsGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroupsGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListSecurityGroupsGetUsageAttributeTypeOk(arg QuotaListSecurityGroupsGetUsageAttributeType) (ret QuotaListSecurityGroupsGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListSecurityGroupsGetUsageAttributeTypeOk(arg QuotaListSecurityGrou return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListSecurityGroupsGetUsageAttributeType(arg *QuotaListSecurityGroupsGetUsageAttributeType, val QuotaListSecurityGroupsGetUsageRetType) { *arg = &val } // QuotaListSecurityGroups Number of security groups. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSecurityGroups struct { // REQUIRED Limit QuotaListSecurityGroupsGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListSecurityGroups struct { Usage QuotaListSecurityGroupsGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListSecurityGroups QuotaListSecurityGroups // NewQuotaListSecurityGroups instantiates a new QuotaListSecurityGroups object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListSecurityGroups(limit QuotaListSecurityGroupsGetLimitArgType, usage QuotaListSecurityGroupsGetUsageArgType) *QuotaListSecurityGroups { this := QuotaListSecurityGroups{} setQuotaListSecurityGroupsGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListSecurityGroups(limit QuotaListSecurityGroupsGetLimitArgType, us // NewQuotaListSecurityGroupsWithDefaults instantiates a new QuotaListSecurityGroups object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListSecurityGroupsWithDefaults() *QuotaListSecurityGroups { this := QuotaListSecurityGroups{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroups) GetLimit() (ret QuotaListSecurityGroupsGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListSecurityGroups) GetLimit() (ret QuotaListSecurityGroupsGetLimi // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroups) GetLimitOk() (ret QuotaListSecurityGroupsGetLimitRetType, ok bool) { return getQuotaListSecurityGroupsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroups) SetLimit(v QuotaListSecurityGroupsGetLimitRetType) { setQuotaListSecurityGroupsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroups) GetUsage() (ret QuotaListSecurityGroupsGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListSecurityGroups) GetUsage() (ret QuotaListSecurityGroupsGetUsag // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroups) GetUsageOk() (ret QuotaListSecurityGroupsGetUsageRetType, ok bool) { return getQuotaListSecurityGroupsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSecurityGroups) SetUsage(v QuotaListSecurityGroupsGetUsageRetType) { setQuotaListSecurityGroupsGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListSecurityGroups) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListSecurityGroupsGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListSecurityGroups) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListSecurityGroups struct { value *QuotaListSecurityGroups isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSecurityGroups) Get() *QuotaListSecurityGroups { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSecurityGroups) Set(val *QuotaListSecurityGroups) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSecurityGroups) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSecurityGroups) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListSecurityGroups(val *QuotaListSecurityGroups) *NullableQuotaListSecurityGroups { return &NullableQuotaListSecurityGroups{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSecurityGroups) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSecurityGroups) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_snapshots.go b/services/iaas/model_quota_list_snapshots.go index 79c442f52..926dcfe22 100644 --- a/services/iaas/model_quota_list_snapshots.go +++ b/services/iaas/model_quota_list_snapshots.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListSnapshots{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSnapshotsGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSnapshotsGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSnapshotsGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListSnapshotsGetLimitAttributeTypeOk(arg QuotaListSnapshotsGetLimitAttributeType) (ret QuotaListSnapshotsGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListSnapshotsGetLimitAttributeTypeOk(arg QuotaListSnapshotsGetLimit return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListSnapshotsGetLimitAttributeType(arg *QuotaListSnapshotsGetLimitAttributeType, val QuotaListSnapshotsGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListSnapshotsGetLimitAttributeType(arg *QuotaListSnapshotsGetLimitA */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSnapshotsGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSnapshotsGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSnapshotsGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListSnapshotsGetUsageAttributeTypeOk(arg QuotaListSnapshotsGetUsageAttributeType) (ret QuotaListSnapshotsGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListSnapshotsGetUsageAttributeTypeOk(arg QuotaListSnapshotsGetUsage return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListSnapshotsGetUsageAttributeType(arg *QuotaListSnapshotsGetUsageAttributeType, val QuotaListSnapshotsGetUsageRetType) { *arg = &val } // QuotaListSnapshots Number of snapshots. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListSnapshots struct { // REQUIRED Limit QuotaListSnapshotsGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListSnapshots struct { Usage QuotaListSnapshotsGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListSnapshots QuotaListSnapshots // NewQuotaListSnapshots instantiates a new QuotaListSnapshots object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListSnapshots(limit QuotaListSnapshotsGetLimitArgType, usage QuotaListSnapshotsGetUsageArgType) *QuotaListSnapshots { this := QuotaListSnapshots{} setQuotaListSnapshotsGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListSnapshots(limit QuotaListSnapshotsGetLimitArgType, usage QuotaL // NewQuotaListSnapshotsWithDefaults instantiates a new QuotaListSnapshots object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListSnapshotsWithDefaults() *QuotaListSnapshots { this := QuotaListSnapshots{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSnapshots) GetLimit() (ret QuotaListSnapshotsGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListSnapshots) GetLimit() (ret QuotaListSnapshotsGetLimitRetType) // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSnapshots) GetLimitOk() (ret QuotaListSnapshotsGetLimitRetType, ok bool) { return getQuotaListSnapshotsGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSnapshots) SetLimit(v QuotaListSnapshotsGetLimitRetType) { setQuotaListSnapshotsGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSnapshots) GetUsage() (ret QuotaListSnapshotsGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListSnapshots) GetUsage() (ret QuotaListSnapshotsGetUsageRetType) // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSnapshots) GetUsageOk() (ret QuotaListSnapshotsGetUsageRetType, ok bool) { return getQuotaListSnapshotsGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListSnapshots) SetUsage(v QuotaListSnapshotsGetUsageRetType) { setQuotaListSnapshotsGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListSnapshots) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListSnapshotsGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListSnapshots) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListSnapshots struct { value *QuotaListSnapshots isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSnapshots) Get() *QuotaListSnapshots { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSnapshots) Set(val *QuotaListSnapshots) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSnapshots) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSnapshots) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListSnapshots(val *QuotaListSnapshots) *NullableQuotaListSnapshots { return &NullableQuotaListSnapshots{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListSnapshots) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListSnapshots) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_vcpu.go b/services/iaas/model_quota_list_vcpu.go index 982d488cf..63e0b064f 100644 --- a/services/iaas/model_quota_list_vcpu.go +++ b/services/iaas/model_quota_list_vcpu.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListVcpu{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVcpuGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVcpuGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVcpuGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListVcpuGetLimitAttributeTypeOk(arg QuotaListVcpuGetLimitAttributeType) (ret QuotaListVcpuGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListVcpuGetLimitAttributeTypeOk(arg QuotaListVcpuGetLimitAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListVcpuGetLimitAttributeType(arg *QuotaListVcpuGetLimitAttributeType, val QuotaListVcpuGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListVcpuGetLimitAttributeType(arg *QuotaListVcpuGetLimitAttributeTy */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVcpuGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVcpuGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVcpuGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListVcpuGetUsageAttributeTypeOk(arg QuotaListVcpuGetUsageAttributeType) (ret QuotaListVcpuGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListVcpuGetUsageAttributeTypeOk(arg QuotaListVcpuGetUsageAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListVcpuGetUsageAttributeType(arg *QuotaListVcpuGetUsageAttributeType, val QuotaListVcpuGetUsageRetType) { *arg = &val } // QuotaListVcpu Number of server cores. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVcpu struct { // REQUIRED Limit QuotaListVcpuGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListVcpu struct { Usage QuotaListVcpuGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListVcpu QuotaListVcpu // NewQuotaListVcpu instantiates a new QuotaListVcpu object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListVcpu(limit QuotaListVcpuGetLimitArgType, usage QuotaListVcpuGetUsageArgType) *QuotaListVcpu { this := QuotaListVcpu{} setQuotaListVcpuGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListVcpu(limit QuotaListVcpuGetLimitArgType, usage QuotaListVcpuGet // NewQuotaListVcpuWithDefaults instantiates a new QuotaListVcpu object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListVcpuWithDefaults() *QuotaListVcpu { this := QuotaListVcpu{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVcpu) GetLimit() (ret QuotaListVcpuGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListVcpu) GetLimit() (ret QuotaListVcpuGetLimitRetType) { // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVcpu) GetLimitOk() (ret QuotaListVcpuGetLimitRetType, ok bool) { return getQuotaListVcpuGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVcpu) SetLimit(v QuotaListVcpuGetLimitRetType) { setQuotaListVcpuGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVcpu) GetUsage() (ret QuotaListVcpuGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListVcpu) GetUsage() (ret QuotaListVcpuGetUsageRetType) { // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVcpu) GetUsageOk() (ret QuotaListVcpuGetUsageRetType, ok bool) { return getQuotaListVcpuGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVcpu) SetUsage(v QuotaListVcpuGetUsageRetType) { setQuotaListVcpuGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListVcpu) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListVcpuGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListVcpu) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListVcpu struct { value *QuotaListVcpu isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListVcpu) Get() *QuotaListVcpu { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListVcpu) Set(val *QuotaListVcpu) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListVcpu) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListVcpu) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListVcpu(val *QuotaListVcpu) *NullableQuotaListVcpu { return &NullableQuotaListVcpu{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListVcpu) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListVcpu) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_quota_list_volumes.go b/services/iaas/model_quota_list_volumes.go index 318b09247..3e9863060 100644 --- a/services/iaas/model_quota_list_volumes.go +++ b/services/iaas/model_quota_list_volumes.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &QuotaListVolumes{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVolumesGetLimitAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVolumesGetLimitArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVolumesGetLimitRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListVolumesGetLimitAttributeTypeOk(arg QuotaListVolumesGetLimitAttributeType) (ret QuotaListVolumesGetLimitRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getQuotaListVolumesGetLimitAttributeTypeOk(arg QuotaListVolumesGetLimitAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListVolumesGetLimitAttributeType(arg *QuotaListVolumesGetLimitAttributeType, val QuotaListVolumesGetLimitRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setQuotaListVolumesGetLimitAttributeType(arg *QuotaListVolumesGetLimitAttri */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVolumesGetUsageAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVolumesGetUsageArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVolumesGetUsageRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getQuotaListVolumesGetUsageAttributeTypeOk(arg QuotaListVolumesGetUsageAttributeType) (ret QuotaListVolumesGetUsageRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getQuotaListVolumesGetUsageAttributeTypeOk(arg QuotaListVolumesGetUsageAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setQuotaListVolumesGetUsageAttributeType(arg *QuotaListVolumesGetUsageAttributeType, val QuotaListVolumesGetUsageRetType) { *arg = &val } // QuotaListVolumes Number of volumes. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type QuotaListVolumes struct { // REQUIRED Limit QuotaListVolumesGetLimitAttributeType `json:"limit" required:"true"` @@ -65,12 +81,14 @@ type QuotaListVolumes struct { Usage QuotaListVolumesGetUsageAttributeType `json:"usage" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _QuotaListVolumes QuotaListVolumes // NewQuotaListVolumes instantiates a new QuotaListVolumes object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListVolumes(limit QuotaListVolumesGetLimitArgType, usage QuotaListVolumesGetUsageArgType) *QuotaListVolumes { this := QuotaListVolumes{} setQuotaListVolumesGetLimitAttributeType(&this.Limit, limit) @@ -81,12 +99,14 @@ func NewQuotaListVolumes(limit QuotaListVolumesGetLimitArgType, usage QuotaListV // NewQuotaListVolumesWithDefaults instantiates a new QuotaListVolumes object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewQuotaListVolumesWithDefaults() *QuotaListVolumes { this := QuotaListVolumes{} return &this } // GetLimit returns the Limit field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVolumes) GetLimit() (ret QuotaListVolumesGetLimitRetType) { ret, _ = o.GetLimitOk() return ret @@ -94,16 +114,19 @@ func (o *QuotaListVolumes) GetLimit() (ret QuotaListVolumesGetLimitRetType) { // GetLimitOk returns a tuple with the Limit field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVolumes) GetLimitOk() (ret QuotaListVolumesGetLimitRetType, ok bool) { return getQuotaListVolumesGetLimitAttributeTypeOk(o.Limit) } // SetLimit sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVolumes) SetLimit(v QuotaListVolumesGetLimitRetType) { setQuotaListVolumesGetLimitAttributeType(&o.Limit, v) } // GetUsage returns the Usage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVolumes) GetUsage() (ret QuotaListVolumesGetUsageRetType) { ret, _ = o.GetUsageOk() return ret @@ -111,15 +134,18 @@ func (o *QuotaListVolumes) GetUsage() (ret QuotaListVolumesGetUsageRetType) { // GetUsageOk returns a tuple with the Usage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVolumes) GetUsageOk() (ret QuotaListVolumesGetUsageRetType, ok bool) { return getQuotaListVolumesGetUsageAttributeTypeOk(o.Usage) } // SetUsage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *QuotaListVolumes) SetUsage(v QuotaListVolumesGetUsageRetType) { setQuotaListVolumesGetUsageAttributeType(&o.Usage, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o QuotaListVolumes) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getQuotaListVolumesGetLimitAttributeTypeOk(o.Limit); ok { @@ -131,37 +157,45 @@ func (o QuotaListVolumes) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableQuotaListVolumes struct { value *QuotaListVolumes isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListVolumes) Get() *QuotaListVolumes { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListVolumes) Set(val *QuotaListVolumes) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListVolumes) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListVolumes) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableQuotaListVolumes(val *QuotaListVolumes) *NullableQuotaListVolumes { return &NullableQuotaListVolumes{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableQuotaListVolumes) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableQuotaListVolumes) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_regional_area.go b/services/iaas/model_regional_area.go index 54bc296b8..da8e67bec 100644 --- a/services/iaas/model_regional_area.go +++ b/services/iaas/model_regional_area.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &RegionalArea{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaGetIpv4AttributeType = *RegionalAreaIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaGetIpv4ArgType = RegionalAreaIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaGetIpv4RetType = RegionalAreaIPv4 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaGetIpv4AttributeTypeOk(arg RegionalAreaGetIpv4AttributeType) (ret RegionalAreaGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getRegionalAreaGetIpv4AttributeTypeOk(arg RegionalAreaGetIpv4AttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaGetIpv4AttributeType(arg *RegionalAreaGetIpv4AttributeType, val RegionalAreaGetIpv4RetType) { *arg = &val } @@ -42,8 +50,10 @@ func setRegionalAreaGetIpv4AttributeType(arg *RegionalAreaGetIpv4AttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaGetStatusAttributeTypeOk(arg RegionalAreaGetStatusAttributeType) (ret RegionalAreaGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -51,14 +61,19 @@ func getRegionalAreaGetStatusAttributeTypeOk(arg RegionalAreaGetStatusAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaGetStatusAttributeType(arg *RegionalAreaGetStatusAttributeType, val RegionalAreaGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaGetStatusRetType = string // RegionalArea The basic properties of a regional network area. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalArea struct { Ipv4 RegionalAreaGetIpv4AttributeType `json:"ipv4,omitempty"` // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. @@ -69,6 +84,7 @@ type RegionalArea struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRegionalArea() *RegionalArea { this := RegionalArea{} return &this @@ -77,12 +93,14 @@ func NewRegionalArea() *RegionalArea { // NewRegionalAreaWithDefaults instantiates a new RegionalArea object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRegionalAreaWithDefaults() *RegionalArea { this := RegionalArea{} return &this } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalArea) GetIpv4() (res RegionalAreaGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -90,22 +108,26 @@ func (o *RegionalArea) GetIpv4() (res RegionalAreaGetIpv4RetType) { // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalArea) GetIpv4Ok() (ret RegionalAreaGetIpv4RetType, ok bool) { return getRegionalAreaGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalArea) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given RegionalAreaIPv4 and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalArea) SetIpv4(v RegionalAreaGetIpv4RetType) { setRegionalAreaGetIpv4AttributeType(&o.Ipv4, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalArea) GetStatus() (res RegionalAreaGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -113,21 +135,25 @@ func (o *RegionalArea) GetStatus() (res RegionalAreaGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalArea) GetStatusOk() (ret RegionalAreaGetStatusRetType, ok bool) { return getRegionalAreaGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalArea) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalArea) SetStatus(v RegionalAreaGetStatusRetType) { setRegionalAreaGetStatusAttributeType(&o.Status, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RegionalArea) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRegionalAreaGetIpv4AttributeTypeOk(o.Ipv4); ok { @@ -139,37 +165,45 @@ func (o RegionalArea) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRegionalArea struct { value *RegionalArea isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalArea) Get() *RegionalArea { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalArea) Set(val *RegionalArea) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalArea) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalArea) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRegionalArea(val *RegionalArea) *NullableRegionalArea { return &NullableRegionalArea{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalArea) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalArea) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_regional_area_ipv4.go b/services/iaas/model_regional_area_ipv4.go index 9443075f3..ef8291e1a 100644 --- a/services/iaas/model_regional_area_ipv4.go +++ b/services/iaas/model_regional_area_ipv4.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &RegionalAreaIPv4{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetDefaultNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetDefaultNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetDefaultNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(arg RegionalAreaIPv4GetDefaultNameserversAttributeType) (ret RegionalAreaIPv4GetDefaultNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(arg RegionalAreaIPv return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaIPv4GetDefaultNameserversAttributeType(arg *RegionalAreaIPv4GetDefaultNameserversAttributeType, val RegionalAreaIPv4GetDefaultNameserversRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setRegionalAreaIPv4GetDefaultNameserversAttributeType(arg *RegionalAreaIPv4 */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetDefaultPrefixLenAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetDefaultPrefixLenArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetDefaultPrefixLenRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg RegionalAreaIPv4GetDefaultPrefixLenAttributeType) (ret RegionalAreaIPv4GetDefaultPrefixLenRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg RegionalAreaIPv4G return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaIPv4GetDefaultPrefixLenAttributeType(arg *RegionalAreaIPv4GetDefaultPrefixLenAttributeType, val RegionalAreaIPv4GetDefaultPrefixLenRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setRegionalAreaIPv4GetDefaultPrefixLenAttributeType(arg *RegionalAreaIPv4Ge */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetMaxPrefixLenAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetMaxPrefixLenArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetMaxPrefixLenRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg RegionalAreaIPv4GetMaxPrefixLenAttributeType) (ret RegionalAreaIPv4GetMaxPrefixLenRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg RegionalAreaIPv4GetMa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaIPv4GetMaxPrefixLenAttributeType(arg *RegionalAreaIPv4GetMaxPrefixLenAttributeType, val RegionalAreaIPv4GetMaxPrefixLenRetType) { *arg = &val } @@ -82,10 +104,16 @@ func setRegionalAreaIPv4GetMaxPrefixLenAttributeType(arg *RegionalAreaIPv4GetMax */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetMinPrefixLenAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetMinPrefixLenArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetMinPrefixLenRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(arg RegionalAreaIPv4GetMinPrefixLenAttributeType) (ret RegionalAreaIPv4GetMinPrefixLenRetType, ok bool) { if arg == nil { return ret, false @@ -93,6 +121,7 @@ func getRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(arg RegionalAreaIPv4GetMi return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaIPv4GetMinPrefixLenAttributeType(arg *RegionalAreaIPv4GetMinPrefixLenAttributeType, val RegionalAreaIPv4GetMinPrefixLenRetType) { *arg = &val } @@ -102,10 +131,16 @@ func setRegionalAreaIPv4GetMinPrefixLenAttributeType(arg *RegionalAreaIPv4GetMin */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetNetworkRangesAttributeType = *[]NetworkRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetNetworkRangesArgType = []NetworkRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetNetworkRangesRetType = []NetworkRange +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaIPv4GetNetworkRangesAttributeTypeOk(arg RegionalAreaIPv4GetNetworkRangesAttributeType) (ret RegionalAreaIPv4GetNetworkRangesRetType, ok bool) { if arg == nil { return ret, false @@ -113,6 +148,7 @@ func getRegionalAreaIPv4GetNetworkRangesAttributeTypeOk(arg RegionalAreaIPv4GetN return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaIPv4GetNetworkRangesAttributeType(arg *RegionalAreaIPv4GetNetworkRangesAttributeType, val RegionalAreaIPv4GetNetworkRangesRetType) { *arg = &val } @@ -122,8 +158,10 @@ func setRegionalAreaIPv4GetNetworkRangesAttributeType(arg *RegionalAreaIPv4GetNe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetTransferNetworkAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaIPv4GetTransferNetworkAttributeTypeOk(arg RegionalAreaIPv4GetTransferNetworkAttributeType) (ret RegionalAreaIPv4GetTransferNetworkRetType, ok bool) { if arg == nil { return ret, false @@ -131,14 +169,19 @@ func getRegionalAreaIPv4GetTransferNetworkAttributeTypeOk(arg RegionalAreaIPv4Ge return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaIPv4GetTransferNetworkAttributeType(arg *RegionalAreaIPv4GetTransferNetworkAttributeType, val RegionalAreaIPv4GetTransferNetworkRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetTransferNetworkArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4GetTransferNetworkRetType = string // RegionalAreaIPv4 The regional IPv4 config of a network area. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaIPv4 struct { DefaultNameservers RegionalAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` // The default prefix length for networks in the network area. @@ -158,12 +201,14 @@ type RegionalAreaIPv4 struct { TransferNetwork RegionalAreaIPv4GetTransferNetworkAttributeType `json:"transferNetwork" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _RegionalAreaIPv4 RegionalAreaIPv4 // NewRegionalAreaIPv4 instantiates a new RegionalAreaIPv4 object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRegionalAreaIPv4(defaultPrefixLen RegionalAreaIPv4GetDefaultPrefixLenArgType, maxPrefixLen RegionalAreaIPv4GetMaxPrefixLenArgType, minPrefixLen RegionalAreaIPv4GetMinPrefixLenArgType, networkRanges RegionalAreaIPv4GetNetworkRangesArgType, transferNetwork RegionalAreaIPv4GetTransferNetworkArgType) *RegionalAreaIPv4 { this := RegionalAreaIPv4{} setRegionalAreaIPv4GetDefaultPrefixLenAttributeType(&this.DefaultPrefixLen, defaultPrefixLen) @@ -177,6 +222,7 @@ func NewRegionalAreaIPv4(defaultPrefixLen RegionalAreaIPv4GetDefaultPrefixLenArg // NewRegionalAreaIPv4WithDefaults instantiates a new RegionalAreaIPv4 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRegionalAreaIPv4WithDefaults() *RegionalAreaIPv4 { this := RegionalAreaIPv4{} var defaultPrefixLen int64 = 25 @@ -189,6 +235,7 @@ func NewRegionalAreaIPv4WithDefaults() *RegionalAreaIPv4 { } // GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetDefaultNameservers() (res RegionalAreaIPv4GetDefaultNameserversRetType) { res, _ = o.GetDefaultNameserversOk() return @@ -196,22 +243,26 @@ func (o *RegionalAreaIPv4) GetDefaultNameservers() (res RegionalAreaIPv4GetDefau // GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetDefaultNameserversOk() (ret RegionalAreaIPv4GetDefaultNameserversRetType, ok bool) { return getRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) } // HasDefaultNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) HasDefaultNameservers() bool { _, ok := o.GetDefaultNameserversOk() return ok } // SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) SetDefaultNameservers(v RegionalAreaIPv4GetDefaultNameserversRetType) { setRegionalAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) } // GetDefaultPrefixLen returns the DefaultPrefixLen field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetDefaultPrefixLen() (ret RegionalAreaIPv4GetDefaultPrefixLenRetType) { ret, _ = o.GetDefaultPrefixLenOk() return ret @@ -219,16 +270,19 @@ func (o *RegionalAreaIPv4) GetDefaultPrefixLen() (ret RegionalAreaIPv4GetDefault // GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetDefaultPrefixLenOk() (ret RegionalAreaIPv4GetDefaultPrefixLenRetType, ok bool) { return getRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) } // SetDefaultPrefixLen sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) SetDefaultPrefixLen(v RegionalAreaIPv4GetDefaultPrefixLenRetType) { setRegionalAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) } // GetMaxPrefixLen returns the MaxPrefixLen field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetMaxPrefixLen() (ret RegionalAreaIPv4GetMaxPrefixLenRetType) { ret, _ = o.GetMaxPrefixLenOk() return ret @@ -236,16 +290,19 @@ func (o *RegionalAreaIPv4) GetMaxPrefixLen() (ret RegionalAreaIPv4GetMaxPrefixLe // GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetMaxPrefixLenOk() (ret RegionalAreaIPv4GetMaxPrefixLenRetType, ok bool) { return getRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) } // SetMaxPrefixLen sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) SetMaxPrefixLen(v RegionalAreaIPv4GetMaxPrefixLenRetType) { setRegionalAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) } // GetMinPrefixLen returns the MinPrefixLen field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetMinPrefixLen() (ret RegionalAreaIPv4GetMinPrefixLenRetType) { ret, _ = o.GetMinPrefixLenOk() return ret @@ -253,16 +310,19 @@ func (o *RegionalAreaIPv4) GetMinPrefixLen() (ret RegionalAreaIPv4GetMinPrefixLe // GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetMinPrefixLenOk() (ret RegionalAreaIPv4GetMinPrefixLenRetType, ok bool) { return getRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) } // SetMinPrefixLen sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) SetMinPrefixLen(v RegionalAreaIPv4GetMinPrefixLenRetType) { setRegionalAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) } // GetNetworkRanges returns the NetworkRanges field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetNetworkRanges() (ret RegionalAreaIPv4GetNetworkRangesRetType) { ret, _ = o.GetNetworkRangesOk() return ret @@ -270,16 +330,19 @@ func (o *RegionalAreaIPv4) GetNetworkRanges() (ret RegionalAreaIPv4GetNetworkRan // GetNetworkRangesOk returns a tuple with the NetworkRanges field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetNetworkRangesOk() (ret RegionalAreaIPv4GetNetworkRangesRetType, ok bool) { return getRegionalAreaIPv4GetNetworkRangesAttributeTypeOk(o.NetworkRanges) } // SetNetworkRanges sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) SetNetworkRanges(v RegionalAreaIPv4GetNetworkRangesRetType) { setRegionalAreaIPv4GetNetworkRangesAttributeType(&o.NetworkRanges, v) } // GetTransferNetwork returns the TransferNetwork field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetTransferNetwork() (ret RegionalAreaIPv4GetTransferNetworkRetType) { ret, _ = o.GetTransferNetworkOk() return ret @@ -287,15 +350,18 @@ func (o *RegionalAreaIPv4) GetTransferNetwork() (ret RegionalAreaIPv4GetTransfer // GetTransferNetworkOk returns a tuple with the TransferNetwork field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) GetTransferNetworkOk() (ret RegionalAreaIPv4GetTransferNetworkRetType, ok bool) { return getRegionalAreaIPv4GetTransferNetworkAttributeTypeOk(o.TransferNetwork) } // SetTransferNetwork sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaIPv4) SetTransferNetwork(v RegionalAreaIPv4GetTransferNetworkRetType) { setRegionalAreaIPv4GetTransferNetworkAttributeType(&o.TransferNetwork, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RegionalAreaIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { @@ -319,37 +385,45 @@ func (o RegionalAreaIPv4) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRegionalAreaIPv4 struct { value *RegionalAreaIPv4 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalAreaIPv4) Get() *RegionalAreaIPv4 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalAreaIPv4) Set(val *RegionalAreaIPv4) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalAreaIPv4) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalAreaIPv4) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRegionalAreaIPv4(val *RegionalAreaIPv4) *NullableRegionalAreaIPv4 { return &NullableRegionalAreaIPv4{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalAreaIPv4) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalAreaIPv4) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_regional_area_list_response.go b/services/iaas/model_regional_area_list_response.go index af17172ec..39a8a7c66 100644 --- a/services/iaas/model_regional_area_list_response.go +++ b/services/iaas/model_regional_area_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &RegionalAreaListResponse{} */ // isContainer +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaListResponseGetRegionsAttributeType = *map[string]RegionalArea + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaListResponseGetRegionsArgType = map[string]RegionalArea + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaListResponseGetRegionsRetType = map[string]RegionalArea +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRegionalAreaListResponseGetRegionsAttributeTypeOk(arg RegionalAreaListResponseGetRegionsAttributeType) (ret RegionalAreaListResponseGetRegionsRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getRegionalAreaListResponseGetRegionsAttributeTypeOk(arg RegionalAreaListRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRegionalAreaListResponseGetRegionsAttributeType(arg *RegionalAreaListResponseGetRegionsAttributeType, val RegionalAreaListResponseGetRegionsRetType) { *arg = &val } // RegionalAreaListResponse Regional area list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RegionalAreaListResponse struct { // REQUIRED Regions RegionalAreaListResponseGetRegionsAttributeType `json:"regions" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _RegionalAreaListResponse RegionalAreaListResponse // NewRegionalAreaListResponse instantiates a new RegionalAreaListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRegionalAreaListResponse(regions RegionalAreaListResponseGetRegionsArgType) *RegionalAreaListResponse { this := RegionalAreaListResponse{} setRegionalAreaListResponseGetRegionsAttributeType(&this.Regions, regions) @@ -58,12 +69,14 @@ func NewRegionalAreaListResponse(regions RegionalAreaListResponseGetRegionsArgTy // NewRegionalAreaListResponseWithDefaults instantiates a new RegionalAreaListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRegionalAreaListResponseWithDefaults() *RegionalAreaListResponse { this := RegionalAreaListResponse{} return &this } // GetRegions returns the Regions field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaListResponse) GetRegions() (ret RegionalAreaListResponseGetRegionsRetType) { ret, _ = o.GetRegionsOk() return ret @@ -71,15 +84,18 @@ func (o *RegionalAreaListResponse) GetRegions() (ret RegionalAreaListResponseGet // GetRegionsOk returns a tuple with the Regions field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaListResponse) GetRegionsOk() (ret RegionalAreaListResponseGetRegionsRetType, ok bool) { return getRegionalAreaListResponseGetRegionsAttributeTypeOk(o.Regions) } // SetRegions sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RegionalAreaListResponse) SetRegions(v RegionalAreaListResponseGetRegionsRetType) { setRegionalAreaListResponseGetRegionsAttributeType(&o.Regions, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RegionalAreaListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRegionalAreaListResponseGetRegionsAttributeTypeOk(o.Regions); ok { @@ -88,37 +104,45 @@ func (o RegionalAreaListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRegionalAreaListResponse struct { value *RegionalAreaListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalAreaListResponse) Get() *RegionalAreaListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalAreaListResponse) Set(val *RegionalAreaListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalAreaListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalAreaListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRegionalAreaListResponse(val *RegionalAreaListResponse) *NullableRegionalAreaListResponse { return &NullableRegionalAreaListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRegionalAreaListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRegionalAreaListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_request.go b/services/iaas/model_request.go index 794a17854..54f253467 100644 --- a/services/iaas/model_request.go +++ b/services/iaas/model_request.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &Request{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetDetailsAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestGetDetailsAttributeTypeOk(arg RequestGetDetailsAttributeType) (ret RequestGetDetailsRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getRequestGetDetailsAttributeTypeOk(arg RequestGetDetailsAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestGetDetailsAttributeType(arg *RequestGetDetailsAttributeType, val RequestGetDetailsRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetDetailsArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetDetailsRetType = string /* @@ -43,8 +50,10 @@ type RequestGetDetailsRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestActionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestGetRequestActionAttributeTypeOk(arg RequestGetRequestActionAttributeType) (ret RequestGetRequestActionRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getRequestGetRequestActionAttributeTypeOk(arg RequestGetRequestActionAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestGetRequestActionAttributeType(arg *RequestGetRequestActionAttributeType, val RequestGetRequestActionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestActionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestActionRetType = string /* @@ -64,8 +77,10 @@ type RequestGetRequestActionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestGetRequestIdAttributeTypeOk(arg RequestGetRequestIdAttributeType) (ret RequestGetRequestIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +88,15 @@ func getRequestGetRequestIdAttributeTypeOk(arg RequestGetRequestIdAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestGetRequestIdAttributeType(arg *RequestGetRequestIdAttributeType, val RequestGetRequestIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestIdRetType = string /* @@ -85,8 +104,10 @@ type RequestGetRequestIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestGetRequestTypeAttributeTypeOk(arg RequestGetRequestTypeAttributeType) (ret RequestGetRequestTypeRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +115,15 @@ func getRequestGetRequestTypeAttributeTypeOk(arg RequestGetRequestTypeAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestGetRequestTypeAttributeType(arg *RequestGetRequestTypeAttributeType, val RequestGetRequestTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetRequestTypeRetType = string /* @@ -106,10 +131,16 @@ type RequestGetRequestTypeRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetResourcesAttributeType = *[]RequestResource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetResourcesArgType = []RequestResource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetResourcesRetType = []RequestResource +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestGetResourcesAttributeTypeOk(arg RequestGetResourcesAttributeType) (ret RequestGetResourcesRetType, ok bool) { if arg == nil { return ret, false @@ -117,6 +148,7 @@ func getRequestGetResourcesAttributeTypeOk(arg RequestGetResourcesAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestGetResourcesAttributeType(arg *RequestGetResourcesAttributeType, val RequestGetResourcesRetType) { *arg = &val } @@ -126,8 +158,10 @@ func setRequestGetResourcesAttributeType(arg *RequestGetResourcesAttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestGetStatusAttributeTypeOk(arg RequestGetStatusAttributeType) (ret RequestGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -135,14 +169,19 @@ func getRequestGetStatusAttributeTypeOk(arg RequestGetStatusAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestGetStatusAttributeType(arg *RequestGetStatusAttributeType, val RequestGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestGetStatusRetType = string // Request Object that represents a request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Request struct { Details RequestGetDetailsAttributeType `json:"details,omitempty"` // Object that represents a resource action. Possible values: `CREATE`, `DELETE`, `UPDATE`. @@ -161,12 +200,14 @@ type Request struct { Status RequestGetStatusAttributeType `json:"status" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Request Request // NewRequest instantiates a new Request object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRequest(requestAction RequestGetRequestActionArgType, requestId RequestGetRequestIdArgType, requestType RequestGetRequestTypeArgType, resources RequestGetResourcesArgType, status RequestGetStatusArgType) *Request { this := Request{} setRequestGetRequestActionAttributeType(&this.RequestAction, requestAction) @@ -180,12 +221,14 @@ func NewRequest(requestAction RequestGetRequestActionArgType, requestId RequestG // NewRequestWithDefaults instantiates a new Request object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRequestWithDefaults() *Request { this := Request{} return &this } // GetDetails returns the Details field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetDetails() (res RequestGetDetailsRetType) { res, _ = o.GetDetailsOk() return @@ -193,22 +236,26 @@ func (o *Request) GetDetails() (res RequestGetDetailsRetType) { // GetDetailsOk returns a tuple with the Details field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetDetailsOk() (ret RequestGetDetailsRetType, ok bool) { return getRequestGetDetailsAttributeTypeOk(o.Details) } // HasDetails returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) HasDetails() bool { _, ok := o.GetDetailsOk() return ok } // SetDetails gets a reference to the given string and assigns it to the Details field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) SetDetails(v RequestGetDetailsRetType) { setRequestGetDetailsAttributeType(&o.Details, v) } // GetRequestAction returns the RequestAction field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetRequestAction() (ret RequestGetRequestActionRetType) { ret, _ = o.GetRequestActionOk() return ret @@ -216,16 +263,19 @@ func (o *Request) GetRequestAction() (ret RequestGetRequestActionRetType) { // GetRequestActionOk returns a tuple with the RequestAction field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetRequestActionOk() (ret RequestGetRequestActionRetType, ok bool) { return getRequestGetRequestActionAttributeTypeOk(o.RequestAction) } // SetRequestAction sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) SetRequestAction(v RequestGetRequestActionRetType) { setRequestGetRequestActionAttributeType(&o.RequestAction, v) } // GetRequestId returns the RequestId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetRequestId() (ret RequestGetRequestIdRetType) { ret, _ = o.GetRequestIdOk() return ret @@ -233,16 +283,19 @@ func (o *Request) GetRequestId() (ret RequestGetRequestIdRetType) { // GetRequestIdOk returns a tuple with the RequestId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetRequestIdOk() (ret RequestGetRequestIdRetType, ok bool) { return getRequestGetRequestIdAttributeTypeOk(o.RequestId) } // SetRequestId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) SetRequestId(v RequestGetRequestIdRetType) { setRequestGetRequestIdAttributeType(&o.RequestId, v) } // GetRequestType returns the RequestType field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetRequestType() (ret RequestGetRequestTypeRetType) { ret, _ = o.GetRequestTypeOk() return ret @@ -250,16 +303,19 @@ func (o *Request) GetRequestType() (ret RequestGetRequestTypeRetType) { // GetRequestTypeOk returns a tuple with the RequestType field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetRequestTypeOk() (ret RequestGetRequestTypeRetType, ok bool) { return getRequestGetRequestTypeAttributeTypeOk(o.RequestType) } // SetRequestType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) SetRequestType(v RequestGetRequestTypeRetType) { setRequestGetRequestTypeAttributeType(&o.RequestType, v) } // GetResources returns the Resources field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetResources() (ret RequestGetResourcesRetType) { ret, _ = o.GetResourcesOk() return ret @@ -267,16 +323,19 @@ func (o *Request) GetResources() (ret RequestGetResourcesRetType) { // GetResourcesOk returns a tuple with the Resources field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetResourcesOk() (ret RequestGetResourcesRetType, ok bool) { return getRequestGetResourcesAttributeTypeOk(o.Resources) } // SetResources sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) SetResources(v RequestGetResourcesRetType) { setRequestGetResourcesAttributeType(&o.Resources, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetStatus() (ret RequestGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -284,15 +343,18 @@ func (o *Request) GetStatus() (ret RequestGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) GetStatusOk() (ret RequestGetStatusRetType, ok bool) { return getRequestGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Request) SetStatus(v RequestGetStatusRetType) { setRequestGetStatusAttributeType(&o.Status, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Request) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRequestGetDetailsAttributeTypeOk(o.Details); ok { @@ -316,37 +378,45 @@ func (o Request) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRequest struct { value *Request isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRequest) Get() *Request { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRequest) Set(val *Request) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRequest) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRequest) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRequest(val *Request) *NullableRequest { return &NullableRequest{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRequest) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRequest) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_request_resource.go b/services/iaas/model_request_resource.go index 0ac7a79b0..ca3fed401 100644 --- a/services/iaas/model_request_resource.go +++ b/services/iaas/model_request_resource.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &RequestResource{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestResourceGetIdAttributeTypeOk(arg RequestResourceGetIdAttributeType) (ret RequestResourceGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getRequestResourceGetIdAttributeTypeOk(arg RequestResourceGetIdAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestResourceGetIdAttributeType(arg *RequestResourceGetIdAttributeType, val RequestResourceGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetIdRetType = string /* @@ -43,8 +50,10 @@ type RequestResourceGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestResourceGetStatusAttributeTypeOk(arg RequestResourceGetStatusAttributeType) (ret RequestResourceGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getRequestResourceGetStatusAttributeTypeOk(arg RequestResourceGetStatusAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestResourceGetStatusAttributeType(arg *RequestResourceGetStatusAttributeType, val RequestResourceGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetStatusRetType = string /* @@ -64,8 +77,10 @@ type RequestResourceGetStatusRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRequestResourceGetTypeAttributeTypeOk(arg RequestResourceGetTypeAttributeType) (ret RequestResourceGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -73,14 +88,19 @@ func getRequestResourceGetTypeAttributeTypeOk(arg RequestResourceGetTypeAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRequestResourceGetTypeAttributeType(arg *RequestResourceGetTypeAttributeType, val RequestResourceGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResourceGetTypeRetType = string // RequestResource Object that represents a resource as part of a request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RequestResource struct { // Universally Unique Identifier (UUID). // REQUIRED @@ -93,12 +113,14 @@ type RequestResource struct { Type RequestResourceGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _RequestResource RequestResource // NewRequestResource instantiates a new RequestResource object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRequestResource(id RequestResourceGetIdArgType, status RequestResourceGetStatusArgType, types RequestResourceGetTypeArgType) *RequestResource { this := RequestResource{} setRequestResourceGetIdAttributeType(&this.Id, id) @@ -110,12 +132,14 @@ func NewRequestResource(id RequestResourceGetIdArgType, status RequestResourceGe // NewRequestResourceWithDefaults instantiates a new RequestResource object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRequestResourceWithDefaults() *RequestResource { this := RequestResource{} return &this } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) GetId() (ret RequestResourceGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -123,16 +147,19 @@ func (o *RequestResource) GetId() (ret RequestResourceGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) GetIdOk() (ret RequestResourceGetIdRetType, ok bool) { return getRequestResourceGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) SetId(v RequestResourceGetIdRetType) { setRequestResourceGetIdAttributeType(&o.Id, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) GetStatus() (ret RequestResourceGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -140,16 +167,19 @@ func (o *RequestResource) GetStatus() (ret RequestResourceGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) GetStatusOk() (ret RequestResourceGetStatusRetType, ok bool) { return getRequestResourceGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) SetStatus(v RequestResourceGetStatusRetType) { setRequestResourceGetStatusAttributeType(&o.Status, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) GetType() (ret RequestResourceGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -157,15 +187,18 @@ func (o *RequestResource) GetType() (ret RequestResourceGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) GetTypeOk() (ret RequestResourceGetTypeRetType, ok bool) { return getRequestResourceGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RequestResource) SetType(v RequestResourceGetTypeRetType) { setRequestResourceGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RequestResource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRequestResourceGetIdAttributeTypeOk(o.Id); ok { @@ -180,37 +213,45 @@ func (o RequestResource) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRequestResource struct { value *RequestResource isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRequestResource) Get() *RequestResource { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRequestResource) Set(val *RequestResource) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRequestResource) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRequestResource) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRequestResource(val *RequestResource) *NullableRequestResource { return &NullableRequestResource{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRequestResource) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRequestResource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_rescue_server_payload.go b/services/iaas/model_rescue_server_payload.go index a3c1a0ade..688d0d4c1 100644 --- a/services/iaas/model_rescue_server_payload.go +++ b/services/iaas/model_rescue_server_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &RescueServerPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RescueServerPayloadGetImageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRescueServerPayloadGetImageAttributeTypeOk(arg RescueServerPayloadGetImageAttributeType) (ret RescueServerPayloadGetImageRetType, ok bool) { if arg == nil { return ret, false @@ -31,26 +34,33 @@ func getRescueServerPayloadGetImageAttributeTypeOk(arg RescueServerPayloadGetIma return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRescueServerPayloadGetImageAttributeType(arg *RescueServerPayloadGetImageAttributeType, val RescueServerPayloadGetImageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RescueServerPayloadGetImageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RescueServerPayloadGetImageRetType = string // RescueServerPayload struct for RescueServerPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RescueServerPayload struct { // Universally Unique Identifier (UUID). // REQUIRED Image RescueServerPayloadGetImageAttributeType `json:"image" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _RescueServerPayload RescueServerPayload // NewRescueServerPayload instantiates a new RescueServerPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRescueServerPayload(image RescueServerPayloadGetImageArgType) *RescueServerPayload { this := RescueServerPayload{} setRescueServerPayloadGetImageAttributeType(&this.Image, image) @@ -60,12 +70,14 @@ func NewRescueServerPayload(image RescueServerPayloadGetImageArgType) *RescueSer // NewRescueServerPayloadWithDefaults instantiates a new RescueServerPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRescueServerPayloadWithDefaults() *RescueServerPayload { this := RescueServerPayload{} return &this } // GetImage returns the Image field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RescueServerPayload) GetImage() (ret RescueServerPayloadGetImageRetType) { ret, _ = o.GetImageOk() return ret @@ -73,15 +85,18 @@ func (o *RescueServerPayload) GetImage() (ret RescueServerPayloadGetImageRetType // GetImageOk returns a tuple with the Image field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RescueServerPayload) GetImageOk() (ret RescueServerPayloadGetImageRetType, ok bool) { return getRescueServerPayloadGetImageAttributeTypeOk(o.Image) } // SetImage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RescueServerPayload) SetImage(v RescueServerPayloadGetImageRetType) { setRescueServerPayloadGetImageAttributeType(&o.Image, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RescueServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRescueServerPayloadGetImageAttributeTypeOk(o.Image); ok { @@ -90,37 +105,45 @@ func (o RescueServerPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRescueServerPayload struct { value *RescueServerPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRescueServerPayload) Get() *RescueServerPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRescueServerPayload) Set(val *RescueServerPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRescueServerPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRescueServerPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRescueServerPayload(val *RescueServerPayload) *NullableRescueServerPayload { return &NullableRescueServerPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRescueServerPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRescueServerPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_resize_server_payload.go b/services/iaas/model_resize_server_payload.go index 43d44b431..272414989 100644 --- a/services/iaas/model_resize_server_payload.go +++ b/services/iaas/model_resize_server_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ResizeServerPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeServerPayloadGetMachineTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getResizeServerPayloadGetMachineTypeAttributeTypeOk(arg ResizeServerPayloadGetMachineTypeAttributeType) (ret ResizeServerPayloadGetMachineTypeRetType, ok bool) { if arg == nil { return ret, false @@ -31,26 +34,33 @@ func getResizeServerPayloadGetMachineTypeAttributeTypeOk(arg ResizeServerPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setResizeServerPayloadGetMachineTypeAttributeType(arg *ResizeServerPayloadGetMachineTypeAttributeType, val ResizeServerPayloadGetMachineTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeServerPayloadGetMachineTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeServerPayloadGetMachineTypeRetType = string // ResizeServerPayload struct for ResizeServerPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeServerPayload struct { // The name for a General Object. Matches Names and also UUIDs. // REQUIRED MachineType ResizeServerPayloadGetMachineTypeAttributeType `json:"machineType" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ResizeServerPayload ResizeServerPayload // NewResizeServerPayload instantiates a new ResizeServerPayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewResizeServerPayload(machineType ResizeServerPayloadGetMachineTypeArgType) *ResizeServerPayload { this := ResizeServerPayload{} setResizeServerPayloadGetMachineTypeAttributeType(&this.MachineType, machineType) @@ -60,12 +70,14 @@ func NewResizeServerPayload(machineType ResizeServerPayloadGetMachineTypeArgType // NewResizeServerPayloadWithDefaults instantiates a new ResizeServerPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewResizeServerPayloadWithDefaults() *ResizeServerPayload { this := ResizeServerPayload{} return &this } // GetMachineType returns the MachineType field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResizeServerPayload) GetMachineType() (ret ResizeServerPayloadGetMachineTypeRetType) { ret, _ = o.GetMachineTypeOk() return ret @@ -73,15 +85,18 @@ func (o *ResizeServerPayload) GetMachineType() (ret ResizeServerPayloadGetMachin // GetMachineTypeOk returns a tuple with the MachineType field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResizeServerPayload) GetMachineTypeOk() (ret ResizeServerPayloadGetMachineTypeRetType, ok bool) { return getResizeServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType) } // SetMachineType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResizeServerPayload) SetMachineType(v ResizeServerPayloadGetMachineTypeRetType) { setResizeServerPayloadGetMachineTypeAttributeType(&o.MachineType, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ResizeServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getResizeServerPayloadGetMachineTypeAttributeTypeOk(o.MachineType); ok { @@ -90,37 +105,45 @@ func (o ResizeServerPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableResizeServerPayload struct { value *ResizeServerPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableResizeServerPayload) Get() *ResizeServerPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableResizeServerPayload) Set(val *ResizeServerPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableResizeServerPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableResizeServerPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableResizeServerPayload(val *ResizeServerPayload) *NullableResizeServerPayload { return &NullableResizeServerPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableResizeServerPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableResizeServerPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_resize_volume_payload.go b/services/iaas/model_resize_volume_payload.go index 84b72bf8d..a73c7301e 100644 --- a/services/iaas/model_resize_volume_payload.go +++ b/services/iaas/model_resize_volume_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ResizeVolumePayload{} */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeVolumePayloadGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeVolumePayloadGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeVolumePayloadGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getResizeVolumePayloadGetSizeAttributeTypeOk(arg ResizeVolumePayloadGetSizeAttributeType) (ret ResizeVolumePayloadGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getResizeVolumePayloadGetSizeAttributeTypeOk(arg ResizeVolumePayloadGetSize return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setResizeVolumePayloadGetSizeAttributeType(arg *ResizeVolumePayloadGetSizeAttributeType, val ResizeVolumePayloadGetSizeRetType) { *arg = &val } // ResizeVolumePayload struct for ResizeVolumePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ResizeVolumePayload struct { // Size in Gigabyte. // REQUIRED Size ResizeVolumePayloadGetSizeAttributeType `json:"size" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ResizeVolumePayload ResizeVolumePayload // NewResizeVolumePayload instantiates a new ResizeVolumePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewResizeVolumePayload(size ResizeVolumePayloadGetSizeArgType) *ResizeVolumePayload { this := ResizeVolumePayload{} setResizeVolumePayloadGetSizeAttributeType(&this.Size, size) @@ -59,12 +70,14 @@ func NewResizeVolumePayload(size ResizeVolumePayloadGetSizeArgType) *ResizeVolum // NewResizeVolumePayloadWithDefaults instantiates a new ResizeVolumePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewResizeVolumePayloadWithDefaults() *ResizeVolumePayload { this := ResizeVolumePayload{} return &this } // GetSize returns the Size field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResizeVolumePayload) GetSize() (ret ResizeVolumePayloadGetSizeRetType) { ret, _ = o.GetSizeOk() return ret @@ -72,15 +85,18 @@ func (o *ResizeVolumePayload) GetSize() (ret ResizeVolumePayloadGetSizeRetType) // GetSizeOk returns a tuple with the Size field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResizeVolumePayload) GetSizeOk() (ret ResizeVolumePayloadGetSizeRetType, ok bool) { return getResizeVolumePayloadGetSizeAttributeTypeOk(o.Size) } // SetSize sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResizeVolumePayload) SetSize(v ResizeVolumePayloadGetSizeRetType) { setResizeVolumePayloadGetSizeAttributeType(&o.Size, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ResizeVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getResizeVolumePayloadGetSizeAttributeTypeOk(o.Size); ok { @@ -89,37 +105,45 @@ func (o ResizeVolumePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableResizeVolumePayload struct { value *ResizeVolumePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableResizeVolumePayload) Get() *ResizeVolumePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableResizeVolumePayload) Set(val *ResizeVolumePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableResizeVolumePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableResizeVolumePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableResizeVolumePayload(val *ResizeVolumePayload) *NullableResizeVolumePayload { return &NullableResizeVolumePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableResizeVolumePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableResizeVolumePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_route.go b/services/iaas/model_route.go index e59b9d4f6..40c9e4a6e 100644 --- a/services/iaas/model_route.go +++ b/services/iaas/model_route.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &Route{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRouteGetCreatedAtAttributeTypeOk(arg RouteGetCreatedAtAttributeType) (ret RouteGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getRouteGetCreatedAtAttributeTypeOk(arg RouteGetCreatedAtAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRouteGetCreatedAtAttributeType(arg *RouteGetCreatedAtAttributeType, val RouteGetCreatedAtRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setRouteGetCreatedAtAttributeType(arg *RouteGetCreatedAtAttributeType, val */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetDestinationAttributeType = *RouteDestination + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetDestinationArgType = RouteDestination + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetDestinationRetType = RouteDestination +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRouteGetDestinationAttributeTypeOk(arg RouteGetDestinationAttributeType) (ret RouteGetDestinationRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getRouteGetDestinationAttributeTypeOk(arg RouteGetDestinationAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRouteGetDestinationAttributeType(arg *RouteGetDestinationAttributeType, val RouteGetDestinationRetType) { *arg = &val } @@ -63,8 +78,10 @@ func setRouteGetDestinationAttributeType(arg *RouteGetDestinationAttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRouteGetIdAttributeTypeOk(arg RouteGetIdAttributeType) (ret RouteGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +89,15 @@ func getRouteGetIdAttributeTypeOk(arg RouteGetIdAttributeType) (ret RouteGetIdRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRouteGetIdAttributeType(arg *RouteGetIdAttributeType, val RouteGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetIdRetType = string /* @@ -84,10 +105,16 @@ type RouteGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRouteGetLabelsAttributeTypeOk(arg RouteGetLabelsAttributeType) (ret RouteGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +122,7 @@ func getRouteGetLabelsAttributeTypeOk(arg RouteGetLabelsAttributeType) (ret Rout return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRouteGetLabelsAttributeType(arg *RouteGetLabelsAttributeType, val RouteGetLabelsRetType) { *arg = &val } @@ -104,10 +132,16 @@ func setRouteGetLabelsAttributeType(arg *RouteGetLabelsAttributeType, val RouteG */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetNexthopAttributeType = *RouteNexthop + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetNexthopArgType = RouteNexthop + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetNexthopRetType = RouteNexthop +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRouteGetNexthopAttributeTypeOk(arg RouteGetNexthopAttributeType) (ret RouteGetNexthopRetType, ok bool) { if arg == nil { return ret, false @@ -115,6 +149,7 @@ func getRouteGetNexthopAttributeTypeOk(arg RouteGetNexthopAttributeType) (ret Ro return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRouteGetNexthopAttributeType(arg *RouteGetNexthopAttributeType, val RouteGetNexthopRetType) { *arg = &val } @@ -124,10 +159,16 @@ func setRouteGetNexthopAttributeType(arg *RouteGetNexthopAttributeType, val Rout */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRouteGetUpdatedAtAttributeTypeOk(arg RouteGetUpdatedAtAttributeType) (ret RouteGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +176,13 @@ func getRouteGetUpdatedAtAttributeTypeOk(arg RouteGetUpdatedAtAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRouteGetUpdatedAtAttributeType(arg *RouteGetUpdatedAtAttributeType, val RouteGetUpdatedAtRetType) { *arg = &val } // Route Object represents a network route. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Route struct { // Date-time when resource was created. CreatedAt RouteGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -147,7 +190,7 @@ type Route struct { Destination RouteGetDestinationAttributeType `json:"destination" required:"true"` // Universally Unique Identifier (UUID). Id RouteGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels RouteGetLabelsAttributeType `json:"labels,omitempty"` // REQUIRED Nexthop RouteGetNexthopAttributeType `json:"nexthop" required:"true"` @@ -155,12 +198,14 @@ type Route struct { UpdatedAt RouteGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Route Route // NewRoute instantiates a new Route object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRoute(destination RouteGetDestinationArgType, nexthop RouteGetNexthopArgType) *Route { this := Route{} setRouteGetDestinationAttributeType(&this.Destination, destination) @@ -171,12 +216,14 @@ func NewRoute(destination RouteGetDestinationArgType, nexthop RouteGetNexthopArg // NewRouteWithDefaults instantiates a new Route object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRouteWithDefaults() *Route { this := Route{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetCreatedAt() (res RouteGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -184,22 +231,26 @@ func (o *Route) GetCreatedAt() (res RouteGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetCreatedAtOk() (ret RouteGetCreatedAtRetType, ok bool) { return getRouteGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) SetCreatedAt(v RouteGetCreatedAtRetType) { setRouteGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDestination returns the Destination field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetDestination() (ret RouteGetDestinationRetType) { ret, _ = o.GetDestinationOk() return ret @@ -207,16 +258,19 @@ func (o *Route) GetDestination() (ret RouteGetDestinationRetType) { // GetDestinationOk returns a tuple with the Destination field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetDestinationOk() (ret RouteGetDestinationRetType, ok bool) { return getRouteGetDestinationAttributeTypeOk(o.Destination) } // SetDestination sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) SetDestination(v RouteGetDestinationRetType) { setRouteGetDestinationAttributeType(&o.Destination, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetId() (res RouteGetIdRetType) { res, _ = o.GetIdOk() return @@ -224,22 +278,26 @@ func (o *Route) GetId() (res RouteGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetIdOk() (ret RouteGetIdRetType, ok bool) { return getRouteGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) SetId(v RouteGetIdRetType) { setRouteGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetLabels() (res RouteGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -247,22 +305,26 @@ func (o *Route) GetLabels() (res RouteGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetLabelsOk() (ret RouteGetLabelsRetType, ok bool) { return getRouteGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) SetLabels(v RouteGetLabelsRetType) { setRouteGetLabelsAttributeType(&o.Labels, v) } // GetNexthop returns the Nexthop field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetNexthop() (ret RouteGetNexthopRetType) { ret, _ = o.GetNexthopOk() return ret @@ -270,16 +332,19 @@ func (o *Route) GetNexthop() (ret RouteGetNexthopRetType) { // GetNexthopOk returns a tuple with the Nexthop field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetNexthopOk() (ret RouteGetNexthopRetType, ok bool) { return getRouteGetNexthopAttributeTypeOk(o.Nexthop) } // SetNexthop sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) SetNexthop(v RouteGetNexthopRetType) { setRouteGetNexthopAttributeType(&o.Nexthop, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetUpdatedAt() (res RouteGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -287,21 +352,25 @@ func (o *Route) GetUpdatedAt() (res RouteGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) GetUpdatedAtOk() (ret RouteGetUpdatedAtRetType, ok bool) { return getRouteGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Route) SetUpdatedAt(v RouteGetUpdatedAtRetType) { setRouteGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Route) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRouteGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -325,37 +394,45 @@ func (o Route) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRoute struct { value *Route isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoute) Get() *Route { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoute) Set(val *Route) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoute) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoute) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRoute(val *Route) *NullableRoute { return &NullableRoute{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoute) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoute) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_route_destination.go b/services/iaas/model_route_destination.go index 2768b1ffc..9ab00e499 100644 --- a/services/iaas/model_route_destination.go +++ b/services/iaas/model_route_destination.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -16,12 +17,14 @@ import ( ) // RouteDestination - struct for RouteDestination +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteDestination struct { DestinationCIDRv4 *DestinationCIDRv4 DestinationCIDRv6 *DestinationCIDRv6 } // DestinationCIDRv4AsRouteDestination is a convenience function that returns DestinationCIDRv4 wrapped in RouteDestination +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func DestinationCIDRv4AsRouteDestination(v *DestinationCIDRv4) RouteDestination { return RouteDestination{ DestinationCIDRv4: v, @@ -29,6 +32,7 @@ func DestinationCIDRv4AsRouteDestination(v *DestinationCIDRv4) RouteDestination } // DestinationCIDRv6AsRouteDestination is a convenience function that returns DestinationCIDRv6 wrapped in RouteDestination +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func DestinationCIDRv6AsRouteDestination(v *DestinationCIDRv6) RouteDestination { return RouteDestination{ DestinationCIDRv6: v, @@ -36,6 +40,7 @@ func DestinationCIDRv6AsRouteDestination(v *DestinationCIDRv6) RouteDestination } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *RouteDestination) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -98,6 +103,7 @@ func (dst *RouteDestination) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src RouteDestination) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.DestinationCIDRv4 != nil { return json.Marshal(&src.DestinationCIDRv4) } @@ -110,6 +116,7 @@ func (src RouteDestination) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *RouteDestination) GetActualInstance() interface{} { if obj == nil { return nil @@ -126,37 +133,45 @@ func (obj *RouteDestination) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRouteDestination struct { value *RouteDestination isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteDestination) Get() *RouteDestination { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteDestination) Set(val *RouteDestination) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteDestination) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteDestination) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRouteDestination(val *RouteDestination) *NullableRouteDestination { return &NullableRouteDestination{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteDestination) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteDestination) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_route_list_response.go b/services/iaas/model_route_list_response.go index f087154e1..25baea67d 100644 --- a/services/iaas/model_route_list_response.go +++ b/services/iaas/model_route_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &RouteListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteListResponseGetItemsAttributeType = *[]Route + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteListResponseGetItemsArgType = []Route + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteListResponseGetItemsRetType = []Route +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRouteListResponseGetItemsAttributeTypeOk(arg RouteListResponseGetItemsAttributeType) (ret RouteListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getRouteListResponseGetItemsAttributeTypeOk(arg RouteListResponseGetItemsAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRouteListResponseGetItemsAttributeType(arg *RouteListResponseGetItemsAttributeType, val RouteListResponseGetItemsRetType) { *arg = &val } // RouteListResponse Route list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteListResponse struct { // A list of routes. // REQUIRED Items RouteListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _RouteListResponse RouteListResponse // NewRouteListResponse instantiates a new RouteListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRouteListResponse(items RouteListResponseGetItemsArgType) *RouteListResponse { this := RouteListResponse{} setRouteListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewRouteListResponse(items RouteListResponseGetItemsArgType) *RouteListResp // NewRouteListResponseWithDefaults instantiates a new RouteListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRouteListResponseWithDefaults() *RouteListResponse { this := RouteListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RouteListResponse) GetItems() (ret RouteListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *RouteListResponse) GetItems() (ret RouteListResponseGetItemsRetType) { // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RouteListResponse) GetItemsOk() (ret RouteListResponseGetItemsRetType, ok bool) { return getRouteListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RouteListResponse) SetItems(v RouteListResponseGetItemsRetType) { setRouteListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RouteListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRouteListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o RouteListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRouteListResponse struct { value *RouteListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteListResponse) Get() *RouteListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteListResponse) Set(val *RouteListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRouteListResponse(val *RouteListResponse) *NullableRouteListResponse { return &NullableRouteListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_route_nexthop.go b/services/iaas/model_route_nexthop.go index b353b89b3..00ff093a2 100644 --- a/services/iaas/model_route_nexthop.go +++ b/services/iaas/model_route_nexthop.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -16,6 +17,7 @@ import ( ) // RouteNexthop - struct for RouteNexthop +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RouteNexthop struct { NexthopBlackhole *NexthopBlackhole NexthopIPv4 *NexthopIPv4 @@ -24,6 +26,7 @@ type RouteNexthop struct { } // NexthopBlackholeAsRouteNexthop is a convenience function that returns NexthopBlackhole wrapped in RouteNexthop +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NexthopBlackholeAsRouteNexthop(v *NexthopBlackhole) RouteNexthop { return RouteNexthop{ NexthopBlackhole: v, @@ -31,6 +34,7 @@ func NexthopBlackholeAsRouteNexthop(v *NexthopBlackhole) RouteNexthop { } // NexthopIPv4AsRouteNexthop is a convenience function that returns NexthopIPv4 wrapped in RouteNexthop +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NexthopIPv4AsRouteNexthop(v *NexthopIPv4) RouteNexthop { return RouteNexthop{ NexthopIPv4: v, @@ -38,6 +42,7 @@ func NexthopIPv4AsRouteNexthop(v *NexthopIPv4) RouteNexthop { } // NexthopIPv6AsRouteNexthop is a convenience function that returns NexthopIPv6 wrapped in RouteNexthop +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NexthopIPv6AsRouteNexthop(v *NexthopIPv6) RouteNexthop { return RouteNexthop{ NexthopIPv6: v, @@ -45,6 +50,7 @@ func NexthopIPv6AsRouteNexthop(v *NexthopIPv6) RouteNexthop { } // NexthopInternetAsRouteNexthop is a convenience function that returns NexthopInternet wrapped in RouteNexthop +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NexthopInternetAsRouteNexthop(v *NexthopInternet) RouteNexthop { return RouteNexthop{ NexthopInternet: v, @@ -52,6 +58,7 @@ func NexthopInternetAsRouteNexthop(v *NexthopInternet) RouteNexthop { } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *RouteNexthop) UnmarshalJSON(data []byte) error { var err error // use discriminator value to speed up the lookup @@ -162,6 +169,7 @@ func (dst *RouteNexthop) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src RouteNexthop) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.NexthopBlackhole != nil { return json.Marshal(&src.NexthopBlackhole) } @@ -182,6 +190,7 @@ func (src RouteNexthop) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *RouteNexthop) GetActualInstance() interface{} { if obj == nil { return nil @@ -206,37 +215,45 @@ func (obj *RouteNexthop) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRouteNexthop struct { value *RouteNexthop isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteNexthop) Get() *RouteNexthop { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteNexthop) Set(val *RouteNexthop) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteNexthop) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteNexthop) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRouteNexthop(val *RouteNexthop) *NullableRouteNexthop { return &NullableRouteNexthop{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRouteNexthop) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRouteNexthop) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_routing_table.go b/services/iaas/model_routing_table.go index 8b1fbcdcb..70ec847d5 100644 --- a/services/iaas/model_routing_table.go +++ b/services/iaas/model_routing_table.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &RoutingTable{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTableGetCreatedAtAttributeTypeOk(arg RoutingTableGetCreatedAtAttributeType) (ret RoutingTableGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getRoutingTableGetCreatedAtAttributeTypeOk(arg RoutingTableGetCreatedAtAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTableGetCreatedAtAttributeType(arg *RoutingTableGetCreatedAtAttributeType, val RoutingTableGetCreatedAtRetType) { *arg = &val } @@ -43,10 +51,16 @@ func setRoutingTableGetCreatedAtAttributeType(arg *RoutingTableGetCreatedAtAttri */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetDefaultAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetDefaultArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetDefaultRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTablegetDefaultAttributeTypeOk(arg RoutingTablegetDefaultAttributeType) (ret RoutingTablegetDefaultRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +68,7 @@ func getRoutingTablegetDefaultAttributeTypeOk(arg RoutingTablegetDefaultAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTablegetDefaultAttributeType(arg *RoutingTablegetDefaultAttributeType, val RoutingTablegetDefaultRetType) { *arg = &val } @@ -63,8 +78,10 @@ func setRoutingTablegetDefaultAttributeType(arg *RoutingTablegetDefaultAttribute */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTableGetDescriptionAttributeTypeOk(arg RoutingTableGetDescriptionAttributeType) (ret RoutingTableGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +89,15 @@ func getRoutingTableGetDescriptionAttributeTypeOk(arg RoutingTableGetDescription return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTableGetDescriptionAttributeType(arg *RoutingTableGetDescriptionAttributeType, val RoutingTableGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetDescriptionRetType = string /* @@ -84,10 +105,16 @@ type RoutingTableGetDescriptionRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetDynamicRoutesAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetDynamicRoutesArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetDynamicRoutesRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTablegetDynamicRoutesAttributeTypeOk(arg RoutingTablegetDynamicRoutesAttributeType) (ret RoutingTablegetDynamicRoutesRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +122,7 @@ func getRoutingTablegetDynamicRoutesAttributeTypeOk(arg RoutingTablegetDynamicRo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTablegetDynamicRoutesAttributeType(arg *RoutingTablegetDynamicRoutesAttributeType, val RoutingTablegetDynamicRoutesRetType) { *arg = &val } @@ -104,8 +132,10 @@ func setRoutingTablegetDynamicRoutesAttributeType(arg *RoutingTablegetDynamicRou */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTableGetIdAttributeTypeOk(arg RoutingTableGetIdAttributeType) (ret RoutingTableGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -113,11 +143,15 @@ func getRoutingTableGetIdAttributeTypeOk(arg RoutingTableGetIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTableGetIdAttributeType(arg *RoutingTableGetIdAttributeType, val RoutingTableGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetIdRetType = string /* @@ -125,10 +159,16 @@ type RoutingTableGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTableGetLabelsAttributeTypeOk(arg RoutingTableGetLabelsAttributeType) (ret RoutingTableGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -136,6 +176,7 @@ func getRoutingTableGetLabelsAttributeTypeOk(arg RoutingTableGetLabelsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTableGetLabelsAttributeType(arg *RoutingTableGetLabelsAttributeType, val RoutingTableGetLabelsRetType) { *arg = &val } @@ -145,8 +186,10 @@ func setRoutingTableGetLabelsAttributeType(arg *RoutingTableGetLabelsAttributeTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTableGetNameAttributeTypeOk(arg RoutingTableGetNameAttributeType) (ret RoutingTableGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -154,11 +197,15 @@ func getRoutingTableGetNameAttributeTypeOk(arg RoutingTableGetNameAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTableGetNameAttributeType(arg *RoutingTableGetNameAttributeType, val RoutingTableGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetNameRetType = string /* @@ -166,10 +213,16 @@ type RoutingTableGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetSystemRoutesAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetSystemRoutesArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTablegetSystemRoutesRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTablegetSystemRoutesAttributeTypeOk(arg RoutingTablegetSystemRoutesAttributeType) (ret RoutingTablegetSystemRoutesRetType, ok bool) { if arg == nil { return ret, false @@ -177,6 +230,7 @@ func getRoutingTablegetSystemRoutesAttributeTypeOk(arg RoutingTablegetSystemRout return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTablegetSystemRoutesAttributeType(arg *RoutingTablegetSystemRoutesAttributeType, val RoutingTablegetSystemRoutesRetType) { *arg = &val } @@ -186,10 +240,16 @@ func setRoutingTablegetSystemRoutesAttributeType(arg *RoutingTablegetSystemRoute */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTableGetUpdatedAtAttributeTypeOk(arg RoutingTableGetUpdatedAtAttributeType) (ret RoutingTableGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +257,13 @@ func getRoutingTableGetUpdatedAtAttributeTypeOk(arg RoutingTableGetUpdatedAtAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTableGetUpdatedAtAttributeType(arg *RoutingTableGetUpdatedAtAttributeType, val RoutingTableGetUpdatedAtRetType) { *arg = &val } // RoutingTable An object representing a routing table. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTable struct { // Date-time when resource was created. CreatedAt RoutingTableGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -213,7 +275,7 @@ type RoutingTable struct { DynamicRoutes RoutingTablegetDynamicRoutesAttributeType `json:"dynamicRoutes,omitempty"` // Universally Unique Identifier (UUID). Id RoutingTableGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels RoutingTableGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED @@ -224,12 +286,14 @@ type RoutingTable struct { UpdatedAt RoutingTableGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _RoutingTable RoutingTable // NewRoutingTable instantiates a new RoutingTable object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRoutingTable(name RoutingTableGetNameArgType) *RoutingTable { this := RoutingTable{} setRoutingTableGetNameAttributeType(&this.Name, name) @@ -239,6 +303,7 @@ func NewRoutingTable(name RoutingTableGetNameArgType) *RoutingTable { // NewRoutingTableWithDefaults instantiates a new RoutingTable object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRoutingTableWithDefaults() *RoutingTable { this := RoutingTable{} var dynamicRoutes bool = true @@ -249,6 +314,7 @@ func NewRoutingTableWithDefaults() *RoutingTable { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetCreatedAt() (res RoutingTableGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -256,22 +322,26 @@ func (o *RoutingTable) GetCreatedAt() (res RoutingTableGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetCreatedAtOk() (ret RoutingTableGetCreatedAtRetType, ok bool) { return getRoutingTableGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetCreatedAt(v RoutingTableGetCreatedAtRetType) { setRoutingTableGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDefault returns the Default field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetDefault() (res RoutingTablegetDefaultRetType) { res, _ = o.GetDefaultOk() return @@ -279,22 +349,26 @@ func (o *RoutingTable) GetDefault() (res RoutingTablegetDefaultRetType) { // GetDefaultOk returns a tuple with the Default field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetDefaultOk() (ret RoutingTablegetDefaultRetType, ok bool) { return getRoutingTablegetDefaultAttributeTypeOk(o.Default) } // HasDefault returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) HasDefault() bool { _, ok := o.GetDefaultOk() return ok } // SetDefault gets a reference to the given bool and assigns it to the Default field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetDefault(v RoutingTablegetDefaultRetType) { setRoutingTablegetDefaultAttributeType(&o.Default, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetDescription() (res RoutingTableGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -302,22 +376,26 @@ func (o *RoutingTable) GetDescription() (res RoutingTableGetDescriptionRetType) // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetDescriptionOk() (ret RoutingTableGetDescriptionRetType, ok bool) { return getRoutingTableGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetDescription(v RoutingTableGetDescriptionRetType) { setRoutingTableGetDescriptionAttributeType(&o.Description, v) } // GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetDynamicRoutes() (res RoutingTablegetDynamicRoutesRetType) { res, _ = o.GetDynamicRoutesOk() return @@ -325,22 +403,26 @@ func (o *RoutingTable) GetDynamicRoutes() (res RoutingTablegetDynamicRoutesRetTy // GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetDynamicRoutesOk() (ret RoutingTablegetDynamicRoutesRetType, ok bool) { return getRoutingTablegetDynamicRoutesAttributeTypeOk(o.DynamicRoutes) } // HasDynamicRoutes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) HasDynamicRoutes() bool { _, ok := o.GetDynamicRoutesOk() return ok } // SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetDynamicRoutes(v RoutingTablegetDynamicRoutesRetType) { setRoutingTablegetDynamicRoutesAttributeType(&o.DynamicRoutes, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetId() (res RoutingTableGetIdRetType) { res, _ = o.GetIdOk() return @@ -348,22 +430,26 @@ func (o *RoutingTable) GetId() (res RoutingTableGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetIdOk() (ret RoutingTableGetIdRetType, ok bool) { return getRoutingTableGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetId(v RoutingTableGetIdRetType) { setRoutingTableGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetLabels() (res RoutingTableGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -371,22 +457,26 @@ func (o *RoutingTable) GetLabels() (res RoutingTableGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetLabelsOk() (ret RoutingTableGetLabelsRetType, ok bool) { return getRoutingTableGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetLabels(v RoutingTableGetLabelsRetType) { setRoutingTableGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetName() (ret RoutingTableGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -394,16 +484,19 @@ func (o *RoutingTable) GetName() (ret RoutingTableGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetNameOk() (ret RoutingTableGetNameRetType, ok bool) { return getRoutingTableGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetName(v RoutingTableGetNameRetType) { setRoutingTableGetNameAttributeType(&o.Name, v) } // GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetSystemRoutes() (res RoutingTablegetSystemRoutesRetType) { res, _ = o.GetSystemRoutesOk() return @@ -411,22 +504,26 @@ func (o *RoutingTable) GetSystemRoutes() (res RoutingTablegetSystemRoutesRetType // GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetSystemRoutesOk() (ret RoutingTablegetSystemRoutesRetType, ok bool) { return getRoutingTablegetSystemRoutesAttributeTypeOk(o.SystemRoutes) } // HasSystemRoutes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) HasSystemRoutes() bool { _, ok := o.GetSystemRoutesOk() return ok } // SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetSystemRoutes(v RoutingTablegetSystemRoutesRetType) { setRoutingTablegetSystemRoutesAttributeType(&o.SystemRoutes, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetUpdatedAt() (res RoutingTableGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -434,21 +531,25 @@ func (o *RoutingTable) GetUpdatedAt() (res RoutingTableGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) GetUpdatedAtOk() (ret RoutingTableGetUpdatedAtRetType, ok bool) { return getRoutingTableGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTable) SetUpdatedAt(v RoutingTableGetUpdatedAtRetType) { setRoutingTableGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RoutingTable) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRoutingTableGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -481,37 +582,45 @@ func (o RoutingTable) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRoutingTable struct { value *RoutingTable isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoutingTable) Get() *RoutingTable { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoutingTable) Set(val *RoutingTable) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoutingTable) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoutingTable) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRoutingTable(val *RoutingTable) *NullableRoutingTable { return &NullableRoutingTable{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoutingTable) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoutingTable) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_routing_table_list_response.go b/services/iaas/model_routing_table_list_response.go index 6f77d210e..d7eaeff7a 100644 --- a/services/iaas/model_routing_table_list_response.go +++ b/services/iaas/model_routing_table_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &RoutingTableListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableListResponseGetItemsAttributeType = *[]RoutingTable + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableListResponseGetItemsArgType = []RoutingTable + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableListResponseGetItemsRetType = []RoutingTable +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRoutingTableListResponseGetItemsAttributeTypeOk(arg RoutingTableListResponseGetItemsAttributeType) (ret RoutingTableListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getRoutingTableListResponseGetItemsAttributeTypeOk(arg RoutingTableListResp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRoutingTableListResponseGetItemsAttributeType(arg *RoutingTableListResponseGetItemsAttributeType, val RoutingTableListResponseGetItemsRetType) { *arg = &val } // RoutingTableListResponse Routing table response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RoutingTableListResponse struct { // A list of routing tables. // REQUIRED Items RoutingTableListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _RoutingTableListResponse RoutingTableListResponse // NewRoutingTableListResponse instantiates a new RoutingTableListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRoutingTableListResponse(items RoutingTableListResponseGetItemsArgType) *RoutingTableListResponse { this := RoutingTableListResponse{} setRoutingTableListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewRoutingTableListResponse(items RoutingTableListResponseGetItemsArgType) // NewRoutingTableListResponseWithDefaults instantiates a new RoutingTableListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRoutingTableListResponseWithDefaults() *RoutingTableListResponse { this := RoutingTableListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTableListResponse) GetItems() (ret RoutingTableListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *RoutingTableListResponse) GetItems() (ret RoutingTableListResponseGetIt // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTableListResponse) GetItemsOk() (ret RoutingTableListResponseGetItemsRetType, ok bool) { return getRoutingTableListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RoutingTableListResponse) SetItems(v RoutingTableListResponseGetItemsRetType) { setRoutingTableListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RoutingTableListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRoutingTableListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o RoutingTableListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRoutingTableListResponse struct { value *RoutingTableListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoutingTableListResponse) Get() *RoutingTableListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoutingTableListResponse) Set(val *RoutingTableListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoutingTableListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoutingTableListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRoutingTableListResponse(val *RoutingTableListResponse) *NullableRoutingTableListResponse { return &NullableRoutingTableListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRoutingTableListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRoutingTableListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_security_group.go b/services/iaas/model_security_group.go index 9710bce02..e9e9d20d6 100644 --- a/services/iaas/model_security_group.go +++ b/services/iaas/model_security_group.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &SecurityGroup{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupGetCreatedAtAttributeTypeOk(arg SecurityGroupGetCreatedAtAttributeType) (ret SecurityGroupGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getSecurityGroupGetCreatedAtAttributeTypeOk(arg SecurityGroupGetCreatedAtAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupGetCreatedAtAttributeType(arg *SecurityGroupGetCreatedAtAttributeType, val SecurityGroupGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setSecurityGroupGetCreatedAtAttributeType(arg *SecurityGroupGetCreatedAtAtt */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupGetDescriptionAttributeTypeOk(arg SecurityGroupGetDescriptionAttributeType) (ret SecurityGroupGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getSecurityGroupGetDescriptionAttributeTypeOk(arg SecurityGroupGetDescripti return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupGetDescriptionAttributeType(arg *SecurityGroupGetDescriptionAttributeType, val SecurityGroupGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetDescriptionRetType = string /* @@ -64,8 +78,10 @@ type SecurityGroupGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupGetIdAttributeTypeOk(arg SecurityGroupGetIdAttributeType) (ret SecurityGroupGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getSecurityGroupGetIdAttributeTypeOk(arg SecurityGroupGetIdAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupGetIdAttributeType(arg *SecurityGroupGetIdAttributeType, val SecurityGroupGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetIdRetType = string /* @@ -85,10 +105,16 @@ type SecurityGroupGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupGetLabelsAttributeTypeOk(arg SecurityGroupGetLabelsAttributeType) (ret SecurityGroupGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -96,6 +122,7 @@ func getSecurityGroupGetLabelsAttributeTypeOk(arg SecurityGroupGetLabelsAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupGetLabelsAttributeType(arg *SecurityGroupGetLabelsAttributeType, val SecurityGroupGetLabelsRetType) { *arg = &val } @@ -105,8 +132,10 @@ func setSecurityGroupGetLabelsAttributeType(arg *SecurityGroupGetLabelsAttribute */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupGetNameAttributeTypeOk(arg SecurityGroupGetNameAttributeType) (ret SecurityGroupGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -114,11 +143,15 @@ func getSecurityGroupGetNameAttributeTypeOk(arg SecurityGroupGetNameAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupGetNameAttributeType(arg *SecurityGroupGetNameAttributeType, val SecurityGroupGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetNameRetType = string /* @@ -126,10 +159,16 @@ type SecurityGroupGetNameRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetRulesAttributeType = *[]SecurityGroupRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetRulesArgType = []SecurityGroupRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetRulesRetType = []SecurityGroupRule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupGetRulesAttributeTypeOk(arg SecurityGroupGetRulesAttributeType) (ret SecurityGroupGetRulesRetType, ok bool) { if arg == nil { return ret, false @@ -137,6 +176,7 @@ func getSecurityGroupGetRulesAttributeTypeOk(arg SecurityGroupGetRulesAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupGetRulesAttributeType(arg *SecurityGroupGetRulesAttributeType, val SecurityGroupGetRulesRetType) { *arg = &val } @@ -146,10 +186,16 @@ func setSecurityGroupGetRulesAttributeType(arg *SecurityGroupGetRulesAttributeTy */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupgetStatefulAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupgetStatefulArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupgetStatefulRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupgetStatefulAttributeTypeOk(arg SecurityGroupgetStatefulAttributeType) (ret SecurityGroupgetStatefulRetType, ok bool) { if arg == nil { return ret, false @@ -157,6 +203,7 @@ func getSecurityGroupgetStatefulAttributeTypeOk(arg SecurityGroupgetStatefulAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupgetStatefulAttributeType(arg *SecurityGroupgetStatefulAttributeType, val SecurityGroupgetStatefulRetType) { *arg = &val } @@ -166,10 +213,16 @@ func setSecurityGroupgetStatefulAttributeType(arg *SecurityGroupgetStatefulAttri */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupGetUpdatedAtAttributeTypeOk(arg SecurityGroupGetUpdatedAtAttributeType) (ret SecurityGroupGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -177,11 +230,13 @@ func getSecurityGroupGetUpdatedAtAttributeTypeOk(arg SecurityGroupGetUpdatedAtAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupGetUpdatedAtAttributeType(arg *SecurityGroupGetUpdatedAtAttributeType, val SecurityGroupGetUpdatedAtRetType) { *arg = &val } // SecurityGroup Object that represents a security group. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroup struct { // Date-time when resource was created. CreatedAt SecurityGroupGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -189,7 +244,7 @@ type SecurityGroup struct { Description SecurityGroupGetDescriptionAttributeType `json:"description,omitempty"` // Universally Unique Identifier (UUID). Id SecurityGroupGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels SecurityGroupGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED @@ -202,12 +257,14 @@ type SecurityGroup struct { UpdatedAt SecurityGroupGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _SecurityGroup SecurityGroup // NewSecurityGroup instantiates a new SecurityGroup object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroup(name SecurityGroupGetNameArgType) *SecurityGroup { this := SecurityGroup{} setSecurityGroupGetNameAttributeType(&this.Name, name) @@ -217,6 +274,7 @@ func NewSecurityGroup(name SecurityGroupGetNameArgType) *SecurityGroup { // NewSecurityGroupWithDefaults instantiates a new SecurityGroup object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupWithDefaults() *SecurityGroup { this := SecurityGroup{} var stateful bool = true @@ -225,6 +283,7 @@ func NewSecurityGroupWithDefaults() *SecurityGroup { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetCreatedAt() (res SecurityGroupGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -232,22 +291,26 @@ func (o *SecurityGroup) GetCreatedAt() (res SecurityGroupGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetCreatedAtOk() (ret SecurityGroupGetCreatedAtRetType, ok bool) { return getSecurityGroupGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) SetCreatedAt(v SecurityGroupGetCreatedAtRetType) { setSecurityGroupGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetDescription() (res SecurityGroupGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -255,22 +318,26 @@ func (o *SecurityGroup) GetDescription() (res SecurityGroupGetDescriptionRetType // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetDescriptionOk() (ret SecurityGroupGetDescriptionRetType, ok bool) { return getSecurityGroupGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) SetDescription(v SecurityGroupGetDescriptionRetType) { setSecurityGroupGetDescriptionAttributeType(&o.Description, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetId() (res SecurityGroupGetIdRetType) { res, _ = o.GetIdOk() return @@ -278,22 +345,26 @@ func (o *SecurityGroup) GetId() (res SecurityGroupGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetIdOk() (ret SecurityGroupGetIdRetType, ok bool) { return getSecurityGroupGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) SetId(v SecurityGroupGetIdRetType) { setSecurityGroupGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetLabels() (res SecurityGroupGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -301,22 +372,26 @@ func (o *SecurityGroup) GetLabels() (res SecurityGroupGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetLabelsOk() (ret SecurityGroupGetLabelsRetType, ok bool) { return getSecurityGroupGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) SetLabels(v SecurityGroupGetLabelsRetType) { setSecurityGroupGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetName() (ret SecurityGroupGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -324,16 +399,19 @@ func (o *SecurityGroup) GetName() (ret SecurityGroupGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetNameOk() (ret SecurityGroupGetNameRetType, ok bool) { return getSecurityGroupGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) SetName(v SecurityGroupGetNameRetType) { setSecurityGroupGetNameAttributeType(&o.Name, v) } // GetRules returns the Rules field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetRules() (res SecurityGroupGetRulesRetType) { res, _ = o.GetRulesOk() return @@ -341,22 +419,26 @@ func (o *SecurityGroup) GetRules() (res SecurityGroupGetRulesRetType) { // GetRulesOk returns a tuple with the Rules field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetRulesOk() (ret SecurityGroupGetRulesRetType, ok bool) { return getSecurityGroupGetRulesAttributeTypeOk(o.Rules) } // HasRules returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) HasRules() bool { _, ok := o.GetRulesOk() return ok } // SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) SetRules(v SecurityGroupGetRulesRetType) { setSecurityGroupGetRulesAttributeType(&o.Rules, v) } // GetStateful returns the Stateful field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetStateful() (res SecurityGroupgetStatefulRetType) { res, _ = o.GetStatefulOk() return @@ -364,22 +446,26 @@ func (o *SecurityGroup) GetStateful() (res SecurityGroupgetStatefulRetType) { // GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetStatefulOk() (ret SecurityGroupgetStatefulRetType, ok bool) { return getSecurityGroupgetStatefulAttributeTypeOk(o.Stateful) } // HasStateful returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) HasStateful() bool { _, ok := o.GetStatefulOk() return ok } // SetStateful gets a reference to the given bool and assigns it to the Stateful field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) SetStateful(v SecurityGroupgetStatefulRetType) { setSecurityGroupgetStatefulAttributeType(&o.Stateful, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetUpdatedAt() (res SecurityGroupGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -387,21 +473,25 @@ func (o *SecurityGroup) GetUpdatedAt() (res SecurityGroupGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) GetUpdatedAtOk() (ret SecurityGroupGetUpdatedAtRetType, ok bool) { return getSecurityGroupGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroup) SetUpdatedAt(v SecurityGroupGetUpdatedAtRetType) { setSecurityGroupGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SecurityGroup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSecurityGroupGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -431,37 +521,45 @@ func (o SecurityGroup) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableSecurityGroup struct { value *SecurityGroup isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroup) Get() *SecurityGroup { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroup) Set(val *SecurityGroup) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroup) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroup) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableSecurityGroup(val *SecurityGroup) *NullableSecurityGroup { return &NullableSecurityGroup{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroup) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroup) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_security_group_list_response.go b/services/iaas/model_security_group_list_response.go index b2fcf2fc7..3a08de3b4 100644 --- a/services/iaas/model_security_group_list_response.go +++ b/services/iaas/model_security_group_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &SecurityGroupListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupListResponseGetItemsAttributeType = *[]SecurityGroup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupListResponseGetItemsArgType = []SecurityGroup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupListResponseGetItemsRetType = []SecurityGroup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupListResponseGetItemsAttributeTypeOk(arg SecurityGroupListResponseGetItemsAttributeType) (ret SecurityGroupListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getSecurityGroupListResponseGetItemsAttributeTypeOk(arg SecurityGroupListRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupListResponseGetItemsAttributeType(arg *SecurityGroupListResponseGetItemsAttributeType, val SecurityGroupListResponseGetItemsRetType) { *arg = &val } // SecurityGroupListResponse Security group list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupListResponse struct { // A list containing security group objects. // REQUIRED Items SecurityGroupListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _SecurityGroupListResponse SecurityGroupListResponse // NewSecurityGroupListResponse instantiates a new SecurityGroupListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupListResponse(items SecurityGroupListResponseGetItemsArgType) *SecurityGroupListResponse { this := SecurityGroupListResponse{} setSecurityGroupListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewSecurityGroupListResponse(items SecurityGroupListResponseGetItemsArgType // NewSecurityGroupListResponseWithDefaults instantiates a new SecurityGroupListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupListResponseWithDefaults() *SecurityGroupListResponse { this := SecurityGroupListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupListResponse) GetItems() (ret SecurityGroupListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *SecurityGroupListResponse) GetItems() (ret SecurityGroupListResponseGet // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupListResponse) GetItemsOk() (ret SecurityGroupListResponseGetItemsRetType, ok bool) { return getSecurityGroupListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupListResponse) SetItems(v SecurityGroupListResponseGetItemsRetType) { setSecurityGroupListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SecurityGroupListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSecurityGroupListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o SecurityGroupListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableSecurityGroupListResponse struct { value *SecurityGroupListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupListResponse) Get() *SecurityGroupListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupListResponse) Set(val *SecurityGroupListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableSecurityGroupListResponse(val *SecurityGroupListResponse) *NullableSecurityGroupListResponse { return &NullableSecurityGroupListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_security_group_rule.go b/services/iaas/model_security_group_rule.go index 417b3549c..16eb24426 100644 --- a/services/iaas/model_security_group_rule.go +++ b/services/iaas/model_security_group_rule.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &SecurityGroupRule{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetCreatedAtAttributeTypeOk(arg SecurityGroupRuleGetCreatedAtAttributeType) (ret SecurityGroupRuleGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getSecurityGroupRuleGetCreatedAtAttributeTypeOk(arg SecurityGroupRuleGetCre return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetCreatedAtAttributeType(arg *SecurityGroupRuleGetCreatedAtAttributeType, val SecurityGroupRuleGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setSecurityGroupRuleGetCreatedAtAttributeType(arg *SecurityGroupRuleGetCrea */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetDescriptionAttributeTypeOk(arg SecurityGroupRuleGetDescriptionAttributeType) (ret SecurityGroupRuleGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getSecurityGroupRuleGetDescriptionAttributeTypeOk(arg SecurityGroupRuleGetD return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetDescriptionAttributeType(arg *SecurityGroupRuleGetDescriptionAttributeType, val SecurityGroupRuleGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetDescriptionRetType = string /* @@ -64,8 +78,10 @@ type SecurityGroupRuleGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetDirectionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetDirectionAttributeTypeOk(arg SecurityGroupRuleGetDirectionAttributeType) (ret SecurityGroupRuleGetDirectionRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getSecurityGroupRuleGetDirectionAttributeTypeOk(arg SecurityGroupRuleGetDir return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetDirectionAttributeType(arg *SecurityGroupRuleGetDirectionAttributeType, val SecurityGroupRuleGetDirectionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetDirectionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetDirectionRetType = string /* @@ -85,8 +105,10 @@ type SecurityGroupRuleGetDirectionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetEthertypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetEthertypeAttributeTypeOk(arg SecurityGroupRuleGetEthertypeAttributeType) (ret SecurityGroupRuleGetEthertypeRetType, ok bool) { if arg == nil { return ret, false @@ -94,11 +116,15 @@ func getSecurityGroupRuleGetEthertypeAttributeTypeOk(arg SecurityGroupRuleGetEth return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetEthertypeAttributeType(arg *SecurityGroupRuleGetEthertypeAttributeType, val SecurityGroupRuleGetEthertypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetEthertypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetEthertypeRetType = string /* @@ -106,10 +132,16 @@ type SecurityGroupRuleGetEthertypeRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIcmpParametersAttributeType = *ICMPParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIcmpParametersArgType = ICMPParameters + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIcmpParametersRetType = ICMPParameters +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(arg SecurityGroupRuleGetIcmpParametersAttributeType) (ret SecurityGroupRuleGetIcmpParametersRetType, ok bool) { if arg == nil { return ret, false @@ -117,6 +149,7 @@ func getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(arg SecurityGroupRuleG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetIcmpParametersAttributeType(arg *SecurityGroupRuleGetIcmpParametersAttributeType, val SecurityGroupRuleGetIcmpParametersRetType) { *arg = &val } @@ -126,8 +159,10 @@ func setSecurityGroupRuleGetIcmpParametersAttributeType(arg *SecurityGroupRuleGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetIdAttributeTypeOk(arg SecurityGroupRuleGetIdAttributeType) (ret SecurityGroupRuleGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +170,15 @@ func getSecurityGroupRuleGetIdAttributeTypeOk(arg SecurityGroupRuleGetIdAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetIdAttributeType(arg *SecurityGroupRuleGetIdAttributeType, val SecurityGroupRuleGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIdRetType = string /* @@ -147,8 +186,10 @@ type SecurityGroupRuleGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIpRangeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetIpRangeAttributeTypeOk(arg SecurityGroupRuleGetIpRangeAttributeType) (ret SecurityGroupRuleGetIpRangeRetType, ok bool) { if arg == nil { return ret, false @@ -156,11 +197,15 @@ func getSecurityGroupRuleGetIpRangeAttributeTypeOk(arg SecurityGroupRuleGetIpRan return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetIpRangeAttributeType(arg *SecurityGroupRuleGetIpRangeAttributeType, val SecurityGroupRuleGetIpRangeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIpRangeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetIpRangeRetType = string /* @@ -168,10 +213,16 @@ type SecurityGroupRuleGetIpRangeRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetPortRangeAttributeType = *PortRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetPortRangeArgType = PortRange + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetPortRangeRetType = PortRange +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetPortRangeAttributeTypeOk(arg SecurityGroupRuleGetPortRangeAttributeType) (ret SecurityGroupRuleGetPortRangeRetType, ok bool) { if arg == nil { return ret, false @@ -179,6 +230,7 @@ func getSecurityGroupRuleGetPortRangeAttributeTypeOk(arg SecurityGroupRuleGetPor return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetPortRangeAttributeType(arg *SecurityGroupRuleGetPortRangeAttributeType, val SecurityGroupRuleGetPortRangeRetType) { *arg = &val } @@ -188,8 +240,10 @@ func setSecurityGroupRuleGetPortRangeAttributeType(arg *SecurityGroupRuleGetPort */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(arg SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType) (ret SecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +251,15 @@ func getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(arg SecurityGro return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(arg *SecurityGroupRuleGetRemoteSecurityGroupIdAttributeType, val SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetRemoteSecurityGroupIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetRemoteSecurityGroupIdRetType = string /* @@ -209,8 +267,10 @@ type SecurityGroupRuleGetRemoteSecurityGroupIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetSecurityGroupIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(arg SecurityGroupRuleGetSecurityGroupIdAttributeType) (ret SecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { if arg == nil { return ret, false @@ -218,11 +278,15 @@ func getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(arg SecurityGroupRule return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetSecurityGroupIdAttributeType(arg *SecurityGroupRuleGetSecurityGroupIdAttributeType, val SecurityGroupRuleGetSecurityGroupIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetSecurityGroupIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetSecurityGroupIdRetType = string /* @@ -230,10 +294,16 @@ type SecurityGroupRuleGetSecurityGroupIdRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetUpdatedAtAttributeTypeOk(arg SecurityGroupRuleGetUpdatedAtAttributeType) (ret SecurityGroupRuleGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -241,6 +311,7 @@ func getSecurityGroupRuleGetUpdatedAtAttributeTypeOk(arg SecurityGroupRuleGetUpd return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetUpdatedAtAttributeType(arg *SecurityGroupRuleGetUpdatedAtAttributeType, val SecurityGroupRuleGetUpdatedAtRetType) { *arg = &val } @@ -250,10 +321,16 @@ func setSecurityGroupRuleGetUpdatedAtAttributeType(arg *SecurityGroupRuleGetUpda */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetProtocolAttributeType = *Protocol + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetProtocolArgType = Protocol + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleGetProtocolRetType = Protocol +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleGetProtocolAttributeTypeOk(arg SecurityGroupRuleGetProtocolAttributeType) (ret SecurityGroupRuleGetProtocolRetType, ok bool) { if arg == nil { return ret, false @@ -261,11 +338,13 @@ func getSecurityGroupRuleGetProtocolAttributeTypeOk(arg SecurityGroupRuleGetProt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleGetProtocolAttributeType(arg *SecurityGroupRuleGetProtocolAttributeType, val SecurityGroupRuleGetProtocolRetType) { *arg = &val } // SecurityGroupRule Object that represents a security group rule. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRule struct { // Date-time when resource was created. CreatedAt SecurityGroupRuleGetCreatedAtAttributeType `json:"createdAt,omitempty"` @@ -291,12 +370,14 @@ type SecurityGroupRule struct { Protocol SecurityGroupRuleGetProtocolAttributeType `json:"protocol,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _SecurityGroupRule SecurityGroupRule // NewSecurityGroupRule instantiates a new SecurityGroupRule object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupRule(direction SecurityGroupRuleGetDirectionArgType) *SecurityGroupRule { this := SecurityGroupRule{} setSecurityGroupRuleGetDirectionAttributeType(&this.Direction, direction) @@ -306,6 +387,7 @@ func NewSecurityGroupRule(direction SecurityGroupRuleGetDirectionArgType) *Secur // NewSecurityGroupRuleWithDefaults instantiates a new SecurityGroupRule object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupRuleWithDefaults() *SecurityGroupRule { this := SecurityGroupRule{} var ethertype string = "IPv4" @@ -314,6 +396,7 @@ func NewSecurityGroupRuleWithDefaults() *SecurityGroupRule { } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetCreatedAt() (res SecurityGroupRuleGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -321,22 +404,26 @@ func (o *SecurityGroupRule) GetCreatedAt() (res SecurityGroupRuleGetCreatedAtRet // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetCreatedAtOk() (ret SecurityGroupRuleGetCreatedAtRetType, ok bool) { return getSecurityGroupRuleGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetCreatedAt(v SecurityGroupRuleGetCreatedAtRetType) { setSecurityGroupRuleGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetDescription() (res SecurityGroupRuleGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -344,22 +431,26 @@ func (o *SecurityGroupRule) GetDescription() (res SecurityGroupRuleGetDescriptio // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetDescriptionOk() (ret SecurityGroupRuleGetDescriptionRetType, ok bool) { return getSecurityGroupRuleGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetDescription(v SecurityGroupRuleGetDescriptionRetType) { setSecurityGroupRuleGetDescriptionAttributeType(&o.Description, v) } // GetDirection returns the Direction field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetDirection() (ret SecurityGroupRuleGetDirectionRetType) { ret, _ = o.GetDirectionOk() return ret @@ -367,16 +458,19 @@ func (o *SecurityGroupRule) GetDirection() (ret SecurityGroupRuleGetDirectionRet // GetDirectionOk returns a tuple with the Direction field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetDirectionOk() (ret SecurityGroupRuleGetDirectionRetType, ok bool) { return getSecurityGroupRuleGetDirectionAttributeTypeOk(o.Direction) } // SetDirection sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetDirection(v SecurityGroupRuleGetDirectionRetType) { setSecurityGroupRuleGetDirectionAttributeType(&o.Direction, v) } // GetEthertype returns the Ethertype field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetEthertype() (res SecurityGroupRuleGetEthertypeRetType) { res, _ = o.GetEthertypeOk() return @@ -384,22 +478,26 @@ func (o *SecurityGroupRule) GetEthertype() (res SecurityGroupRuleGetEthertypeRet // GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetEthertypeOk() (ret SecurityGroupRuleGetEthertypeRetType, ok bool) { return getSecurityGroupRuleGetEthertypeAttributeTypeOk(o.Ethertype) } // HasEthertype returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasEthertype() bool { _, ok := o.GetEthertypeOk() return ok } // SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetEthertype(v SecurityGroupRuleGetEthertypeRetType) { setSecurityGroupRuleGetEthertypeAttributeType(&o.Ethertype, v) } // GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetIcmpParameters() (res SecurityGroupRuleGetIcmpParametersRetType) { res, _ = o.GetIcmpParametersOk() return @@ -407,22 +505,26 @@ func (o *SecurityGroupRule) GetIcmpParameters() (res SecurityGroupRuleGetIcmpPar // GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetIcmpParametersOk() (ret SecurityGroupRuleGetIcmpParametersRetType, ok bool) { return getSecurityGroupRuleGetIcmpParametersAttributeTypeOk(o.IcmpParameters) } // HasIcmpParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasIcmpParameters() bool { _, ok := o.GetIcmpParametersOk() return ok } // SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetIcmpParameters(v SecurityGroupRuleGetIcmpParametersRetType) { setSecurityGroupRuleGetIcmpParametersAttributeType(&o.IcmpParameters, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetId() (res SecurityGroupRuleGetIdRetType) { res, _ = o.GetIdOk() return @@ -430,22 +532,26 @@ func (o *SecurityGroupRule) GetId() (res SecurityGroupRuleGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetIdOk() (ret SecurityGroupRuleGetIdRetType, ok bool) { return getSecurityGroupRuleGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetId(v SecurityGroupRuleGetIdRetType) { setSecurityGroupRuleGetIdAttributeType(&o.Id, v) } // GetIpRange returns the IpRange field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetIpRange() (res SecurityGroupRuleGetIpRangeRetType) { res, _ = o.GetIpRangeOk() return @@ -453,22 +559,26 @@ func (o *SecurityGroupRule) GetIpRange() (res SecurityGroupRuleGetIpRangeRetType // GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetIpRangeOk() (ret SecurityGroupRuleGetIpRangeRetType, ok bool) { return getSecurityGroupRuleGetIpRangeAttributeTypeOk(o.IpRange) } // HasIpRange returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasIpRange() bool { _, ok := o.GetIpRangeOk() return ok } // SetIpRange gets a reference to the given string and assigns it to the IpRange field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetIpRange(v SecurityGroupRuleGetIpRangeRetType) { setSecurityGroupRuleGetIpRangeAttributeType(&o.IpRange, v) } // GetPortRange returns the PortRange field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetPortRange() (res SecurityGroupRuleGetPortRangeRetType) { res, _ = o.GetPortRangeOk() return @@ -476,22 +586,26 @@ func (o *SecurityGroupRule) GetPortRange() (res SecurityGroupRuleGetPortRangeRet // GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetPortRangeOk() (ret SecurityGroupRuleGetPortRangeRetType, ok bool) { return getSecurityGroupRuleGetPortRangeAttributeTypeOk(o.PortRange) } // HasPortRange returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasPortRange() bool { _, ok := o.GetPortRangeOk() return ok } // SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetPortRange(v SecurityGroupRuleGetPortRangeRetType) { setSecurityGroupRuleGetPortRangeAttributeType(&o.PortRange, v) } // GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetRemoteSecurityGroupId() (res SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { res, _ = o.GetRemoteSecurityGroupIdOk() return @@ -499,22 +613,26 @@ func (o *SecurityGroupRule) GetRemoteSecurityGroupId() (res SecurityGroupRuleGet // GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetRemoteSecurityGroupIdOk() (ret SecurityGroupRuleGetRemoteSecurityGroupIdRetType, ok bool) { return getSecurityGroupRuleGetRemoteSecurityGroupIdAttributeTypeOk(o.RemoteSecurityGroupId) } // HasRemoteSecurityGroupId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasRemoteSecurityGroupId() bool { _, ok := o.GetRemoteSecurityGroupIdOk() return ok } // SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetRemoteSecurityGroupId(v SecurityGroupRuleGetRemoteSecurityGroupIdRetType) { setSecurityGroupRuleGetRemoteSecurityGroupIdAttributeType(&o.RemoteSecurityGroupId, v) } // GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetSecurityGroupId() (res SecurityGroupRuleGetSecurityGroupIdRetType) { res, _ = o.GetSecurityGroupIdOk() return @@ -522,22 +640,26 @@ func (o *SecurityGroupRule) GetSecurityGroupId() (res SecurityGroupRuleGetSecuri // GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetSecurityGroupIdOk() (ret SecurityGroupRuleGetSecurityGroupIdRetType, ok bool) { return getSecurityGroupRuleGetSecurityGroupIdAttributeTypeOk(o.SecurityGroupId) } // HasSecurityGroupId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasSecurityGroupId() bool { _, ok := o.GetSecurityGroupIdOk() return ok } // SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetSecurityGroupId(v SecurityGroupRuleGetSecurityGroupIdRetType) { setSecurityGroupRuleGetSecurityGroupIdAttributeType(&o.SecurityGroupId, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetUpdatedAt() (res SecurityGroupRuleGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -545,22 +667,26 @@ func (o *SecurityGroupRule) GetUpdatedAt() (res SecurityGroupRuleGetUpdatedAtRet // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetUpdatedAtOk() (ret SecurityGroupRuleGetUpdatedAtRetType, ok bool) { return getSecurityGroupRuleGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetUpdatedAt(v SecurityGroupRuleGetUpdatedAtRetType) { setSecurityGroupRuleGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetProtocol returns the Protocol field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetProtocol() (res SecurityGroupRuleGetProtocolRetType) { res, _ = o.GetProtocolOk() return @@ -568,21 +694,25 @@ func (o *SecurityGroupRule) GetProtocol() (res SecurityGroupRuleGetProtocolRetTy // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) GetProtocolOk() (ret SecurityGroupRuleGetProtocolRetType, ok bool) { return getSecurityGroupRuleGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) HasProtocol() bool { _, ok := o.GetProtocolOk() return ok } // SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRule) SetProtocol(v SecurityGroupRuleGetProtocolRetType) { setSecurityGroupRuleGetProtocolAttributeType(&o.Protocol, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSecurityGroupRuleGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -624,37 +754,45 @@ func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableSecurityGroupRule struct { value *SecurityGroupRule isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRule) Get() *SecurityGroupRule { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRule) Set(val *SecurityGroupRule) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRule) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRule) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableSecurityGroupRule(val *SecurityGroupRule) *NullableSecurityGroupRule { return &NullableSecurityGroupRule{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRule) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRule) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_security_group_rule_list_response.go b/services/iaas/model_security_group_rule_list_response.go index 587bbb05e..6912e81ea 100644 --- a/services/iaas/model_security_group_rule_list_response.go +++ b/services/iaas/model_security_group_rule_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &SecurityGroupRuleListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleListResponseGetItemsAttributeType = *[]SecurityGroupRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleListResponseGetItemsArgType = []SecurityGroupRule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleListResponseGetItemsRetType = []SecurityGroupRule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(arg SecurityGroupRuleListResponseGetItemsAttributeType) (ret SecurityGroupRuleListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(arg SecurityGroupRu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleListResponseGetItemsAttributeType(arg *SecurityGroupRuleListResponseGetItemsAttributeType, val SecurityGroupRuleListResponseGetItemsRetType) { *arg = &val } // SecurityGroupRuleListResponse Security group rule list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleListResponse struct { // A list containing security group rule objects. // REQUIRED Items SecurityGroupRuleListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _SecurityGroupRuleListResponse SecurityGroupRuleListResponse // NewSecurityGroupRuleListResponse instantiates a new SecurityGroupRuleListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupRuleListResponse(items SecurityGroupRuleListResponseGetItemsArgType) *SecurityGroupRuleListResponse { this := SecurityGroupRuleListResponse{} setSecurityGroupRuleListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewSecurityGroupRuleListResponse(items SecurityGroupRuleListResponseGetItem // NewSecurityGroupRuleListResponseWithDefaults instantiates a new SecurityGroupRuleListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupRuleListResponseWithDefaults() *SecurityGroupRuleListResponse { this := SecurityGroupRuleListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRuleListResponse) GetItems() (ret SecurityGroupRuleListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *SecurityGroupRuleListResponse) GetItems() (ret SecurityGroupRuleListRes // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRuleListResponse) GetItemsOk() (ret SecurityGroupRuleListResponseGetItemsRetType, ok bool) { return getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRuleListResponse) SetItems(v SecurityGroupRuleListResponseGetItemsRetType) { setSecurityGroupRuleListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SecurityGroupRuleListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSecurityGroupRuleListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o SecurityGroupRuleListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableSecurityGroupRuleListResponse struct { value *SecurityGroupRuleListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRuleListResponse) Get() *SecurityGroupRuleListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRuleListResponse) Set(val *SecurityGroupRuleListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRuleListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRuleListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableSecurityGroupRuleListResponse(val *SecurityGroupRuleListResponse) *NullableSecurityGroupRuleListResponse { return &NullableSecurityGroupRuleListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRuleListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRuleListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_security_group_rule_protocol.go b/services/iaas/model_security_group_rule_protocol.go index 835740902..db3492308 100644 --- a/services/iaas/model_security_group_rule_protocol.go +++ b/services/iaas/model_security_group_rule_protocol.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &SecurityGroupRuleProtocol{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleProtocolGetProtocolAttributeType = *Protocol + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleProtocolGetProtocolArgType = Protocol + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleProtocolGetProtocolRetType = Protocol +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(arg SecurityGroupRuleProtocolGetProtocolAttributeType) (ret SecurityGroupRuleProtocolGetProtocolRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(arg SecurityGroupRul return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSecurityGroupRuleProtocolGetProtocolAttributeType(arg *SecurityGroupRuleProtocolGetProtocolAttributeType, val SecurityGroupRuleProtocolGetProtocolRetType) { *arg = &val } // SecurityGroupRuleProtocol The internet protocol which the rule matches. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SecurityGroupRuleProtocol struct { Protocol SecurityGroupRuleProtocolGetProtocolAttributeType `json:"protocol,omitempty"` } @@ -46,6 +55,7 @@ type SecurityGroupRuleProtocol struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupRuleProtocol() *SecurityGroupRuleProtocol { this := SecurityGroupRuleProtocol{} return &this @@ -54,12 +64,14 @@ func NewSecurityGroupRuleProtocol() *SecurityGroupRuleProtocol { // NewSecurityGroupRuleProtocolWithDefaults instantiates a new SecurityGroupRuleProtocol object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSecurityGroupRuleProtocolWithDefaults() *SecurityGroupRuleProtocol { this := SecurityGroupRuleProtocol{} return &this } // GetProtocol returns the Protocol field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRuleProtocol) GetProtocol() (res SecurityGroupRuleProtocolGetProtocolRetType) { res, _ = o.GetProtocolOk() return @@ -67,21 +79,25 @@ func (o *SecurityGroupRuleProtocol) GetProtocol() (res SecurityGroupRuleProtocol // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRuleProtocol) GetProtocolOk() (ret SecurityGroupRuleProtocolGetProtocolRetType, ok bool) { return getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRuleProtocol) HasProtocol() bool { _, ok := o.GetProtocolOk() return ok } // SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SecurityGroupRuleProtocol) SetProtocol(v SecurityGroupRuleProtocolGetProtocolRetType) { setSecurityGroupRuleProtocolGetProtocolAttributeType(&o.Protocol, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSecurityGroupRuleProtocolGetProtocolAttributeTypeOk(o.Protocol); ok { @@ -90,37 +106,45 @@ func (o SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableSecurityGroupRuleProtocol struct { value *SecurityGroupRuleProtocol isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRuleProtocol) Get() *SecurityGroupRuleProtocol { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRuleProtocol) Set(val *SecurityGroupRuleProtocol) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRuleProtocol) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRuleProtocol) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableSecurityGroupRuleProtocol(val *SecurityGroupRuleProtocol) *NullableSecurityGroupRuleProtocol { return &NullableSecurityGroupRuleProtocol{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_server.go b/services/iaas/model_server.go index 2dda5c99c..72b60b624 100644 --- a/services/iaas/model_server.go +++ b/services/iaas/model_server.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &Server{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAffinityGroupAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetAffinityGroupAttributeTypeOk(arg ServerGetAffinityGroupAttributeType) (ret ServerGetAffinityGroupRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getServerGetAffinityGroupAttributeTypeOk(arg ServerGetAffinityGroupAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetAffinityGroupAttributeType(arg *ServerGetAffinityGroupAttributeType, val ServerGetAffinityGroupRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAffinityGroupArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAffinityGroupRetType = string /* @@ -44,10 +51,16 @@ type ServerGetAffinityGroupRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAgentAttributeType = *ServerAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAgentArgType = ServerAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAgentRetType = ServerAgent +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetAgentAttributeTypeOk(arg ServerGetAgentAttributeType) (ret ServerGetAgentRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getServerGetAgentAttributeTypeOk(arg ServerGetAgentAttributeType) (ret Serv return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetAgentAttributeType(arg *ServerGetAgentAttributeType, val ServerGetAgentRetType) { *arg = &val } @@ -64,8 +78,10 @@ func setServerGetAgentAttributeType(arg *ServerGetAgentAttributeType, val Server */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAvailabilityZoneAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetAvailabilityZoneAttributeTypeOk(arg ServerGetAvailabilityZoneAttributeType) (ret ServerGetAvailabilityZoneRetType, ok bool) { if arg == nil { return ret, false @@ -73,11 +89,15 @@ func getServerGetAvailabilityZoneAttributeTypeOk(arg ServerGetAvailabilityZoneAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetAvailabilityZoneAttributeType(arg *ServerGetAvailabilityZoneAttributeType, val ServerGetAvailabilityZoneRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAvailabilityZoneArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetAvailabilityZoneRetType = string /* @@ -85,10 +105,16 @@ type ServerGetAvailabilityZoneRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetBootVolumeAttributeType = *ServerBootVolume + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetBootVolumeArgType = ServerBootVolume + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetBootVolumeRetType = ServerBootVolume +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetBootVolumeAttributeTypeOk(arg ServerGetBootVolumeAttributeType) (ret ServerGetBootVolumeRetType, ok bool) { if arg == nil { return ret, false @@ -96,6 +122,7 @@ func getServerGetBootVolumeAttributeTypeOk(arg ServerGetBootVolumeAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetBootVolumeAttributeType(arg *ServerGetBootVolumeAttributeType, val ServerGetBootVolumeRetType) { *arg = &val } @@ -105,10 +132,16 @@ func setServerGetBootVolumeAttributeType(arg *ServerGetBootVolumeAttributeType, */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetCreatedAtAttributeTypeOk(arg ServerGetCreatedAtAttributeType) (ret ServerGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getServerGetCreatedAtAttributeTypeOk(arg ServerGetCreatedAtAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetCreatedAtAttributeType(arg *ServerGetCreatedAtAttributeType, val ServerGetCreatedAtRetType) { *arg = &val } @@ -125,8 +159,10 @@ func setServerGetCreatedAtAttributeType(arg *ServerGetCreatedAtAttributeType, va */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetErrorMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetErrorMessageAttributeTypeOk(arg ServerGetErrorMessageAttributeType) (ret ServerGetErrorMessageRetType, ok bool) { if arg == nil { return ret, false @@ -134,11 +170,15 @@ func getServerGetErrorMessageAttributeTypeOk(arg ServerGetErrorMessageAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetErrorMessageAttributeType(arg *ServerGetErrorMessageAttributeType, val ServerGetErrorMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetErrorMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetErrorMessageRetType = string /* @@ -146,8 +186,10 @@ type ServerGetErrorMessageRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetIdAttributeTypeOk(arg ServerGetIdAttributeType) (ret ServerGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -155,11 +197,15 @@ func getServerGetIdAttributeTypeOk(arg ServerGetIdAttributeType) (ret ServerGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetIdAttributeType(arg *ServerGetIdAttributeType, val ServerGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetIdRetType = string /* @@ -167,8 +213,10 @@ type ServerGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetImageIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetImageIdAttributeTypeOk(arg ServerGetImageIdAttributeType) (ret ServerGetImageIdRetType, ok bool) { if arg == nil { return ret, false @@ -176,11 +224,15 @@ func getServerGetImageIdAttributeTypeOk(arg ServerGetImageIdAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetImageIdAttributeType(arg *ServerGetImageIdAttributeType, val ServerGetImageIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetImageIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetImageIdRetType = string /* @@ -188,8 +240,10 @@ type ServerGetImageIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetKeypairNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetKeypairNameAttributeTypeOk(arg ServerGetKeypairNameAttributeType) (ret ServerGetKeypairNameRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +251,15 @@ func getServerGetKeypairNameAttributeTypeOk(arg ServerGetKeypairNameAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetKeypairNameAttributeType(arg *ServerGetKeypairNameAttributeType, val ServerGetKeypairNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetKeypairNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetKeypairNameRetType = string /* @@ -209,10 +267,16 @@ type ServerGetKeypairNameRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetLabelsAttributeTypeOk(arg ServerGetLabelsAttributeType) (ret ServerGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -220,6 +284,7 @@ func getServerGetLabelsAttributeTypeOk(arg ServerGetLabelsAttributeType) (ret Se return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetLabelsAttributeType(arg *ServerGetLabelsAttributeType, val ServerGetLabelsRetType) { *arg = &val } @@ -229,10 +294,16 @@ func setServerGetLabelsAttributeType(arg *ServerGetLabelsAttributeType, val Serv */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetLaunchedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetLaunchedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetLaunchedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetLaunchedAtAttributeTypeOk(arg ServerGetLaunchedAtAttributeType) (ret ServerGetLaunchedAtRetType, ok bool) { if arg == nil { return ret, false @@ -240,6 +311,7 @@ func getServerGetLaunchedAtAttributeTypeOk(arg ServerGetLaunchedAtAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetLaunchedAtAttributeType(arg *ServerGetLaunchedAtAttributeType, val ServerGetLaunchedAtRetType) { *arg = &val } @@ -249,8 +321,10 @@ func setServerGetLaunchedAtAttributeType(arg *ServerGetLaunchedAtAttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMachineTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetMachineTypeAttributeTypeOk(arg ServerGetMachineTypeAttributeType) (ret ServerGetMachineTypeRetType, ok bool) { if arg == nil { return ret, false @@ -258,11 +332,15 @@ func getServerGetMachineTypeAttributeTypeOk(arg ServerGetMachineTypeAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetMachineTypeAttributeType(arg *ServerGetMachineTypeAttributeType, val ServerGetMachineTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMachineTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMachineTypeRetType = string /* @@ -270,10 +348,16 @@ type ServerGetMachineTypeRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMaintenanceWindowAttributeType = *ServerMaintenance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMaintenanceWindowArgType = ServerMaintenance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMaintenanceWindowRetType = ServerMaintenance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetMaintenanceWindowAttributeTypeOk(arg ServerGetMaintenanceWindowAttributeType) (ret ServerGetMaintenanceWindowRetType, ok bool) { if arg == nil { return ret, false @@ -281,6 +365,7 @@ func getServerGetMaintenanceWindowAttributeTypeOk(arg ServerGetMaintenanceWindow return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetMaintenanceWindowAttributeType(arg *ServerGetMaintenanceWindowAttributeType, val ServerGetMaintenanceWindowRetType) { *arg = &val } @@ -290,10 +375,16 @@ func setServerGetMaintenanceWindowAttributeType(arg *ServerGetMaintenanceWindowA */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMetadataAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMetadataArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetMetadataRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetMetadataAttributeTypeOk(arg ServerGetMetadataAttributeType) (ret ServerGetMetadataRetType, ok bool) { if arg == nil { return ret, false @@ -301,6 +392,7 @@ func getServerGetMetadataAttributeTypeOk(arg ServerGetMetadataAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetMetadataAttributeType(arg *ServerGetMetadataAttributeType, val ServerGetMetadataRetType) { *arg = &val } @@ -310,8 +402,10 @@ func setServerGetMetadataAttributeType(arg *ServerGetMetadataAttributeType, val */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetNameAttributeTypeOk(arg ServerGetNameAttributeType) (ret ServerGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -319,11 +413,15 @@ func getServerGetNameAttributeTypeOk(arg ServerGetNameAttributeType) (ret Server return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetNameAttributeType(arg *ServerGetNameAttributeType, val ServerGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNameRetType = string /* @@ -331,10 +429,16 @@ type ServerGetNameRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNetworkingAttributeType = *ServerNetworking + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNetworkingArgType = ServerNetworking + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNetworkingRetType = ServerNetworking +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetNetworkingAttributeTypeOk(arg ServerGetNetworkingAttributeType) (ret ServerGetNetworkingRetType, ok bool) { if arg == nil { return ret, false @@ -342,6 +446,7 @@ func getServerGetNetworkingAttributeTypeOk(arg ServerGetNetworkingAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetNetworkingAttributeType(arg *ServerGetNetworkingAttributeType, val ServerGetNetworkingRetType) { *arg = &val } @@ -351,10 +456,16 @@ func setServerGetNetworkingAttributeType(arg *ServerGetNetworkingAttributeType, */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNicsAttributeType = *[]ServerNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNicsArgType = []ServerNetwork + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetNicsRetType = []ServerNetwork +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetNicsAttributeTypeOk(arg ServerGetNicsAttributeType) (ret ServerGetNicsRetType, ok bool) { if arg == nil { return ret, false @@ -362,6 +473,7 @@ func getServerGetNicsAttributeTypeOk(arg ServerGetNicsAttributeType) (ret Server return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetNicsAttributeType(arg *ServerGetNicsAttributeType, val ServerGetNicsRetType) { *arg = &val } @@ -371,8 +483,10 @@ func setServerGetNicsAttributeType(arg *ServerGetNicsAttributeType, val ServerGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetPowerStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetPowerStatusAttributeTypeOk(arg ServerGetPowerStatusAttributeType) (ret ServerGetPowerStatusRetType, ok bool) { if arg == nil { return ret, false @@ -380,11 +494,15 @@ func getServerGetPowerStatusAttributeTypeOk(arg ServerGetPowerStatusAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetPowerStatusAttributeType(arg *ServerGetPowerStatusAttributeType, val ServerGetPowerStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetPowerStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetPowerStatusRetType = string /* @@ -392,10 +510,16 @@ type ServerGetPowerStatusRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetSecurityGroupsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetSecurityGroupsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetSecurityGroupsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetSecurityGroupsAttributeTypeOk(arg ServerGetSecurityGroupsAttributeType) (ret ServerGetSecurityGroupsRetType, ok bool) { if arg == nil { return ret, false @@ -403,6 +527,7 @@ func getServerGetSecurityGroupsAttributeTypeOk(arg ServerGetSecurityGroupsAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetSecurityGroupsAttributeType(arg *ServerGetSecurityGroupsAttributeType, val ServerGetSecurityGroupsRetType) { *arg = &val } @@ -412,10 +537,16 @@ func setServerGetSecurityGroupsAttributeType(arg *ServerGetSecurityGroupsAttribu */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetServiceAccountMailsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetServiceAccountMailsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetServiceAccountMailsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetServiceAccountMailsAttributeTypeOk(arg ServerGetServiceAccountMailsAttributeType) (ret ServerGetServiceAccountMailsRetType, ok bool) { if arg == nil { return ret, false @@ -423,6 +554,7 @@ func getServerGetServiceAccountMailsAttributeTypeOk(arg ServerGetServiceAccountM return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetServiceAccountMailsAttributeType(arg *ServerGetServiceAccountMailsAttributeType, val ServerGetServiceAccountMailsRetType) { *arg = &val } @@ -432,8 +564,10 @@ func setServerGetServiceAccountMailsAttributeType(arg *ServerGetServiceAccountMa */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetStatusAttributeTypeOk(arg ServerGetStatusAttributeType) (ret ServerGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -441,11 +575,15 @@ func getServerGetStatusAttributeTypeOk(arg ServerGetStatusAttributeType) (ret Se return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetStatusAttributeType(arg *ServerGetStatusAttributeType, val ServerGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetStatusRetType = string /* @@ -453,10 +591,16 @@ type ServerGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetUpdatedAtAttributeTypeOk(arg ServerGetUpdatedAtAttributeType) (ret ServerGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -464,6 +608,7 @@ func getServerGetUpdatedAtAttributeTypeOk(arg ServerGetUpdatedAtAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetUpdatedAtAttributeType(arg *ServerGetUpdatedAtAttributeType, val ServerGetUpdatedAtRetType) { *arg = &val } @@ -473,10 +618,16 @@ func setServerGetUpdatedAtAttributeType(arg *ServerGetUpdatedAtAttributeType, va */ // isByteArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetUserDataAttributeType = *[]byte + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetUserDataArgType = []byte + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetUserDataRetType = []byte +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetUserDataAttributeTypeOk(arg ServerGetUserDataAttributeType) (ret ServerGetUserDataRetType, ok bool) { if arg == nil { return ret, false @@ -484,6 +635,7 @@ func getServerGetUserDataAttributeTypeOk(arg ServerGetUserDataAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetUserDataAttributeType(arg *ServerGetUserDataAttributeType, val ServerGetUserDataRetType) { *arg = &val } @@ -493,10 +645,16 @@ func setServerGetUserDataAttributeType(arg *ServerGetUserDataAttributeType, val */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetVolumesAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetVolumesArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerGetVolumesRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerGetVolumesAttributeTypeOk(arg ServerGetVolumesAttributeType) (ret ServerGetVolumesRetType, ok bool) { if arg == nil { return ret, false @@ -504,11 +662,13 @@ func getServerGetVolumesAttributeTypeOk(arg ServerGetVolumesAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerGetVolumesAttributeType(arg *ServerGetVolumesAttributeType, val ServerGetVolumesRetType) { *arg = &val } // Server Representation of a single server object. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Server struct { // Universally Unique Identifier (UUID). AffinityGroup ServerGetAffinityGroupAttributeType `json:"affinityGroup,omitempty"` @@ -526,7 +686,7 @@ type Server struct { ImageId ServerGetImageIdAttributeType `json:"imageId,omitempty"` // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. KeypairName ServerGetKeypairNameAttributeType `json:"keypairName,omitempty"` - // 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. + // 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. Labels ServerGetLabelsAttributeType `json:"labels,omitempty"` // Date-time when resource was launched. LaunchedAt ServerGetLaunchedAtAttributeType `json:"launchedAt,omitempty"` @@ -558,12 +718,14 @@ type Server struct { Volumes ServerGetVolumesAttributeType `json:"volumes,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Server Server // NewServer instantiates a new Server object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServer(machineType ServerGetMachineTypeArgType, name ServerGetNameArgType) *Server { this := Server{} setServerGetMachineTypeAttributeType(&this.MachineType, machineType) @@ -574,12 +736,14 @@ func NewServer(machineType ServerGetMachineTypeArgType, name ServerGetNameArgTyp // NewServerWithDefaults instantiates a new Server object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerWithDefaults() *Server { this := Server{} return &this } // GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetAffinityGroup() (res ServerGetAffinityGroupRetType) { res, _ = o.GetAffinityGroupOk() return @@ -587,22 +751,26 @@ func (o *Server) GetAffinityGroup() (res ServerGetAffinityGroupRetType) { // GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetAffinityGroupOk() (ret ServerGetAffinityGroupRetType, ok bool) { return getServerGetAffinityGroupAttributeTypeOk(o.AffinityGroup) } // HasAffinityGroup returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasAffinityGroup() bool { _, ok := o.GetAffinityGroupOk() return ok } // SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetAffinityGroup(v ServerGetAffinityGroupRetType) { setServerGetAffinityGroupAttributeType(&o.AffinityGroup, v) } // GetAgent returns the Agent field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetAgent() (res ServerGetAgentRetType) { res, _ = o.GetAgentOk() return @@ -610,22 +778,26 @@ func (o *Server) GetAgent() (res ServerGetAgentRetType) { // GetAgentOk returns a tuple with the Agent field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetAgentOk() (ret ServerGetAgentRetType, ok bool) { return getServerGetAgentAttributeTypeOk(o.Agent) } // HasAgent returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasAgent() bool { _, ok := o.GetAgentOk() return ok } // SetAgent gets a reference to the given ServerAgent and assigns it to the Agent field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetAgent(v ServerGetAgentRetType) { setServerGetAgentAttributeType(&o.Agent, v) } // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetAvailabilityZone() (res ServerGetAvailabilityZoneRetType) { res, _ = o.GetAvailabilityZoneOk() return @@ -633,22 +805,26 @@ func (o *Server) GetAvailabilityZone() (res ServerGetAvailabilityZoneRetType) { // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetAvailabilityZoneOk() (ret ServerGetAvailabilityZoneRetType, ok bool) { return getServerGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // HasAvailabilityZone returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasAvailabilityZone() bool { _, ok := o.GetAvailabilityZoneOk() return ok } // SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetAvailabilityZone(v ServerGetAvailabilityZoneRetType) { setServerGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetBootVolume returns the BootVolume field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetBootVolume() (res ServerGetBootVolumeRetType) { res, _ = o.GetBootVolumeOk() return @@ -656,22 +832,26 @@ func (o *Server) GetBootVolume() (res ServerGetBootVolumeRetType) { // GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetBootVolumeOk() (ret ServerGetBootVolumeRetType, ok bool) { return getServerGetBootVolumeAttributeTypeOk(o.BootVolume) } // HasBootVolume returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasBootVolume() bool { _, ok := o.GetBootVolumeOk() return ok } // SetBootVolume gets a reference to the given ServerBootVolume and assigns it to the BootVolume field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetBootVolume(v ServerGetBootVolumeRetType) { setServerGetBootVolumeAttributeType(&o.BootVolume, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetCreatedAt() (res ServerGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -679,22 +859,26 @@ func (o *Server) GetCreatedAt() (res ServerGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetCreatedAtOk() (ret ServerGetCreatedAtRetType, ok bool) { return getServerGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetCreatedAt(v ServerGetCreatedAtRetType) { setServerGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetErrorMessage() (res ServerGetErrorMessageRetType) { res, _ = o.GetErrorMessageOk() return @@ -702,22 +886,26 @@ func (o *Server) GetErrorMessage() (res ServerGetErrorMessageRetType) { // GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetErrorMessageOk() (ret ServerGetErrorMessageRetType, ok bool) { return getServerGetErrorMessageAttributeTypeOk(o.ErrorMessage) } // HasErrorMessage returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasErrorMessage() bool { _, ok := o.GetErrorMessageOk() return ok } // SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetErrorMessage(v ServerGetErrorMessageRetType) { setServerGetErrorMessageAttributeType(&o.ErrorMessage, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetId() (res ServerGetIdRetType) { res, _ = o.GetIdOk() return @@ -725,22 +913,26 @@ func (o *Server) GetId() (res ServerGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetIdOk() (ret ServerGetIdRetType, ok bool) { return getServerGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetId(v ServerGetIdRetType) { setServerGetIdAttributeType(&o.Id, v) } // GetImageId returns the ImageId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetImageId() (res ServerGetImageIdRetType) { res, _ = o.GetImageIdOk() return @@ -748,22 +940,26 @@ func (o *Server) GetImageId() (res ServerGetImageIdRetType) { // GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetImageIdOk() (ret ServerGetImageIdRetType, ok bool) { return getServerGetImageIdAttributeTypeOk(o.ImageId) } // HasImageId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasImageId() bool { _, ok := o.GetImageIdOk() return ok } // SetImageId gets a reference to the given string and assigns it to the ImageId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetImageId(v ServerGetImageIdRetType) { setServerGetImageIdAttributeType(&o.ImageId, v) } // GetKeypairName returns the KeypairName field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetKeypairName() (res ServerGetKeypairNameRetType) { res, _ = o.GetKeypairNameOk() return @@ -771,22 +967,26 @@ func (o *Server) GetKeypairName() (res ServerGetKeypairNameRetType) { // GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetKeypairNameOk() (ret ServerGetKeypairNameRetType, ok bool) { return getServerGetKeypairNameAttributeTypeOk(o.KeypairName) } // HasKeypairName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasKeypairName() bool { _, ok := o.GetKeypairNameOk() return ok } // SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetKeypairName(v ServerGetKeypairNameRetType) { setServerGetKeypairNameAttributeType(&o.KeypairName, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetLabels() (res ServerGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -794,22 +994,26 @@ func (o *Server) GetLabels() (res ServerGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetLabelsOk() (ret ServerGetLabelsRetType, ok bool) { return getServerGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetLabels(v ServerGetLabelsRetType) { setServerGetLabelsAttributeType(&o.Labels, v) } // GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetLaunchedAt() (res ServerGetLaunchedAtRetType) { res, _ = o.GetLaunchedAtOk() return @@ -817,22 +1021,26 @@ func (o *Server) GetLaunchedAt() (res ServerGetLaunchedAtRetType) { // GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetLaunchedAtOk() (ret ServerGetLaunchedAtRetType, ok bool) { return getServerGetLaunchedAtAttributeTypeOk(o.LaunchedAt) } // HasLaunchedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasLaunchedAt() bool { _, ok := o.GetLaunchedAtOk() return ok } // SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetLaunchedAt(v ServerGetLaunchedAtRetType) { setServerGetLaunchedAtAttributeType(&o.LaunchedAt, v) } // GetMachineType returns the MachineType field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetMachineType() (ret ServerGetMachineTypeRetType) { ret, _ = o.GetMachineTypeOk() return ret @@ -840,16 +1048,19 @@ func (o *Server) GetMachineType() (ret ServerGetMachineTypeRetType) { // GetMachineTypeOk returns a tuple with the MachineType field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetMachineTypeOk() (ret ServerGetMachineTypeRetType, ok bool) { return getServerGetMachineTypeAttributeTypeOk(o.MachineType) } // SetMachineType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetMachineType(v ServerGetMachineTypeRetType) { setServerGetMachineTypeAttributeType(&o.MachineType, v) } // GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetMaintenanceWindow() (res ServerGetMaintenanceWindowRetType) { res, _ = o.GetMaintenanceWindowOk() return @@ -857,22 +1068,26 @@ func (o *Server) GetMaintenanceWindow() (res ServerGetMaintenanceWindowRetType) // GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetMaintenanceWindowOk() (ret ServerGetMaintenanceWindowRetType, ok bool) { return getServerGetMaintenanceWindowAttributeTypeOk(o.MaintenanceWindow) } // HasMaintenanceWindow returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasMaintenanceWindow() bool { _, ok := o.GetMaintenanceWindowOk() return ok } // SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetMaintenanceWindow(v ServerGetMaintenanceWindowRetType) { setServerGetMaintenanceWindowAttributeType(&o.MaintenanceWindow, v) } // GetMetadata returns the Metadata field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetMetadata() (res ServerGetMetadataRetType) { res, _ = o.GetMetadataOk() return @@ -880,22 +1095,26 @@ func (o *Server) GetMetadata() (res ServerGetMetadataRetType) { // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetMetadataOk() (ret ServerGetMetadataRetType, ok bool) { return getServerGetMetadataAttributeTypeOk(o.Metadata) } // HasMetadata returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasMetadata() bool { _, ok := o.GetMetadataOk() return ok } // SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetMetadata(v ServerGetMetadataRetType) { setServerGetMetadataAttributeType(&o.Metadata, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetName() (ret ServerGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -903,16 +1122,19 @@ func (o *Server) GetName() (ret ServerGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetNameOk() (ret ServerGetNameRetType, ok bool) { return getServerGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetName(v ServerGetNameRetType) { setServerGetNameAttributeType(&o.Name, v) } // GetNetworking returns the Networking field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetNetworking() (res ServerGetNetworkingRetType) { res, _ = o.GetNetworkingOk() return @@ -920,22 +1142,26 @@ func (o *Server) GetNetworking() (res ServerGetNetworkingRetType) { // GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetNetworkingOk() (ret ServerGetNetworkingRetType, ok bool) { return getServerGetNetworkingAttributeTypeOk(o.Networking) } // HasNetworking returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasNetworking() bool { _, ok := o.GetNetworkingOk() return ok } // SetNetworking gets a reference to the given ServerNetworking and assigns it to the Networking field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetNetworking(v ServerGetNetworkingRetType) { setServerGetNetworkingAttributeType(&o.Networking, v) } // GetNics returns the Nics field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetNics() (res ServerGetNicsRetType) { res, _ = o.GetNicsOk() return @@ -943,22 +1169,26 @@ func (o *Server) GetNics() (res ServerGetNicsRetType) { // GetNicsOk returns a tuple with the Nics field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetNicsOk() (ret ServerGetNicsRetType, ok bool) { return getServerGetNicsAttributeTypeOk(o.Nics) } // HasNics returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasNics() bool { _, ok := o.GetNicsOk() return ok } // SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetNics(v ServerGetNicsRetType) { setServerGetNicsAttributeType(&o.Nics, v) } // GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetPowerStatus() (res ServerGetPowerStatusRetType) { res, _ = o.GetPowerStatusOk() return @@ -966,22 +1196,26 @@ func (o *Server) GetPowerStatus() (res ServerGetPowerStatusRetType) { // GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetPowerStatusOk() (ret ServerGetPowerStatusRetType, ok bool) { return getServerGetPowerStatusAttributeTypeOk(o.PowerStatus) } // HasPowerStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasPowerStatus() bool { _, ok := o.GetPowerStatusOk() return ok } // SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetPowerStatus(v ServerGetPowerStatusRetType) { setServerGetPowerStatusAttributeType(&o.PowerStatus, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetSecurityGroups() (res ServerGetSecurityGroupsRetType) { res, _ = o.GetSecurityGroupsOk() return @@ -989,22 +1223,26 @@ func (o *Server) GetSecurityGroups() (res ServerGetSecurityGroupsRetType) { // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetSecurityGroupsOk() (ret ServerGetSecurityGroupsRetType, ok bool) { return getServerGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasSecurityGroups() bool { _, ok := o.GetSecurityGroupsOk() return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetSecurityGroups(v ServerGetSecurityGroupsRetType) { setServerGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } // GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetServiceAccountMails() (res ServerGetServiceAccountMailsRetType) { res, _ = o.GetServiceAccountMailsOk() return @@ -1012,22 +1250,26 @@ func (o *Server) GetServiceAccountMails() (res ServerGetServiceAccountMailsRetTy // GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetServiceAccountMailsOk() (ret ServerGetServiceAccountMailsRetType, ok bool) { return getServerGetServiceAccountMailsAttributeTypeOk(o.ServiceAccountMails) } // HasServiceAccountMails returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasServiceAccountMails() bool { _, ok := o.GetServiceAccountMailsOk() return ok } // SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetServiceAccountMails(v ServerGetServiceAccountMailsRetType) { setServerGetServiceAccountMailsAttributeType(&o.ServiceAccountMails, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetStatus() (res ServerGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -1035,22 +1277,26 @@ func (o *Server) GetStatus() (res ServerGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetStatusOk() (ret ServerGetStatusRetType, ok bool) { return getServerGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetStatus(v ServerGetStatusRetType) { setServerGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetUpdatedAt() (res ServerGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -1058,22 +1304,26 @@ func (o *Server) GetUpdatedAt() (res ServerGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetUpdatedAtOk() (ret ServerGetUpdatedAtRetType, ok bool) { return getServerGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetUpdatedAt(v ServerGetUpdatedAtRetType) { setServerGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetUserData returns the UserData field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetUserData() (res ServerGetUserDataRetType) { res, _ = o.GetUserDataOk() return @@ -1081,22 +1331,26 @@ func (o *Server) GetUserData() (res ServerGetUserDataRetType) { // GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetUserDataOk() (ret ServerGetUserDataRetType, ok bool) { return getServerGetUserDataAttributeTypeOk(o.UserData) } // HasUserData returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasUserData() bool { _, ok := o.GetUserDataOk() return ok } // SetUserData gets a reference to the given string and assigns it to the UserData field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetUserData(v ServerGetUserDataRetType) { setServerGetUserDataAttributeType(&o.UserData, v) } // GetVolumes returns the Volumes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetVolumes() (res ServerGetVolumesRetType) { res, _ = o.GetVolumesOk() return @@ -1104,21 +1358,25 @@ func (o *Server) GetVolumes() (res ServerGetVolumesRetType) { // GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) GetVolumesOk() (ret ServerGetVolumesRetType, ok bool) { return getServerGetVolumesAttributeTypeOk(o.Volumes) } // HasVolumes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) HasVolumes() bool { _, ok := o.GetVolumesOk() return ok } // SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Server) SetVolumes(v ServerGetVolumesRetType) { setServerGetVolumesAttributeType(&o.Volumes, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Server) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServerGetAffinityGroupAttributeTypeOk(o.AffinityGroup); ok { @@ -1196,37 +1454,45 @@ func (o Server) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServer struct { value *Server isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServer) Get() *Server { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServer) Set(val *Server) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServer) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServer) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServer(val *Server) *NullableServer { return &NullableServer{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServer) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServer) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_server_agent.go b/services/iaas/model_server_agent.go index e055eba52..dcab50b9c 100644 --- a/services/iaas/model_server_agent.go +++ b/services/iaas/model_server_agent.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ServerAgent{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerAgentgetProvisionedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerAgentgetProvisionedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerAgentgetProvisionedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerAgentgetProvisionedAttributeTypeOk(arg ServerAgentgetProvisionedAttributeType) (ret ServerAgentgetProvisionedRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getServerAgentgetProvisionedAttributeTypeOk(arg ServerAgentgetProvisionedAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerAgentgetProvisionedAttributeType(arg *ServerAgentgetProvisionedAttributeType, val ServerAgentgetProvisionedRetType) { *arg = &val } // ServerAgent STACKIT server agent options for a server. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerAgent struct { // Configure the STACKIT server agent provisioning during the first boot of the server. Only works when booting from an images that supports the STACKIT server agent. When `false` the agent IS NOT installed. When `true` the agent IS installed. When its not set the result depend on the used image and its default provisioning setting. Provisioned ServerAgentgetProvisionedAttributeType `json:"provisioned,omitempty"` @@ -47,6 +56,7 @@ type ServerAgent struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerAgent() *ServerAgent { this := ServerAgent{} return &this @@ -55,12 +65,14 @@ func NewServerAgent() *ServerAgent { // NewServerAgentWithDefaults instantiates a new ServerAgent object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerAgentWithDefaults() *ServerAgent { this := ServerAgent{} return &this } // GetProvisioned returns the Provisioned field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerAgent) GetProvisioned() (res ServerAgentgetProvisionedRetType) { res, _ = o.GetProvisionedOk() return @@ -68,21 +80,25 @@ func (o *ServerAgent) GetProvisioned() (res ServerAgentgetProvisionedRetType) { // GetProvisionedOk returns a tuple with the Provisioned field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerAgent) GetProvisionedOk() (ret ServerAgentgetProvisionedRetType, ok bool) { return getServerAgentgetProvisionedAttributeTypeOk(o.Provisioned) } // HasProvisioned returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerAgent) HasProvisioned() bool { _, ok := o.GetProvisionedOk() return ok } // SetProvisioned gets a reference to the given bool and assigns it to the Provisioned field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerAgent) SetProvisioned(v ServerAgentgetProvisionedRetType) { setServerAgentgetProvisionedAttributeType(&o.Provisioned, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServerAgent) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServerAgentgetProvisionedAttributeTypeOk(o.Provisioned); ok { @@ -91,37 +107,45 @@ func (o ServerAgent) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServerAgent struct { value *ServerAgent isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerAgent) Get() *ServerAgent { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerAgent) Set(val *ServerAgent) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerAgent) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerAgent) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServerAgent(val *ServerAgent) *NullableServerAgent { return &NullableServerAgent{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerAgent) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerAgent) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_server_boot_volume.go b/services/iaas/model_server_boot_volume.go index 933b03dda..da9dd3427 100644 --- a/services/iaas/model_server_boot_volume.go +++ b/services/iaas/model_server_boot_volume.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ServerBootVolume{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumegetDeleteOnTerminationAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumegetDeleteOnTerminationArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumegetDeleteOnTerminationRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(arg ServerBootVolumegetDeleteOnTerminationAttributeType) (ret ServerBootVolumegetDeleteOnTerminationRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(arg ServerBootVolu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerBootVolumegetDeleteOnTerminationAttributeType(arg *ServerBootVolumegetDeleteOnTerminationAttributeType, val ServerBootVolumegetDeleteOnTerminationRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setServerBootVolumegetDeleteOnTerminationAttributeType(arg *ServerBootVolum */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerBootVolumeGetIdAttributeTypeOk(arg ServerBootVolumeGetIdAttributeType) (ret ServerBootVolumeGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getServerBootVolumeGetIdAttributeTypeOk(arg ServerBootVolumeGetIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerBootVolumeGetIdAttributeType(arg *ServerBootVolumeGetIdAttributeType, val ServerBootVolumeGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetIdRetType = string /* @@ -63,8 +77,10 @@ type ServerBootVolumeGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetPerformanceClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerBootVolumeGetPerformanceClassAttributeTypeOk(arg ServerBootVolumeGetPerformanceClassAttributeType) (ret ServerBootVolumeGetPerformanceClassRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getServerBootVolumeGetPerformanceClassAttributeTypeOk(arg ServerBootVolumeG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerBootVolumeGetPerformanceClassAttributeType(arg *ServerBootVolumeGetPerformanceClassAttributeType, val ServerBootVolumeGetPerformanceClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetPerformanceClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetPerformanceClassRetType = string /* @@ -84,10 +104,16 @@ type ServerBootVolumeGetPerformanceClassRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerBootVolumeGetSizeAttributeTypeOk(arg ServerBootVolumeGetSizeAttributeType) (ret ServerBootVolumeGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -95,6 +121,7 @@ func getServerBootVolumeGetSizeAttributeTypeOk(arg ServerBootVolumeGetSizeAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerBootVolumeGetSizeAttributeType(arg *ServerBootVolumeGetSizeAttributeType, val ServerBootVolumeGetSizeRetType) { *arg = &val } @@ -104,10 +131,16 @@ func setServerBootVolumeGetSizeAttributeType(arg *ServerBootVolumeGetSizeAttribu */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetSourceAttributeType = *BootVolumeSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetSourceArgType = BootVolumeSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolumeGetSourceRetType = BootVolumeSource +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerBootVolumeGetSourceAttributeTypeOk(arg ServerBootVolumeGetSourceAttributeType) (ret ServerBootVolumeGetSourceRetType, ok bool) { if arg == nil { return ret, false @@ -115,11 +148,13 @@ func getServerBootVolumeGetSourceAttributeTypeOk(arg ServerBootVolumeGetSourceAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerBootVolumeGetSourceAttributeType(arg *ServerBootVolumeGetSourceAttributeType, val ServerBootVolumeGetSourceRetType) { *arg = &val } // ServerBootVolume struct for ServerBootVolume +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerBootVolume struct { // Delete the volume during the termination of the server. Defaults to false. DeleteOnTermination ServerBootVolumegetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` @@ -136,6 +171,7 @@ type ServerBootVolume struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerBootVolume() *ServerBootVolume { this := ServerBootVolume{} return &this @@ -144,12 +180,14 @@ func NewServerBootVolume() *ServerBootVolume { // NewServerBootVolumeWithDefaults instantiates a new ServerBootVolume object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerBootVolumeWithDefaults() *ServerBootVolume { this := ServerBootVolume{} return &this } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetDeleteOnTermination() (res ServerBootVolumegetDeleteOnTerminationRetType) { res, _ = o.GetDeleteOnTerminationOk() return @@ -157,22 +195,26 @@ func (o *ServerBootVolume) GetDeleteOnTermination() (res ServerBootVolumegetDele // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetDeleteOnTerminationOk() (ret ServerBootVolumegetDeleteOnTerminationRetType, ok bool) { return getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) HasDeleteOnTermination() bool { _, ok := o.GetDeleteOnTerminationOk() return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) SetDeleteOnTermination(v ServerBootVolumegetDeleteOnTerminationRetType) { setServerBootVolumegetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetId() (res ServerBootVolumeGetIdRetType) { res, _ = o.GetIdOk() return @@ -180,22 +222,26 @@ func (o *ServerBootVolume) GetId() (res ServerBootVolumeGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetIdOk() (ret ServerBootVolumeGetIdRetType, ok bool) { return getServerBootVolumeGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) SetId(v ServerBootVolumeGetIdRetType) { setServerBootVolumeGetIdAttributeType(&o.Id, v) } // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetPerformanceClass() (res ServerBootVolumeGetPerformanceClassRetType) { res, _ = o.GetPerformanceClassOk() return @@ -203,22 +249,26 @@ func (o *ServerBootVolume) GetPerformanceClass() (res ServerBootVolumeGetPerform // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetPerformanceClassOk() (ret ServerBootVolumeGetPerformanceClassRetType, ok bool) { return getServerBootVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) } // HasPerformanceClass returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) HasPerformanceClass() bool { _, ok := o.GetPerformanceClassOk() return ok } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) SetPerformanceClass(v ServerBootVolumeGetPerformanceClassRetType) { setServerBootVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetSize() (res ServerBootVolumeGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -226,22 +276,26 @@ func (o *ServerBootVolume) GetSize() (res ServerBootVolumeGetSizeRetType) { // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetSizeOk() (ret ServerBootVolumeGetSizeRetType, ok bool) { return getServerBootVolumeGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) SetSize(v ServerBootVolumeGetSizeRetType) { setServerBootVolumeGetSizeAttributeType(&o.Size, v) } // GetSource returns the Source field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetSource() (res ServerBootVolumeGetSourceRetType) { res, _ = o.GetSourceOk() return @@ -249,21 +303,25 @@ func (o *ServerBootVolume) GetSource() (res ServerBootVolumeGetSourceRetType) { // GetSourceOk returns a tuple with the Source field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) GetSourceOk() (ret ServerBootVolumeGetSourceRetType, ok bool) { return getServerBootVolumeGetSourceAttributeTypeOk(o.Source) } // HasSource returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) HasSource() bool { _, ok := o.GetSourceOk() return ok } // SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerBootVolume) SetSource(v ServerBootVolumeGetSourceRetType) { setServerBootVolumeGetSourceAttributeType(&o.Source, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServerBootVolume) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServerBootVolumegetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { @@ -284,37 +342,45 @@ func (o ServerBootVolume) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServerBootVolume struct { value *ServerBootVolume isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerBootVolume) Get() *ServerBootVolume { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerBootVolume) Set(val *ServerBootVolume) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerBootVolume) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerBootVolume) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServerBootVolume(val *ServerBootVolume) *NullableServerBootVolume { return &NullableServerBootVolume{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerBootVolume) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerBootVolume) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_server_console_url.go b/services/iaas/model_server_console_url.go index 1392501ed..29fca5968 100644 --- a/services/iaas/model_server_console_url.go +++ b/services/iaas/model_server_console_url.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ServerConsoleUrl{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerConsoleUrlGetUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerConsoleUrlGetUrlAttributeTypeOk(arg ServerConsoleUrlGetUrlAttributeType) (ret ServerConsoleUrlGetUrlRetType, ok bool) { if arg == nil { return ret, false @@ -31,25 +34,32 @@ func getServerConsoleUrlGetUrlAttributeTypeOk(arg ServerConsoleUrlGetUrlAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerConsoleUrlGetUrlAttributeType(arg *ServerConsoleUrlGetUrlAttributeType, val ServerConsoleUrlGetUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerConsoleUrlGetUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerConsoleUrlGetUrlRetType = string // ServerConsoleUrl Object that represents a server console URL. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerConsoleUrl struct { // REQUIRED Url ServerConsoleUrlGetUrlAttributeType `json:"url" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ServerConsoleUrl ServerConsoleUrl // NewServerConsoleUrl instantiates a new ServerConsoleUrl object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerConsoleUrl(url ServerConsoleUrlGetUrlArgType) *ServerConsoleUrl { this := ServerConsoleUrl{} setServerConsoleUrlGetUrlAttributeType(&this.Url, url) @@ -59,12 +69,14 @@ func NewServerConsoleUrl(url ServerConsoleUrlGetUrlArgType) *ServerConsoleUrl { // NewServerConsoleUrlWithDefaults instantiates a new ServerConsoleUrl object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerConsoleUrlWithDefaults() *ServerConsoleUrl { this := ServerConsoleUrl{} return &this } // GetUrl returns the Url field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerConsoleUrl) GetUrl() (ret ServerConsoleUrlGetUrlRetType) { ret, _ = o.GetUrlOk() return ret @@ -72,15 +84,18 @@ func (o *ServerConsoleUrl) GetUrl() (ret ServerConsoleUrlGetUrlRetType) { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerConsoleUrl) GetUrlOk() (ret ServerConsoleUrlGetUrlRetType, ok bool) { return getServerConsoleUrlGetUrlAttributeTypeOk(o.Url) } // SetUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerConsoleUrl) SetUrl(v ServerConsoleUrlGetUrlRetType) { setServerConsoleUrlGetUrlAttributeType(&o.Url, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServerConsoleUrl) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServerConsoleUrlGetUrlAttributeTypeOk(o.Url); ok { @@ -89,37 +104,45 @@ func (o ServerConsoleUrl) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServerConsoleUrl struct { value *ServerConsoleUrl isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerConsoleUrl) Get() *ServerConsoleUrl { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerConsoleUrl) Set(val *ServerConsoleUrl) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerConsoleUrl) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerConsoleUrl) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServerConsoleUrl(val *ServerConsoleUrl) *NullableServerConsoleUrl { return &NullableServerConsoleUrl{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerConsoleUrl) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerConsoleUrl) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_server_list_response.go b/services/iaas/model_server_list_response.go index bd8e29740..587dcd98c 100644 --- a/services/iaas/model_server_list_response.go +++ b/services/iaas/model_server_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ServerListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerListResponseGetItemsAttributeType = *[]Server + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerListResponseGetItemsArgType = []Server + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerListResponseGetItemsRetType = []Server +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerListResponseGetItemsAttributeTypeOk(arg ServerListResponseGetItemsAttributeType) (ret ServerListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getServerListResponseGetItemsAttributeTypeOk(arg ServerListResponseGetItems return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerListResponseGetItemsAttributeType(arg *ServerListResponseGetItemsAttributeType, val ServerListResponseGetItemsRetType) { *arg = &val } // ServerListResponse Response object for server list request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerListResponse struct { // A list of servers. // REQUIRED Items ServerListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ServerListResponse ServerListResponse // NewServerListResponse instantiates a new ServerListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerListResponse(items ServerListResponseGetItemsArgType) *ServerListResponse { this := ServerListResponse{} setServerListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewServerListResponse(items ServerListResponseGetItemsArgType) *ServerListR // NewServerListResponseWithDefaults instantiates a new ServerListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerListResponseWithDefaults() *ServerListResponse { this := ServerListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerListResponse) GetItems() (ret ServerListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *ServerListResponse) GetItems() (ret ServerListResponseGetItemsRetType) // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerListResponse) GetItemsOk() (ret ServerListResponseGetItemsRetType, ok bool) { return getServerListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerListResponse) SetItems(v ServerListResponseGetItemsRetType) { setServerListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServerListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServerListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o ServerListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServerListResponse struct { value *ServerListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerListResponse) Get() *ServerListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerListResponse) Set(val *ServerListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServerListResponse(val *ServerListResponse) *NullableServerListResponse { return &NullableServerListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_server_maintenance.go b/services/iaas/model_server_maintenance.go index e81e4483b..aa329ff60 100644 --- a/services/iaas/model_server_maintenance.go +++ b/services/iaas/model_server_maintenance.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &ServerMaintenance{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetDetailsAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerMaintenanceGetDetailsAttributeTypeOk(arg ServerMaintenanceGetDetailsAttributeType) (ret ServerMaintenanceGetDetailsRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getServerMaintenanceGetDetailsAttributeTypeOk(arg ServerMaintenanceGetDetai return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerMaintenanceGetDetailsAttributeType(arg *ServerMaintenanceGetDetailsAttributeType, val ServerMaintenanceGetDetailsRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetDetailsArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetDetailsRetType = string /* @@ -44,10 +51,16 @@ type ServerMaintenanceGetDetailsRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetEndsAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetEndsAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetEndsAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerMaintenanceGetEndsAtAttributeTypeOk(arg ServerMaintenanceGetEndsAtAttributeType) (ret ServerMaintenanceGetEndsAtRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getServerMaintenanceGetEndsAtAttributeTypeOk(arg ServerMaintenanceGetEndsAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerMaintenanceGetEndsAtAttributeType(arg *ServerMaintenanceGetEndsAtAttributeType, val ServerMaintenanceGetEndsAtRetType) { *arg = &val } @@ -64,10 +78,16 @@ func setServerMaintenanceGetEndsAtAttributeType(arg *ServerMaintenanceGetEndsAtA */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetStartsAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetStartsAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetStartsAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerMaintenanceGetStartsAtAttributeTypeOk(arg ServerMaintenanceGetStartsAtAttributeType) (ret ServerMaintenanceGetStartsAtRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getServerMaintenanceGetStartsAtAttributeTypeOk(arg ServerMaintenanceGetStar return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerMaintenanceGetStartsAtAttributeType(arg *ServerMaintenanceGetStartsAtAttributeType, val ServerMaintenanceGetStartsAtRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setServerMaintenanceGetStartsAtAttributeType(arg *ServerMaintenanceGetStart */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerMaintenanceGetStatusAttributeTypeOk(arg ServerMaintenanceGetStatusAttributeType) (ret ServerMaintenanceGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -93,14 +116,19 @@ func getServerMaintenanceGetStatusAttributeTypeOk(arg ServerMaintenanceGetStatus return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerMaintenanceGetStatusAttributeType(arg *ServerMaintenanceGetStatusAttributeType, val ServerMaintenanceGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenanceGetStatusRetType = string // ServerMaintenance Object that represents the information about the next planned server maintenance window. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerMaintenance struct { Details ServerMaintenanceGetDetailsAttributeType `json:"details,omitempty"` // End of the maintenance window. @@ -114,12 +142,14 @@ type ServerMaintenance struct { Status ServerMaintenanceGetStatusAttributeType `json:"status" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ServerMaintenance ServerMaintenance // NewServerMaintenance instantiates a new ServerMaintenance object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerMaintenance(endsAt ServerMaintenanceGetEndsAtArgType, startsAt ServerMaintenanceGetStartsAtArgType, status ServerMaintenanceGetStatusArgType) *ServerMaintenance { this := ServerMaintenance{} setServerMaintenanceGetEndsAtAttributeType(&this.EndsAt, endsAt) @@ -131,12 +161,14 @@ func NewServerMaintenance(endsAt ServerMaintenanceGetEndsAtArgType, startsAt Ser // NewServerMaintenanceWithDefaults instantiates a new ServerMaintenance object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerMaintenanceWithDefaults() *ServerMaintenance { this := ServerMaintenance{} return &this } // GetDetails returns the Details field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) GetDetails() (res ServerMaintenanceGetDetailsRetType) { res, _ = o.GetDetailsOk() return @@ -144,22 +176,26 @@ func (o *ServerMaintenance) GetDetails() (res ServerMaintenanceGetDetailsRetType // GetDetailsOk returns a tuple with the Details field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) GetDetailsOk() (ret ServerMaintenanceGetDetailsRetType, ok bool) { return getServerMaintenanceGetDetailsAttributeTypeOk(o.Details) } // HasDetails returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) HasDetails() bool { _, ok := o.GetDetailsOk() return ok } // SetDetails gets a reference to the given string and assigns it to the Details field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) SetDetails(v ServerMaintenanceGetDetailsRetType) { setServerMaintenanceGetDetailsAttributeType(&o.Details, v) } // GetEndsAt returns the EndsAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) GetEndsAt() (ret ServerMaintenanceGetEndsAtRetType) { ret, _ = o.GetEndsAtOk() return ret @@ -167,16 +203,19 @@ func (o *ServerMaintenance) GetEndsAt() (ret ServerMaintenanceGetEndsAtRetType) // GetEndsAtOk returns a tuple with the EndsAt field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) GetEndsAtOk() (ret ServerMaintenanceGetEndsAtRetType, ok bool) { return getServerMaintenanceGetEndsAtAttributeTypeOk(o.EndsAt) } // SetEndsAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) SetEndsAt(v ServerMaintenanceGetEndsAtRetType) { setServerMaintenanceGetEndsAtAttributeType(&o.EndsAt, v) } // GetStartsAt returns the StartsAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) GetStartsAt() (ret ServerMaintenanceGetStartsAtRetType) { ret, _ = o.GetStartsAtOk() return ret @@ -184,16 +223,19 @@ func (o *ServerMaintenance) GetStartsAt() (ret ServerMaintenanceGetStartsAtRetTy // GetStartsAtOk returns a tuple with the StartsAt field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) GetStartsAtOk() (ret ServerMaintenanceGetStartsAtRetType, ok bool) { return getServerMaintenanceGetStartsAtAttributeTypeOk(o.StartsAt) } // SetStartsAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) SetStartsAt(v ServerMaintenanceGetStartsAtRetType) { setServerMaintenanceGetStartsAtAttributeType(&o.StartsAt, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) GetStatus() (ret ServerMaintenanceGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -201,15 +243,18 @@ func (o *ServerMaintenance) GetStatus() (ret ServerMaintenanceGetStatusRetType) // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) GetStatusOk() (ret ServerMaintenanceGetStatusRetType, ok bool) { return getServerMaintenanceGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerMaintenance) SetStatus(v ServerMaintenanceGetStatusRetType) { setServerMaintenanceGetStatusAttributeType(&o.Status, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServerMaintenance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServerMaintenanceGetDetailsAttributeTypeOk(o.Details); ok { @@ -227,37 +272,45 @@ func (o ServerMaintenance) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServerMaintenance struct { value *ServerMaintenance isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerMaintenance) Get() *ServerMaintenance { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerMaintenance) Set(val *ServerMaintenance) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerMaintenance) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerMaintenance) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServerMaintenance(val *ServerMaintenance) *NullableServerMaintenance { return &NullableServerMaintenance{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerMaintenance) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerMaintenance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_server_network.go b/services/iaas/model_server_network.go index ebd610ba6..9c8b37a5a 100644 --- a/services/iaas/model_server_network.go +++ b/services/iaas/model_server_network.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ServerNetwork{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetAllowedAddressesAttributeType = *[]AllowedAddressesInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetAllowedAddressesArgType = []AllowedAddressesInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetAllowedAddressesRetType = []AllowedAddressesInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetAllowedAddressesAttributeTypeOk(arg ServerNetworkGetAllowedAddressesAttributeType) (ret ServerNetworkGetAllowedAddressesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getServerNetworkGetAllowedAddressesAttributeTypeOk(arg ServerNetworkGetAllo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetAllowedAddressesAttributeType(arg *ServerNetworkGetAllowedAddressesAttributeType, val ServerNetworkGetAllowedAddressesRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setServerNetworkGetAllowedAddressesAttributeType(arg *ServerNetworkGetAllow */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetIpv4AttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetIpv4AttributeTypeOk(arg ServerNetworkGetIpv4AttributeType) (ret ServerNetworkGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getServerNetworkGetIpv4AttributeTypeOk(arg ServerNetworkGetIpv4AttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetIpv4AttributeType(arg *ServerNetworkGetIpv4AttributeType, val ServerNetworkGetIpv4RetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetIpv4ArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetIpv4RetType = string /* @@ -63,8 +77,10 @@ type ServerNetworkGetIpv4RetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetIpv6AttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetIpv6AttributeTypeOk(arg ServerNetworkGetIpv6AttributeType) (ret ServerNetworkGetIpv6RetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getServerNetworkGetIpv6AttributeTypeOk(arg ServerNetworkGetIpv6AttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetIpv6AttributeType(arg *ServerNetworkGetIpv6AttributeType, val ServerNetworkGetIpv6RetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetIpv6ArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetIpv6RetType = string /* @@ -84,8 +104,10 @@ type ServerNetworkGetIpv6RetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetMacAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetMacAttributeTypeOk(arg ServerNetworkGetMacAttributeType) (ret ServerNetworkGetMacRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +115,15 @@ func getServerNetworkGetMacAttributeTypeOk(arg ServerNetworkGetMacAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetMacAttributeType(arg *ServerNetworkGetMacAttributeType, val ServerNetworkGetMacRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetMacArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetMacRetType = string /* @@ -105,8 +131,10 @@ type ServerNetworkGetMacRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNetworkIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetNetworkIdAttributeTypeOk(arg ServerNetworkGetNetworkIdAttributeType) (ret ServerNetworkGetNetworkIdRetType, ok bool) { if arg == nil { return ret, false @@ -114,11 +142,15 @@ func getServerNetworkGetNetworkIdAttributeTypeOk(arg ServerNetworkGetNetworkIdAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetNetworkIdAttributeType(arg *ServerNetworkGetNetworkIdAttributeType, val ServerNetworkGetNetworkIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNetworkIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNetworkIdRetType = string /* @@ -126,8 +158,10 @@ type ServerNetworkGetNetworkIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNetworkNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetNetworkNameAttributeTypeOk(arg ServerNetworkGetNetworkNameAttributeType) (ret ServerNetworkGetNetworkNameRetType, ok bool) { if arg == nil { return ret, false @@ -135,11 +169,15 @@ func getServerNetworkGetNetworkNameAttributeTypeOk(arg ServerNetworkGetNetworkNa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetNetworkNameAttributeType(arg *ServerNetworkGetNetworkNameAttributeType, val ServerNetworkGetNetworkNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNetworkNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNetworkNameRetType = string /* @@ -147,8 +185,10 @@ type ServerNetworkGetNetworkNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNicIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetNicIdAttributeTypeOk(arg ServerNetworkGetNicIdAttributeType) (ret ServerNetworkGetNicIdRetType, ok bool) { if arg == nil { return ret, false @@ -156,11 +196,15 @@ func getServerNetworkGetNicIdAttributeTypeOk(arg ServerNetworkGetNicIdAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetNicIdAttributeType(arg *ServerNetworkGetNicIdAttributeType, val ServerNetworkGetNicIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNicIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetNicIdRetType = string /* @@ -168,10 +212,16 @@ type ServerNetworkGetNicIdRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkgetNicSecurityAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkgetNicSecurityArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkgetNicSecurityRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkgetNicSecurityAttributeTypeOk(arg ServerNetworkgetNicSecurityAttributeType) (ret ServerNetworkgetNicSecurityRetType, ok bool) { if arg == nil { return ret, false @@ -179,6 +229,7 @@ func getServerNetworkgetNicSecurityAttributeTypeOk(arg ServerNetworkgetNicSecuri return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkgetNicSecurityAttributeType(arg *ServerNetworkgetNicSecurityAttributeType, val ServerNetworkgetNicSecurityRetType) { *arg = &val } @@ -188,8 +239,10 @@ func setServerNetworkgetNicSecurityAttributeType(arg *ServerNetworkgetNicSecurit */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetPublicIpAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetPublicIpAttributeTypeOk(arg ServerNetworkGetPublicIpAttributeType) (ret ServerNetworkGetPublicIpRetType, ok bool) { if arg == nil { return ret, false @@ -197,11 +250,15 @@ func getServerNetworkGetPublicIpAttributeTypeOk(arg ServerNetworkGetPublicIpAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetPublicIpAttributeType(arg *ServerNetworkGetPublicIpAttributeType, val ServerNetworkGetPublicIpRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetPublicIpArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetPublicIpRetType = string /* @@ -209,10 +266,16 @@ type ServerNetworkGetPublicIpRetType = string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetSecurityGroupsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetSecurityGroupsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworkGetSecurityGroupsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServerNetworkGetSecurityGroupsAttributeTypeOk(arg ServerNetworkGetSecurityGroupsAttributeType) (ret ServerNetworkGetSecurityGroupsRetType, ok bool) { if arg == nil { return ret, false @@ -220,11 +283,13 @@ func getServerNetworkGetSecurityGroupsAttributeTypeOk(arg ServerNetworkGetSecuri return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServerNetworkGetSecurityGroupsAttributeType(arg *ServerNetworkGetSecurityGroupsAttributeType, val ServerNetworkGetSecurityGroupsRetType) { *arg = &val } // ServerNetwork Describes the object that matches servers to its networks. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetwork struct { // A list of IPs or CIDR notations. AllowedAddresses ServerNetworkGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` @@ -253,12 +318,14 @@ type ServerNetwork struct { SecurityGroups ServerNetworkGetSecurityGroupsAttributeType `json:"securityGroups,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ServerNetwork ServerNetwork // NewServerNetwork instantiates a new ServerNetwork object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerNetwork(mac ServerNetworkGetMacArgType, networkId ServerNetworkGetNetworkIdArgType, networkName ServerNetworkGetNetworkNameArgType, nicId ServerNetworkGetNicIdArgType, nicSecurity ServerNetworkgetNicSecurityArgType) *ServerNetwork { this := ServerNetwork{} setServerNetworkGetMacAttributeType(&this.Mac, mac) @@ -272,12 +339,14 @@ func NewServerNetwork(mac ServerNetworkGetMacArgType, networkId ServerNetworkGet // NewServerNetworkWithDefaults instantiates a new ServerNetwork object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServerNetworkWithDefaults() *ServerNetwork { this := ServerNetwork{} return &this } // GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetAllowedAddresses() (res ServerNetworkGetAllowedAddressesRetType) { res, _ = o.GetAllowedAddressesOk() return @@ -285,22 +354,26 @@ func (o *ServerNetwork) GetAllowedAddresses() (res ServerNetworkGetAllowedAddres // GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetAllowedAddressesOk() (ret ServerNetworkGetAllowedAddressesRetType, ok bool) { return getServerNetworkGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) } // HasAllowedAddresses returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) HasAllowedAddresses() bool { _, ok := o.GetAllowedAddressesOk() return ok } // SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetAllowedAddresses(v ServerNetworkGetAllowedAddressesRetType) { setServerNetworkGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetIpv4() (res ServerNetworkGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -308,22 +381,26 @@ func (o *ServerNetwork) GetIpv4() (res ServerNetworkGetIpv4RetType) { // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetIpv4Ok() (ret ServerNetworkGetIpv4RetType, ok bool) { return getServerNetworkGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetIpv4(v ServerNetworkGetIpv4RetType) { setServerNetworkGetIpv4AttributeType(&o.Ipv4, v) } // GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetIpv6() (res ServerNetworkGetIpv6RetType) { res, _ = o.GetIpv6Ok() return @@ -331,22 +408,26 @@ func (o *ServerNetwork) GetIpv6() (res ServerNetworkGetIpv6RetType) { // GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetIpv6Ok() (ret ServerNetworkGetIpv6RetType, ok bool) { return getServerNetworkGetIpv6AttributeTypeOk(o.Ipv6) } // HasIpv6 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) HasIpv6() bool { _, ok := o.GetIpv6Ok() return ok } // SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetIpv6(v ServerNetworkGetIpv6RetType) { setServerNetworkGetIpv6AttributeType(&o.Ipv6, v) } // GetMac returns the Mac field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetMac() (ret ServerNetworkGetMacRetType) { ret, _ = o.GetMacOk() return ret @@ -354,16 +435,19 @@ func (o *ServerNetwork) GetMac() (ret ServerNetworkGetMacRetType) { // GetMacOk returns a tuple with the Mac field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetMacOk() (ret ServerNetworkGetMacRetType, ok bool) { return getServerNetworkGetMacAttributeTypeOk(o.Mac) } // SetMac sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetMac(v ServerNetworkGetMacRetType) { setServerNetworkGetMacAttributeType(&o.Mac, v) } // GetNetworkId returns the NetworkId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetNetworkId() (ret ServerNetworkGetNetworkIdRetType) { ret, _ = o.GetNetworkIdOk() return ret @@ -371,16 +455,19 @@ func (o *ServerNetwork) GetNetworkId() (ret ServerNetworkGetNetworkIdRetType) { // GetNetworkIdOk returns a tuple with the NetworkId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetNetworkIdOk() (ret ServerNetworkGetNetworkIdRetType, ok bool) { return getServerNetworkGetNetworkIdAttributeTypeOk(o.NetworkId) } // SetNetworkId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetNetworkId(v ServerNetworkGetNetworkIdRetType) { setServerNetworkGetNetworkIdAttributeType(&o.NetworkId, v) } // GetNetworkName returns the NetworkName field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetNetworkName() (ret ServerNetworkGetNetworkNameRetType) { ret, _ = o.GetNetworkNameOk() return ret @@ -388,16 +475,19 @@ func (o *ServerNetwork) GetNetworkName() (ret ServerNetworkGetNetworkNameRetType // GetNetworkNameOk returns a tuple with the NetworkName field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetNetworkNameOk() (ret ServerNetworkGetNetworkNameRetType, ok bool) { return getServerNetworkGetNetworkNameAttributeTypeOk(o.NetworkName) } // SetNetworkName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetNetworkName(v ServerNetworkGetNetworkNameRetType) { setServerNetworkGetNetworkNameAttributeType(&o.NetworkName, v) } // GetNicId returns the NicId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetNicId() (ret ServerNetworkGetNicIdRetType) { ret, _ = o.GetNicIdOk() return ret @@ -405,16 +495,19 @@ func (o *ServerNetwork) GetNicId() (ret ServerNetworkGetNicIdRetType) { // GetNicIdOk returns a tuple with the NicId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetNicIdOk() (ret ServerNetworkGetNicIdRetType, ok bool) { return getServerNetworkGetNicIdAttributeTypeOk(o.NicId) } // SetNicId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetNicId(v ServerNetworkGetNicIdRetType) { setServerNetworkGetNicIdAttributeType(&o.NicId, v) } // GetNicSecurity returns the NicSecurity field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetNicSecurity() (ret ServerNetworkgetNicSecurityRetType) { ret, _ = o.GetNicSecurityOk() return ret @@ -422,16 +515,19 @@ func (o *ServerNetwork) GetNicSecurity() (ret ServerNetworkgetNicSecurityRetType // GetNicSecurityOk returns a tuple with the NicSecurity field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetNicSecurityOk() (ret ServerNetworkgetNicSecurityRetType, ok bool) { return getServerNetworkgetNicSecurityAttributeTypeOk(o.NicSecurity) } // SetNicSecurity sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetNicSecurity(v ServerNetworkgetNicSecurityRetType) { setServerNetworkgetNicSecurityAttributeType(&o.NicSecurity, v) } // GetPublicIp returns the PublicIp field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetPublicIp() (res ServerNetworkGetPublicIpRetType) { res, _ = o.GetPublicIpOk() return @@ -439,22 +535,26 @@ func (o *ServerNetwork) GetPublicIp() (res ServerNetworkGetPublicIpRetType) { // GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetPublicIpOk() (ret ServerNetworkGetPublicIpRetType, ok bool) { return getServerNetworkGetPublicIpAttributeTypeOk(o.PublicIp) } // HasPublicIp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) HasPublicIp() bool { _, ok := o.GetPublicIpOk() return ok } // SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetPublicIp(v ServerNetworkGetPublicIpRetType) { setServerNetworkGetPublicIpAttributeType(&o.PublicIp, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetSecurityGroups() (res ServerNetworkGetSecurityGroupsRetType) { res, _ = o.GetSecurityGroupsOk() return @@ -462,21 +562,25 @@ func (o *ServerNetwork) GetSecurityGroups() (res ServerNetworkGetSecurityGroupsR // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) GetSecurityGroupsOk() (ret ServerNetworkGetSecurityGroupsRetType, ok bool) { return getServerNetworkGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) HasSecurityGroups() bool { _, ok := o.GetSecurityGroupsOk() return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServerNetwork) SetSecurityGroups(v ServerNetworkGetSecurityGroupsRetType) { setServerNetworkGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServerNetwork) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServerNetworkGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { @@ -512,37 +616,45 @@ func (o ServerNetwork) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServerNetwork struct { value *ServerNetwork isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerNetwork) Get() *ServerNetwork { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerNetwork) Set(val *ServerNetwork) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerNetwork) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerNetwork) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServerNetwork(val *ServerNetwork) *NullableServerNetwork { return &NullableServerNetwork{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerNetwork) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerNetwork) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_server_networking.go b/services/iaas/model_server_networking.go index afad48268..45fb148d1 100644 --- a/services/iaas/model_server_networking.go +++ b/services/iaas/model_server_networking.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -16,12 +17,14 @@ import ( ) // ServerNetworking - The initial networking setup for the server creation. A network, a nic or nothing can be given. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServerNetworking struct { CreateServerNetworking *CreateServerNetworking CreateServerNetworkingWithNics *CreateServerNetworkingWithNics } // CreateServerNetworkingAsServerNetworking is a convenience function that returns CreateServerNetworking wrapped in ServerNetworking +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateServerNetworkingAsServerNetworking(v *CreateServerNetworking) ServerNetworking { return ServerNetworking{ CreateServerNetworking: v, @@ -29,6 +32,7 @@ func CreateServerNetworkingAsServerNetworking(v *CreateServerNetworking) ServerN } // CreateServerNetworkingWithNicsAsServerNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in ServerNetworking +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CreateServerNetworkingWithNicsAsServerNetworking(v *CreateServerNetworkingWithNics) ServerNetworking { return ServerNetworking{ CreateServerNetworkingWithNics: v, @@ -36,6 +40,7 @@ func CreateServerNetworkingWithNicsAsServerNetworking(v *CreateServerNetworkingW } // Unmarshal JSON data into one of the pointers in the struct +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (dst *ServerNetworking) UnmarshalJSON(data []byte) error { var err error match := 0 @@ -79,6 +84,7 @@ func (dst *ServerNetworking) UnmarshalJSON(data []byte) error { // Marshal data from the first non-nil pointers in the struct to JSON func (src ServerNetworking) MarshalJSON() ([]byte, error) { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead if src.CreateServerNetworking != nil { return json.Marshal(&src.CreateServerNetworking) } @@ -91,6 +97,7 @@ func (src ServerNetworking) MarshalJSON() ([]byte, error) { } // Get the actual instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (obj *ServerNetworking) GetActualInstance() interface{} { if obj == nil { return nil @@ -107,37 +114,45 @@ func (obj *ServerNetworking) GetActualInstance() interface{} { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServerNetworking struct { value *ServerNetworking isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerNetworking) Get() *ServerNetworking { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerNetworking) Set(val *ServerNetworking) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerNetworking) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerNetworking) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServerNetworking(val *ServerNetworking) *NullableServerNetworking { return &NullableServerNetworking{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServerNetworking) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServerNetworking) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_service_account_mail_list_response.go b/services/iaas/model_service_account_mail_list_response.go index 3435a06c8..cc4513a86 100644 --- a/services/iaas/model_service_account_mail_list_response.go +++ b/services/iaas/model_service_account_mail_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ServiceAccountMailListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceAccountMailListResponseGetItemsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceAccountMailListResponseGetItemsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceAccountMailListResponseGetItemsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getServiceAccountMailListResponseGetItemsAttributeTypeOk(arg ServiceAccountMailListResponseGetItemsAttributeType) (ret ServiceAccountMailListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getServiceAccountMailListResponseGetItemsAttributeTypeOk(arg ServiceAccount return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setServiceAccountMailListResponseGetItemsAttributeType(arg *ServiceAccountMailListResponseGetItemsAttributeType, val ServiceAccountMailListResponseGetItemsRetType) { *arg = &val } // ServiceAccountMailListResponse Service account mail list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ServiceAccountMailListResponse struct { // A list of service account mails. // REQUIRED Items ServiceAccountMailListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ServiceAccountMailListResponse ServiceAccountMailListResponse // NewServiceAccountMailListResponse instantiates a new ServiceAccountMailListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServiceAccountMailListResponse(items ServiceAccountMailListResponseGetItemsArgType) *ServiceAccountMailListResponse { this := ServiceAccountMailListResponse{} setServiceAccountMailListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewServiceAccountMailListResponse(items ServiceAccountMailListResponseGetIt // NewServiceAccountMailListResponseWithDefaults instantiates a new ServiceAccountMailListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewServiceAccountMailListResponseWithDefaults() *ServiceAccountMailListResponse { this := ServiceAccountMailListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceAccountMailListResponse) GetItems() (ret ServiceAccountMailListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *ServiceAccountMailListResponse) GetItems() (ret ServiceAccountMailListR // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceAccountMailListResponse) GetItemsOk() (ret ServiceAccountMailListResponseGetItemsRetType, ok bool) { return getServiceAccountMailListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ServiceAccountMailListResponse) SetItems(v ServiceAccountMailListResponseGetItemsRetType) { setServiceAccountMailListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ServiceAccountMailListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getServiceAccountMailListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o ServiceAccountMailListResponse) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableServiceAccountMailListResponse struct { value *ServiceAccountMailListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServiceAccountMailListResponse) Get() *ServiceAccountMailListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServiceAccountMailListResponse) Set(val *ServiceAccountMailListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServiceAccountMailListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServiceAccountMailListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableServiceAccountMailListResponse(val *ServiceAccountMailListResponse) *NullableServiceAccountMailListResponse { return &NullableServiceAccountMailListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableServiceAccountMailListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableServiceAccountMailListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_set_image_share_payload.go b/services/iaas/model_set_image_share_payload.go index be6bd32e4..82bdc8d3e 100644 --- a/services/iaas/model_set_image_share_payload.go +++ b/services/iaas/model_set_image_share_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &SetImageSharePayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SetImageSharePayloadgetParentOrganizationAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SetImageSharePayloadgetParentOrganizationArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SetImageSharePayloadgetParentOrganizationRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(arg SetImageSharePayloadgetParentOrganizationAttributeType) (ret SetImageSharePayloadgetParentOrganizationRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(arg SetImageSha return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSetImageSharePayloadgetParentOrganizationAttributeType(arg *SetImageSharePayloadgetParentOrganizationAttributeType, val SetImageSharePayloadgetParentOrganizationRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setSetImageSharePayloadgetParentOrganizationAttributeType(arg *SetImageShar */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SetImageSharePayloadGetProjectsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SetImageSharePayloadGetProjectsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SetImageSharePayloadGetProjectsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSetImageSharePayloadGetProjectsAttributeTypeOk(arg SetImageSharePayloadGetProjectsAttributeType) (ret SetImageSharePayloadGetProjectsRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getSetImageSharePayloadGetProjectsAttributeTypeOk(arg SetImageSharePayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSetImageSharePayloadGetProjectsAttributeType(arg *SetImageSharePayloadGetProjectsAttributeType, val SetImageSharePayloadGetProjectsRetType) { *arg = &val } // SetImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SetImageSharePayload struct { // Image is shared with all projects inside the image owners organization. ParentOrganization SetImageSharePayloadgetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` @@ -69,6 +85,7 @@ type SetImageSharePayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSetImageSharePayload() *SetImageSharePayload { this := SetImageSharePayload{} return &this @@ -77,12 +94,14 @@ func NewSetImageSharePayload() *SetImageSharePayload { // NewSetImageSharePayloadWithDefaults instantiates a new SetImageSharePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSetImageSharePayloadWithDefaults() *SetImageSharePayload { this := SetImageSharePayload{} return &this } // GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SetImageSharePayload) GetParentOrganization() (res SetImageSharePayloadgetParentOrganizationRetType) { res, _ = o.GetParentOrganizationOk() return @@ -90,22 +109,26 @@ func (o *SetImageSharePayload) GetParentOrganization() (res SetImageSharePayload // GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SetImageSharePayload) GetParentOrganizationOk() (ret SetImageSharePayloadgetParentOrganizationRetType, ok bool) { return getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization) } // HasParentOrganization returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SetImageSharePayload) HasParentOrganization() bool { _, ok := o.GetParentOrganizationOk() return ok } // SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SetImageSharePayload) SetParentOrganization(v SetImageSharePayloadgetParentOrganizationRetType) { setSetImageSharePayloadgetParentOrganizationAttributeType(&o.ParentOrganization, v) } // GetProjects returns the Projects field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SetImageSharePayload) GetProjects() (res SetImageSharePayloadGetProjectsRetType) { res, _ = o.GetProjectsOk() return @@ -113,21 +136,25 @@ func (o *SetImageSharePayload) GetProjects() (res SetImageSharePayloadGetProject // GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SetImageSharePayload) GetProjectsOk() (ret SetImageSharePayloadGetProjectsRetType, ok bool) { return getSetImageSharePayloadGetProjectsAttributeTypeOk(o.Projects) } // HasProjects returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SetImageSharePayload) HasProjects() bool { _, ok := o.GetProjectsOk() return ok } // SetProjects gets a reference to the given []string and assigns it to the Projects field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SetImageSharePayload) SetProjects(v SetImageSharePayloadGetProjectsRetType) { setSetImageSharePayloadGetProjectsAttributeType(&o.Projects, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SetImageSharePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSetImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { @@ -139,37 +166,45 @@ func (o SetImageSharePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableSetImageSharePayload struct { value *SetImageSharePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSetImageSharePayload) Get() *SetImageSharePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSetImageSharePayload) Set(val *SetImageSharePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSetImageSharePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSetImageSharePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableSetImageSharePayload(val *SetImageSharePayload) *NullableSetImageSharePayload { return &NullableSetImageSharePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSetImageSharePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSetImageSharePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_snapshot.go b/services/iaas/model_snapshot.go index 3acdf08bf..449f26fe1 100644 --- a/services/iaas/model_snapshot.go +++ b/services/iaas/model_snapshot.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,10 +24,16 @@ var _ MappedNullable = &Snapshot{} */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotGetCreatedAtAttributeTypeOk(arg SnapshotGetCreatedAtAttributeType) (ret SnapshotGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -34,6 +41,7 @@ func getSnapshotGetCreatedAtAttributeTypeOk(arg SnapshotGetCreatedAtAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotGetCreatedAtAttributeType(arg *SnapshotGetCreatedAtAttributeType, val SnapshotGetCreatedAtRetType) { *arg = &val } @@ -43,8 +51,10 @@ func setSnapshotGetCreatedAtAttributeType(arg *SnapshotGetCreatedAtAttributeType */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotGetIdAttributeTypeOk(arg SnapshotGetIdAttributeType) (ret SnapshotGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +62,15 @@ func getSnapshotGetIdAttributeTypeOk(arg SnapshotGetIdAttributeType) (ret Snapsh return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotGetIdAttributeType(arg *SnapshotGetIdAttributeType, val SnapshotGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetIdRetType = string /* @@ -64,10 +78,16 @@ type SnapshotGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotGetLabelsAttributeTypeOk(arg SnapshotGetLabelsAttributeType) (ret SnapshotGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getSnapshotGetLabelsAttributeTypeOk(arg SnapshotGetLabelsAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotGetLabelsAttributeType(arg *SnapshotGetLabelsAttributeType, val SnapshotGetLabelsRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setSnapshotGetLabelsAttributeType(arg *SnapshotGetLabelsAttributeType, val */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotGetNameAttributeTypeOk(arg SnapshotGetNameAttributeType) (ret SnapshotGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getSnapshotGetNameAttributeTypeOk(arg SnapshotGetNameAttributeType) (ret Sn return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotGetNameAttributeType(arg *SnapshotGetNameAttributeType, val SnapshotGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetNameRetType = string /* @@ -105,10 +132,16 @@ type SnapshotGetNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotGetSizeAttributeTypeOk(arg SnapshotGetSizeAttributeType) (ret SnapshotGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getSnapshotGetSizeAttributeTypeOk(arg SnapshotGetSizeAttributeType) (ret Sn return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotGetSizeAttributeType(arg *SnapshotGetSizeAttributeType, val SnapshotGetSizeRetType) { *arg = &val } @@ -125,8 +159,10 @@ func setSnapshotGetSizeAttributeType(arg *SnapshotGetSizeAttributeType, val Snap */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotGetStatusAttributeTypeOk(arg SnapshotGetStatusAttributeType) (ret SnapshotGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -134,11 +170,15 @@ func getSnapshotGetStatusAttributeTypeOk(arg SnapshotGetStatusAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotGetStatusAttributeType(arg *SnapshotGetStatusAttributeType, val SnapshotGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetStatusRetType = string /* @@ -146,10 +186,16 @@ type SnapshotGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotGetUpdatedAtAttributeTypeOk(arg SnapshotGetUpdatedAtAttributeType) (ret SnapshotGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -157,6 +203,7 @@ func getSnapshotGetUpdatedAtAttributeTypeOk(arg SnapshotGetUpdatedAtAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotGetUpdatedAtAttributeType(arg *SnapshotGetUpdatedAtAttributeType, val SnapshotGetUpdatedAtRetType) { *arg = &val } @@ -166,8 +213,10 @@ func setSnapshotGetUpdatedAtAttributeType(arg *SnapshotGetUpdatedAtAttributeType */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotGetVolumeIdAttributeTypeOk(arg SnapshotGetVolumeIdAttributeType) (ret SnapshotGetVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -175,20 +224,25 @@ func getSnapshotGetVolumeIdAttributeTypeOk(arg SnapshotGetVolumeIdAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotGetVolumeIdAttributeType(arg *SnapshotGetVolumeIdAttributeType, val SnapshotGetVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotGetVolumeIdRetType = string // Snapshot Object that represents a snapshot. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Snapshot struct { // Date-time when resource was created. CreatedAt SnapshotGetCreatedAtAttributeType `json:"createdAt,omitempty"` // Universally Unique Identifier (UUID). Id SnapshotGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels SnapshotGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name SnapshotGetNameAttributeType `json:"name,omitempty"` @@ -203,12 +257,14 @@ type Snapshot struct { VolumeId SnapshotGetVolumeIdAttributeType `json:"volumeId" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Snapshot Snapshot // NewSnapshot instantiates a new Snapshot object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSnapshot(volumeId SnapshotGetVolumeIdArgType) *Snapshot { this := Snapshot{} setSnapshotGetVolumeIdAttributeType(&this.VolumeId, volumeId) @@ -218,12 +274,14 @@ func NewSnapshot(volumeId SnapshotGetVolumeIdArgType) *Snapshot { // NewSnapshotWithDefaults instantiates a new Snapshot object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSnapshotWithDefaults() *Snapshot { this := Snapshot{} return &this } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetCreatedAt() (res SnapshotGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -231,22 +289,26 @@ func (o *Snapshot) GetCreatedAt() (res SnapshotGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetCreatedAtOk() (ret SnapshotGetCreatedAtRetType, ok bool) { return getSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) SetCreatedAt(v SnapshotGetCreatedAtRetType) { setSnapshotGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetId() (res SnapshotGetIdRetType) { res, _ = o.GetIdOk() return @@ -254,22 +316,26 @@ func (o *Snapshot) GetId() (res SnapshotGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetIdOk() (ret SnapshotGetIdRetType, ok bool) { return getSnapshotGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) SetId(v SnapshotGetIdRetType) { setSnapshotGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetLabels() (res SnapshotGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -277,22 +343,26 @@ func (o *Snapshot) GetLabels() (res SnapshotGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetLabelsOk() (ret SnapshotGetLabelsRetType, ok bool) { return getSnapshotGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) SetLabels(v SnapshotGetLabelsRetType) { setSnapshotGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetName() (res SnapshotGetNameRetType) { res, _ = o.GetNameOk() return @@ -300,22 +370,26 @@ func (o *Snapshot) GetName() (res SnapshotGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetNameOk() (ret SnapshotGetNameRetType, ok bool) { return getSnapshotGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) SetName(v SnapshotGetNameRetType) { setSnapshotGetNameAttributeType(&o.Name, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetSize() (res SnapshotGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -323,22 +397,26 @@ func (o *Snapshot) GetSize() (res SnapshotGetSizeRetType) { // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetSizeOk() (ret SnapshotGetSizeRetType, ok bool) { return getSnapshotGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) SetSize(v SnapshotGetSizeRetType) { setSnapshotGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetStatus() (res SnapshotGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -346,22 +424,26 @@ func (o *Snapshot) GetStatus() (res SnapshotGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetStatusOk() (ret SnapshotGetStatusRetType, ok bool) { return getSnapshotGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) SetStatus(v SnapshotGetStatusRetType) { setSnapshotGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetUpdatedAt() (res SnapshotGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -369,22 +451,26 @@ func (o *Snapshot) GetUpdatedAt() (res SnapshotGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetUpdatedAtOk() (ret SnapshotGetUpdatedAtRetType, ok bool) { return getSnapshotGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) SetUpdatedAt(v SnapshotGetUpdatedAtRetType) { setSnapshotGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetVolumeId returns the VolumeId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetVolumeId() (ret SnapshotGetVolumeIdRetType) { ret, _ = o.GetVolumeIdOk() return ret @@ -392,15 +478,18 @@ func (o *Snapshot) GetVolumeId() (ret SnapshotGetVolumeIdRetType) { // GetVolumeIdOk returns a tuple with the VolumeId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) GetVolumeIdOk() (ret SnapshotGetVolumeIdRetType, ok bool) { return getSnapshotGetVolumeIdAttributeTypeOk(o.VolumeId) } // SetVolumeId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Snapshot) SetVolumeId(v SnapshotGetVolumeIdRetType) { setSnapshotGetVolumeIdAttributeType(&o.VolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Snapshot) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -430,37 +519,45 @@ func (o Snapshot) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableSnapshot struct { value *Snapshot isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSnapshot) Get() *Snapshot { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSnapshot) Set(val *Snapshot) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSnapshot) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSnapshot) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableSnapshot(val *Snapshot) *NullableSnapshot { return &NullableSnapshot{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSnapshot) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSnapshot) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_snapshot_list_response.go b/services/iaas/model_snapshot_list_response.go index a19b34b18..af0d3cc22 100644 --- a/services/iaas/model_snapshot_list_response.go +++ b/services/iaas/model_snapshot_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &SnapshotListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotListResponseGetItemsAttributeType = *[]Snapshot + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotListResponseGetItemsArgType = []Snapshot + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotListResponseGetItemsRetType = []Snapshot +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getSnapshotListResponseGetItemsAttributeTypeOk(arg SnapshotListResponseGetItemsAttributeType) (ret SnapshotListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getSnapshotListResponseGetItemsAttributeTypeOk(arg SnapshotListResponseGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setSnapshotListResponseGetItemsAttributeType(arg *SnapshotListResponseGetItemsAttributeType, val SnapshotListResponseGetItemsRetType) { *arg = &val } // SnapshotListResponse Snapshot list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type SnapshotListResponse struct { // A list containing snapshot objects. // REQUIRED Items SnapshotListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _SnapshotListResponse SnapshotListResponse // NewSnapshotListResponse instantiates a new SnapshotListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSnapshotListResponse(items SnapshotListResponseGetItemsArgType) *SnapshotListResponse { this := SnapshotListResponse{} setSnapshotListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewSnapshotListResponse(items SnapshotListResponseGetItemsArgType) *Snapsho // NewSnapshotListResponseWithDefaults instantiates a new SnapshotListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewSnapshotListResponseWithDefaults() *SnapshotListResponse { this := SnapshotListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SnapshotListResponse) GetItems() (ret SnapshotListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *SnapshotListResponse) GetItems() (ret SnapshotListResponseGetItemsRetTy // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SnapshotListResponse) GetItemsOk() (ret SnapshotListResponseGetItemsRetType, ok bool) { return getSnapshotListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *SnapshotListResponse) SetItems(v SnapshotListResponseGetItemsRetType) { setSnapshotListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o SnapshotListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSnapshotListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o SnapshotListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableSnapshotListResponse struct { value *SnapshotListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSnapshotListResponse) Get() *SnapshotListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSnapshotListResponse) Set(val *SnapshotListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSnapshotListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSnapshotListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableSnapshotListResponse(val *SnapshotListResponse) *NullableSnapshotListResponse { return &NullableSnapshotListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableSnapshotListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableSnapshotListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_static_area_id.go b/services/iaas/model_static_area_id.go index b7fccaa8d..ed6690e85 100644 --- a/services/iaas/model_static_area_id.go +++ b/services/iaas/model_static_area_id.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -16,20 +17,25 @@ import ( ) // StaticAreaID The identifier (ID) of a static area. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type StaticAreaID string // List of StaticAreaID const ( - STATICAREAID_PUBLIC StaticAreaID = "PUBLIC" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + STATICAREAID_PUBLIC StaticAreaID = "PUBLIC" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead STATICAREAID_SCHWARZ StaticAreaID = "SCHWARZ" ) // All allowed values of StaticAreaID enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedStaticAreaIDEnumValues = []StaticAreaID{ "PUBLIC", "SCHWARZ", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *StaticAreaID) UnmarshalJSON(src []byte) error { var value string err := json.Unmarshal(src, &value) @@ -54,6 +60,7 @@ func (v *StaticAreaID) UnmarshalJSON(src []byte) error { // NewStaticAreaIDFromValue returns a pointer to a valid StaticAreaID // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewStaticAreaIDFromValue(v string) (*StaticAreaID, error) { ev := StaticAreaID(v) if ev.IsValid() { @@ -64,6 +71,7 @@ func NewStaticAreaIDFromValue(v string) (*StaticAreaID, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v StaticAreaID) IsValid() bool { for _, existing := range AllowedStaticAreaIDEnumValues { if existing == v { @@ -74,41 +82,50 @@ func (v StaticAreaID) IsValid() bool { } // Ptr returns reference to StaticAreaID value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v StaticAreaID) Ptr() *StaticAreaID { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableStaticAreaID struct { value *StaticAreaID isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStaticAreaID) Get() *StaticAreaID { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStaticAreaID) Set(val *StaticAreaID) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStaticAreaID) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStaticAreaID) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableStaticAreaID(val *StaticAreaID) *NullableStaticAreaID { return &NullableStaticAreaID{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableStaticAreaID) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableStaticAreaID) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_attached_volume_payload.go b/services/iaas/model_update_attached_volume_payload.go index 456ac1a74..6952b8f57 100644 --- a/services/iaas/model_update_attached_volume_payload.go +++ b/services/iaas/model_update_attached_volume_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateAttachedVolumePayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadgetDeleteOnTerminationArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(arg UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType) (ret UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(arg Upd return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType(arg *UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType, val UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType(arg *Upda */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadGetServerIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(arg UpdateAttachedVolumePayloadGetServerIdAttributeType) (ret UpdateAttachedVolumePayloadGetServerIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(arg UpdateAttached return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateAttachedVolumePayloadGetServerIdAttributeType(arg *UpdateAttachedVolumePayloadGetServerIdAttributeType, val UpdateAttachedVolumePayloadGetServerIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadGetServerIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadGetServerIdRetType = string /* @@ -63,8 +77,10 @@ type UpdateAttachedVolumePayloadGetServerIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadGetVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(arg UpdateAttachedVolumePayloadGetVolumeIdAttributeType) (ret UpdateAttachedVolumePayloadGetVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(arg UpdateAttached return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateAttachedVolumePayloadGetVolumeIdAttributeType(arg *UpdateAttachedVolumePayloadGetVolumeIdAttributeType, val UpdateAttachedVolumePayloadGetVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadGetVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayloadGetVolumeIdRetType = string // UpdateAttachedVolumePayload Object that represents a Volume attachment to a server. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateAttachedVolumePayload struct { // Delete the volume during the termination of the server. Defaults to false. DeleteOnTermination UpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` @@ -93,6 +114,7 @@ type UpdateAttachedVolumePayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateAttachedVolumePayload() *UpdateAttachedVolumePayload { this := UpdateAttachedVolumePayload{} return &this @@ -101,12 +123,14 @@ func NewUpdateAttachedVolumePayload() *UpdateAttachedVolumePayload { // NewUpdateAttachedVolumePayloadWithDefaults instantiates a new UpdateAttachedVolumePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateAttachedVolumePayloadWithDefaults() *UpdateAttachedVolumePayload { this := UpdateAttachedVolumePayload{} return &this } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) GetDeleteOnTermination() (res UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { res, _ = o.GetDeleteOnTerminationOk() return @@ -114,22 +138,26 @@ func (o *UpdateAttachedVolumePayload) GetDeleteOnTermination() (res UpdateAttach // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) GetDeleteOnTerminationOk() (ret UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType, ok bool) { return getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) HasDeleteOnTermination() bool { _, ok := o.GetDeleteOnTerminationOk() return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) SetDeleteOnTermination(v UpdateAttachedVolumePayloadgetDeleteOnTerminationRetType) { setUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) GetServerId() (res UpdateAttachedVolumePayloadGetServerIdRetType) { res, _ = o.GetServerIdOk() return @@ -137,22 +165,26 @@ func (o *UpdateAttachedVolumePayload) GetServerId() (res UpdateAttachedVolumePay // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) GetServerIdOk() (ret UpdateAttachedVolumePayloadGetServerIdRetType, ok bool) { return getUpdateAttachedVolumePayloadGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) HasServerId() bool { _, ok := o.GetServerIdOk() return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) SetServerId(v UpdateAttachedVolumePayloadGetServerIdRetType) { setUpdateAttachedVolumePayloadGetServerIdAttributeType(&o.ServerId, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) GetVolumeId() (res UpdateAttachedVolumePayloadGetVolumeIdRetType) { res, _ = o.GetVolumeIdOk() return @@ -160,21 +192,25 @@ func (o *UpdateAttachedVolumePayload) GetVolumeId() (res UpdateAttachedVolumePay // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) GetVolumeIdOk() (ret UpdateAttachedVolumePayloadGetVolumeIdRetType, ok bool) { return getUpdateAttachedVolumePayloadGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) HasVolumeId() bool { _, ok := o.GetVolumeIdOk() return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateAttachedVolumePayload) SetVolumeId(v UpdateAttachedVolumePayloadGetVolumeIdRetType) { setUpdateAttachedVolumePayloadGetVolumeIdAttributeType(&o.VolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateAttachedVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateAttachedVolumePayloadgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { @@ -189,37 +225,45 @@ func (o UpdateAttachedVolumePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateAttachedVolumePayload struct { value *UpdateAttachedVolumePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateAttachedVolumePayload) Get() *UpdateAttachedVolumePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateAttachedVolumePayload) Set(val *UpdateAttachedVolumePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateAttachedVolumePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateAttachedVolumePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateAttachedVolumePayload(val *UpdateAttachedVolumePayload) *NullableUpdateAttachedVolumePayload { return &NullableUpdateAttachedVolumePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateAttachedVolumePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateAttachedVolumePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_backup_payload.go b/services/iaas/model_update_backup_payload.go index 983e139f3..992f7010a 100644 --- a/services/iaas/model_update_backup_payload.go +++ b/services/iaas/model_update_backup_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &UpdateBackupPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetAvailabilityZoneAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(arg UpdateBackupPayloadGetAvailabilityZoneAttributeType) (ret UpdateBackupPayloadGetAvailabilityZoneRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(arg UpdateBackupPa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetAvailabilityZoneAttributeType(arg *UpdateBackupPayloadGetAvailabilityZoneAttributeType, val UpdateBackupPayloadGetAvailabilityZoneRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetAvailabilityZoneArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetAvailabilityZoneRetType = string /* @@ -44,10 +51,16 @@ type UpdateBackupPayloadGetAvailabilityZoneRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(arg UpdateBackupPayloadGetCreatedAtAttributeType) (ret UpdateBackupPayloadGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(arg UpdateBackupPayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetCreatedAtAttributeType(arg *UpdateBackupPayloadGetCreatedAtAttributeType, val UpdateBackupPayloadGetCreatedAtRetType) { *arg = &val } @@ -64,10 +78,16 @@ func setUpdateBackupPayloadGetCreatedAtAttributeType(arg *UpdateBackupPayloadGet */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadgetEncryptedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadgetEncryptedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadgetEncryptedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadgetEncryptedAttributeTypeOk(arg UpdateBackupPayloadgetEncryptedAttributeType) (ret UpdateBackupPayloadgetEncryptedRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getUpdateBackupPayloadgetEncryptedAttributeTypeOk(arg UpdateBackupPayloadge return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadgetEncryptedAttributeType(arg *UpdateBackupPayloadgetEncryptedAttributeType, val UpdateBackupPayloadgetEncryptedRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setUpdateBackupPayloadgetEncryptedAttributeType(arg *UpdateBackupPayloadget */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetIdAttributeTypeOk(arg UpdateBackupPayloadGetIdAttributeType) (ret UpdateBackupPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getUpdateBackupPayloadGetIdAttributeTypeOk(arg UpdateBackupPayloadGetIdAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetIdAttributeType(arg *UpdateBackupPayloadGetIdAttributeType, val UpdateBackupPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetIdRetType = string /* @@ -105,10 +132,16 @@ type UpdateBackupPayloadGetIdRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetLabelsAttributeTypeOk(arg UpdateBackupPayloadGetLabelsAttributeType) (ret UpdateBackupPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getUpdateBackupPayloadGetLabelsAttributeTypeOk(arg UpdateBackupPayloadGetLa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetLabelsAttributeType(arg *UpdateBackupPayloadGetLabelsAttributeType, val UpdateBackupPayloadGetLabelsRetType) { *arg = &val } @@ -125,8 +159,10 @@ func setUpdateBackupPayloadGetLabelsAttributeType(arg *UpdateBackupPayloadGetLab */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetNameAttributeTypeOk(arg UpdateBackupPayloadGetNameAttributeType) (ret UpdateBackupPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -134,11 +170,15 @@ func getUpdateBackupPayloadGetNameAttributeTypeOk(arg UpdateBackupPayloadGetName return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetNameAttributeType(arg *UpdateBackupPayloadGetNameAttributeType, val UpdateBackupPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetNameRetType = string /* @@ -146,10 +186,16 @@ type UpdateBackupPayloadGetNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetSizeAttributeTypeOk(arg UpdateBackupPayloadGetSizeAttributeType) (ret UpdateBackupPayloadGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -157,6 +203,7 @@ func getUpdateBackupPayloadGetSizeAttributeTypeOk(arg UpdateBackupPayloadGetSize return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetSizeAttributeType(arg *UpdateBackupPayloadGetSizeAttributeType, val UpdateBackupPayloadGetSizeRetType) { *arg = &val } @@ -166,8 +213,10 @@ func setUpdateBackupPayloadGetSizeAttributeType(arg *UpdateBackupPayloadGetSizeA */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetSnapshotIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(arg UpdateBackupPayloadGetSnapshotIdAttributeType) (ret UpdateBackupPayloadGetSnapshotIdRetType, ok bool) { if arg == nil { return ret, false @@ -175,11 +224,15 @@ func getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(arg UpdateBackupPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetSnapshotIdAttributeType(arg *UpdateBackupPayloadGetSnapshotIdAttributeType, val UpdateBackupPayloadGetSnapshotIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetSnapshotIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetSnapshotIdRetType = string /* @@ -187,8 +240,10 @@ type UpdateBackupPayloadGetSnapshotIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetStatusAttributeTypeOk(arg UpdateBackupPayloadGetStatusAttributeType) (ret UpdateBackupPayloadGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -196,11 +251,15 @@ func getUpdateBackupPayloadGetStatusAttributeTypeOk(arg UpdateBackupPayloadGetSt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetStatusAttributeType(arg *UpdateBackupPayloadGetStatusAttributeType, val UpdateBackupPayloadGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetStatusRetType = string /* @@ -208,10 +267,16 @@ type UpdateBackupPayloadGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(arg UpdateBackupPayloadGetUpdatedAtAttributeType) (ret UpdateBackupPayloadGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -219,6 +284,7 @@ func getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(arg UpdateBackupPayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetUpdatedAtAttributeType(arg *UpdateBackupPayloadGetUpdatedAtAttributeType, val UpdateBackupPayloadGetUpdatedAtRetType) { *arg = &val } @@ -228,8 +294,10 @@ func setUpdateBackupPayloadGetUpdatedAtAttributeType(arg *UpdateBackupPayloadGet */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(arg UpdateBackupPayloadGetVolumeIdAttributeType) (ret UpdateBackupPayloadGetVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -237,14 +305,19 @@ func getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(arg UpdateBackupPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupPayloadGetVolumeIdAttributeType(arg *UpdateBackupPayloadGetVolumeIdAttributeType, val UpdateBackupPayloadGetVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayloadGetVolumeIdRetType = string // UpdateBackupPayload Object that represents a backup. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupPayload struct { // Object that represents an availability zone. AvailabilityZone UpdateBackupPayloadGetAvailabilityZoneAttributeType `json:"availabilityZone,omitempty"` @@ -254,7 +327,7 @@ type UpdateBackupPayload struct { Encrypted UpdateBackupPayloadgetEncryptedAttributeType `json:"encrypted,omitempty"` // Universally Unique Identifier (UUID). Id UpdateBackupPayloadGetIdAttributeType `json:"id,omitempty"` - // 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. + // 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. Labels UpdateBackupPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name UpdateBackupPayloadGetNameAttributeType `json:"name,omitempty"` @@ -274,6 +347,7 @@ type UpdateBackupPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateBackupPayload() *UpdateBackupPayload { this := UpdateBackupPayload{} return &this @@ -282,12 +356,14 @@ func NewUpdateBackupPayload() *UpdateBackupPayload { // NewUpdateBackupPayloadWithDefaults instantiates a new UpdateBackupPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateBackupPayloadWithDefaults() *UpdateBackupPayload { this := UpdateBackupPayload{} return &this } // GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetAvailabilityZone() (res UpdateBackupPayloadGetAvailabilityZoneRetType) { res, _ = o.GetAvailabilityZoneOk() return @@ -295,22 +371,26 @@ func (o *UpdateBackupPayload) GetAvailabilityZone() (res UpdateBackupPayloadGetA // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetAvailabilityZoneOk() (ret UpdateBackupPayloadGetAvailabilityZoneRetType, ok bool) { return getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // HasAvailabilityZone returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasAvailabilityZone() bool { _, ok := o.GetAvailabilityZoneOk() return ok } // SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetAvailabilityZone(v UpdateBackupPayloadGetAvailabilityZoneRetType) { setUpdateBackupPayloadGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetCreatedAt() (res UpdateBackupPayloadGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -318,22 +398,26 @@ func (o *UpdateBackupPayload) GetCreatedAt() (res UpdateBackupPayloadGetCreatedA // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetCreatedAtOk() (ret UpdateBackupPayloadGetCreatedAtRetType, ok bool) { return getUpdateBackupPayloadGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetCreatedAt(v UpdateBackupPayloadGetCreatedAtRetType) { setUpdateBackupPayloadGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetEncrypted returns the Encrypted field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetEncrypted() (res UpdateBackupPayloadgetEncryptedRetType) { res, _ = o.GetEncryptedOk() return @@ -341,22 +425,26 @@ func (o *UpdateBackupPayload) GetEncrypted() (res UpdateBackupPayloadgetEncrypte // GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetEncryptedOk() (ret UpdateBackupPayloadgetEncryptedRetType, ok bool) { return getUpdateBackupPayloadgetEncryptedAttributeTypeOk(o.Encrypted) } // HasEncrypted returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasEncrypted() bool { _, ok := o.GetEncryptedOk() return ok } // SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetEncrypted(v UpdateBackupPayloadgetEncryptedRetType) { setUpdateBackupPayloadgetEncryptedAttributeType(&o.Encrypted, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetId() (res UpdateBackupPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -364,22 +452,26 @@ func (o *UpdateBackupPayload) GetId() (res UpdateBackupPayloadGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetIdOk() (ret UpdateBackupPayloadGetIdRetType, ok bool) { return getUpdateBackupPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetId(v UpdateBackupPayloadGetIdRetType) { setUpdateBackupPayloadGetIdAttributeType(&o.Id, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetLabels() (res UpdateBackupPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -387,22 +479,26 @@ func (o *UpdateBackupPayload) GetLabels() (res UpdateBackupPayloadGetLabelsRetTy // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetLabelsOk() (ret UpdateBackupPayloadGetLabelsRetType, ok bool) { return getUpdateBackupPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetLabels(v UpdateBackupPayloadGetLabelsRetType) { setUpdateBackupPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetName() (res UpdateBackupPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -410,22 +506,26 @@ func (o *UpdateBackupPayload) GetName() (res UpdateBackupPayloadGetNameRetType) // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetNameOk() (ret UpdateBackupPayloadGetNameRetType, ok bool) { return getUpdateBackupPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetName(v UpdateBackupPayloadGetNameRetType) { setUpdateBackupPayloadGetNameAttributeType(&o.Name, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetSize() (res UpdateBackupPayloadGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -433,22 +533,26 @@ func (o *UpdateBackupPayload) GetSize() (res UpdateBackupPayloadGetSizeRetType) // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetSizeOk() (ret UpdateBackupPayloadGetSizeRetType, ok bool) { return getUpdateBackupPayloadGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetSize(v UpdateBackupPayloadGetSizeRetType) { setUpdateBackupPayloadGetSizeAttributeType(&o.Size, v) } // GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetSnapshotId() (res UpdateBackupPayloadGetSnapshotIdRetType) { res, _ = o.GetSnapshotIdOk() return @@ -456,22 +560,26 @@ func (o *UpdateBackupPayload) GetSnapshotId() (res UpdateBackupPayloadGetSnapsho // GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetSnapshotIdOk() (ret UpdateBackupPayloadGetSnapshotIdRetType, ok bool) { return getUpdateBackupPayloadGetSnapshotIdAttributeTypeOk(o.SnapshotId) } // HasSnapshotId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasSnapshotId() bool { _, ok := o.GetSnapshotIdOk() return ok } // SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetSnapshotId(v UpdateBackupPayloadGetSnapshotIdRetType) { setUpdateBackupPayloadGetSnapshotIdAttributeType(&o.SnapshotId, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetStatus() (res UpdateBackupPayloadGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -479,22 +587,26 @@ func (o *UpdateBackupPayload) GetStatus() (res UpdateBackupPayloadGetStatusRetTy // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetStatusOk() (ret UpdateBackupPayloadGetStatusRetType, ok bool) { return getUpdateBackupPayloadGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetStatus(v UpdateBackupPayloadGetStatusRetType) { setUpdateBackupPayloadGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetUpdatedAt() (res UpdateBackupPayloadGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -502,22 +614,26 @@ func (o *UpdateBackupPayload) GetUpdatedAt() (res UpdateBackupPayloadGetUpdatedA // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetUpdatedAtOk() (ret UpdateBackupPayloadGetUpdatedAtRetType, ok bool) { return getUpdateBackupPayloadGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetUpdatedAt(v UpdateBackupPayloadGetUpdatedAtRetType) { setUpdateBackupPayloadGetUpdatedAtAttributeType(&o.UpdatedAt, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetVolumeId() (res UpdateBackupPayloadGetVolumeIdRetType) { res, _ = o.GetVolumeIdOk() return @@ -525,21 +641,25 @@ func (o *UpdateBackupPayload) GetVolumeId() (res UpdateBackupPayloadGetVolumeIdR // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) GetVolumeIdOk() (ret UpdateBackupPayloadGetVolumeIdRetType, ok bool) { return getUpdateBackupPayloadGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) HasVolumeId() bool { _, ok := o.GetVolumeIdOk() return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupPayload) SetVolumeId(v UpdateBackupPayloadGetVolumeIdRetType) { setUpdateBackupPayloadGetVolumeIdAttributeType(&o.VolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateBackupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateBackupPayloadGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { @@ -578,37 +698,45 @@ func (o UpdateBackupPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateBackupPayload struct { value *UpdateBackupPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateBackupPayload) Get() *UpdateBackupPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateBackupPayload) Set(val *UpdateBackupPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateBackupPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateBackupPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateBackupPayload(val *UpdateBackupPayload) *NullableUpdateBackupPayload { return &NullableUpdateBackupPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateBackupPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateBackupPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_image_payload.go b/services/iaas/model_update_image_payload.go index 2b724c802..cb6ef3732 100644 --- a/services/iaas/model_update_image_payload.go +++ b/services/iaas/model_update_image_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateImagePayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetAgentAttributeType = *ImageAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetAgentArgType = ImageAgent + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetAgentRetType = ImageAgent +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImagePayloadGetAgentAttributeTypeOk(arg UpdateImagePayloadGetAgentAttributeType) (ret UpdateImagePayloadGetAgentRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateImagePayloadGetAgentAttributeTypeOk(arg UpdateImagePayloadGetAgent return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImagePayloadGetAgentAttributeType(arg *UpdateImagePayloadGetAgentAttributeType, val UpdateImagePayloadGetAgentRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setUpdateImagePayloadGetAgentAttributeType(arg *UpdateImagePayloadGetAgentA */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetConfigAttributeType = *ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetConfigArgType = ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetConfigRetType = ImageConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImagePayloadGetConfigAttributeTypeOk(arg UpdateImagePayloadGetConfigAttributeType) (ret UpdateImagePayloadGetConfigRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getUpdateImagePayloadGetConfigAttributeTypeOk(arg UpdateImagePayloadGetConf return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImagePayloadGetConfigAttributeType(arg *UpdateImagePayloadGetConfigAttributeType, val UpdateImagePayloadGetConfigRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setUpdateImagePayloadGetConfigAttributeType(arg *UpdateImagePayloadGetConfi */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetDiskFormatAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImagePayloadGetDiskFormatAttributeTypeOk(arg UpdateImagePayloadGetDiskFormatAttributeType) (ret UpdateImagePayloadGetDiskFormatRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getUpdateImagePayloadGetDiskFormatAttributeTypeOk(arg UpdateImagePayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImagePayloadGetDiskFormatAttributeType(arg *UpdateImagePayloadGetDiskFormatAttributeType, val UpdateImagePayloadGetDiskFormatRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetDiskFormatArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetDiskFormatRetType = string /* @@ -83,10 +104,16 @@ type UpdateImagePayloadGetDiskFormatRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImagePayloadGetLabelsAttributeTypeOk(arg UpdateImagePayloadGetLabelsAttributeType) (ret UpdateImagePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -94,6 +121,7 @@ func getUpdateImagePayloadGetLabelsAttributeTypeOk(arg UpdateImagePayloadGetLabe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImagePayloadGetLabelsAttributeType(arg *UpdateImagePayloadGetLabelsAttributeType, val UpdateImagePayloadGetLabelsRetType) { *arg = &val } @@ -103,10 +131,16 @@ func setUpdateImagePayloadGetLabelsAttributeType(arg *UpdateImagePayloadGetLabel */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetMinDiskSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetMinDiskSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetMinDiskSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(arg UpdateImagePayloadGetMinDiskSizeAttributeType) (ret UpdateImagePayloadGetMinDiskSizeRetType, ok bool) { if arg == nil { return ret, false @@ -114,6 +148,7 @@ func getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(arg UpdateImagePayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImagePayloadGetMinDiskSizeAttributeType(arg *UpdateImagePayloadGetMinDiskSizeAttributeType, val UpdateImagePayloadGetMinDiskSizeRetType) { *arg = &val } @@ -123,10 +158,16 @@ func setUpdateImagePayloadGetMinDiskSizeAttributeType(arg *UpdateImagePayloadGet */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetMinRamAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetMinRamArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetMinRamRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImagePayloadGetMinRamAttributeTypeOk(arg UpdateImagePayloadGetMinRamAttributeType) (ret UpdateImagePayloadGetMinRamRetType, ok bool) { if arg == nil { return ret, false @@ -134,6 +175,7 @@ func getUpdateImagePayloadGetMinRamAttributeTypeOk(arg UpdateImagePayloadGetMinR return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImagePayloadGetMinRamAttributeType(arg *UpdateImagePayloadGetMinRamAttributeType, val UpdateImagePayloadGetMinRamRetType) { *arg = &val } @@ -143,8 +185,10 @@ func setUpdateImagePayloadGetMinRamAttributeType(arg *UpdateImagePayloadGetMinRa */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImagePayloadGetNameAttributeTypeOk(arg UpdateImagePayloadGetNameAttributeType) (ret UpdateImagePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -152,11 +196,15 @@ func getUpdateImagePayloadGetNameAttributeTypeOk(arg UpdateImagePayloadGetNameAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImagePayloadGetNameAttributeType(arg *UpdateImagePayloadGetNameAttributeType, val UpdateImagePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadGetNameRetType = string /* @@ -164,10 +212,16 @@ type UpdateImagePayloadGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadgetProtectedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadgetProtectedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayloadgetProtectedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImagePayloadgetProtectedAttributeTypeOk(arg UpdateImagePayloadgetProtectedAttributeType) (ret UpdateImagePayloadgetProtectedRetType, ok bool) { if arg == nil { return ret, false @@ -175,17 +229,19 @@ func getUpdateImagePayloadgetProtectedAttributeTypeOk(arg UpdateImagePayloadgetP return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImagePayloadgetProtectedAttributeType(arg *UpdateImagePayloadgetProtectedAttributeType, val UpdateImagePayloadgetProtectedRetType) { *arg = &val } // UpdateImagePayload Object that represents an update request body of an Image. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImagePayload struct { Agent UpdateImagePayloadGetAgentAttributeType `json:"agent,omitempty"` Config UpdateImagePayloadGetConfigAttributeType `json:"config,omitempty"` // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. DiskFormat UpdateImagePayloadGetDiskFormatAttributeType `json:"diskFormat,omitempty"` - // 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. + // 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. Labels UpdateImagePayloadGetLabelsAttributeType `json:"labels,omitempty"` // Size in Gigabyte. MinDiskSize UpdateImagePayloadGetMinDiskSizeAttributeType `json:"minDiskSize,omitempty"` @@ -201,6 +257,7 @@ type UpdateImagePayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateImagePayload() *UpdateImagePayload { this := UpdateImagePayload{} return &this @@ -209,12 +266,14 @@ func NewUpdateImagePayload() *UpdateImagePayload { // NewUpdateImagePayloadWithDefaults instantiates a new UpdateImagePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateImagePayloadWithDefaults() *UpdateImagePayload { this := UpdateImagePayload{} return &this } // GetAgent returns the Agent field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetAgent() (res UpdateImagePayloadGetAgentRetType) { res, _ = o.GetAgentOk() return @@ -222,22 +281,26 @@ func (o *UpdateImagePayload) GetAgent() (res UpdateImagePayloadGetAgentRetType) // GetAgentOk returns a tuple with the Agent field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetAgentOk() (ret UpdateImagePayloadGetAgentRetType, ok bool) { return getUpdateImagePayloadGetAgentAttributeTypeOk(o.Agent) } // HasAgent returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) HasAgent() bool { _, ok := o.GetAgentOk() return ok } // SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) SetAgent(v UpdateImagePayloadGetAgentRetType) { setUpdateImagePayloadGetAgentAttributeType(&o.Agent, v) } // GetConfig returns the Config field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetConfig() (res UpdateImagePayloadGetConfigRetType) { res, _ = o.GetConfigOk() return @@ -245,22 +308,26 @@ func (o *UpdateImagePayload) GetConfig() (res UpdateImagePayloadGetConfigRetType // GetConfigOk returns a tuple with the Config field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetConfigOk() (ret UpdateImagePayloadGetConfigRetType, ok bool) { return getUpdateImagePayloadGetConfigAttributeTypeOk(o.Config) } // HasConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) HasConfig() bool { _, ok := o.GetConfigOk() return ok } // SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) SetConfig(v UpdateImagePayloadGetConfigRetType) { setUpdateImagePayloadGetConfigAttributeType(&o.Config, v) } // GetDiskFormat returns the DiskFormat field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetDiskFormat() (res UpdateImagePayloadGetDiskFormatRetType) { res, _ = o.GetDiskFormatOk() return @@ -268,22 +335,26 @@ func (o *UpdateImagePayload) GetDiskFormat() (res UpdateImagePayloadGetDiskForma // GetDiskFormatOk returns a tuple with the DiskFormat field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetDiskFormatOk() (ret UpdateImagePayloadGetDiskFormatRetType, ok bool) { return getUpdateImagePayloadGetDiskFormatAttributeTypeOk(o.DiskFormat) } // HasDiskFormat returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) HasDiskFormat() bool { _, ok := o.GetDiskFormatOk() return ok } // SetDiskFormat gets a reference to the given string and assigns it to the DiskFormat field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) SetDiskFormat(v UpdateImagePayloadGetDiskFormatRetType) { setUpdateImagePayloadGetDiskFormatAttributeType(&o.DiskFormat, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetLabels() (res UpdateImagePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -291,22 +362,26 @@ func (o *UpdateImagePayload) GetLabels() (res UpdateImagePayloadGetLabelsRetType // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetLabelsOk() (ret UpdateImagePayloadGetLabelsRetType, ok bool) { return getUpdateImagePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) SetLabels(v UpdateImagePayloadGetLabelsRetType) { setUpdateImagePayloadGetLabelsAttributeType(&o.Labels, v) } // GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetMinDiskSize() (res UpdateImagePayloadGetMinDiskSizeRetType) { res, _ = o.GetMinDiskSizeOk() return @@ -314,22 +389,26 @@ func (o *UpdateImagePayload) GetMinDiskSize() (res UpdateImagePayloadGetMinDiskS // GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetMinDiskSizeOk() (ret UpdateImagePayloadGetMinDiskSizeRetType, ok bool) { return getUpdateImagePayloadGetMinDiskSizeAttributeTypeOk(o.MinDiskSize) } // HasMinDiskSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) HasMinDiskSize() bool { _, ok := o.GetMinDiskSizeOk() return ok } // SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) SetMinDiskSize(v UpdateImagePayloadGetMinDiskSizeRetType) { setUpdateImagePayloadGetMinDiskSizeAttributeType(&o.MinDiskSize, v) } // GetMinRam returns the MinRam field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetMinRam() (res UpdateImagePayloadGetMinRamRetType) { res, _ = o.GetMinRamOk() return @@ -337,22 +416,26 @@ func (o *UpdateImagePayload) GetMinRam() (res UpdateImagePayloadGetMinRamRetType // GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetMinRamOk() (ret UpdateImagePayloadGetMinRamRetType, ok bool) { return getUpdateImagePayloadGetMinRamAttributeTypeOk(o.MinRam) } // HasMinRam returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) HasMinRam() bool { _, ok := o.GetMinRamOk() return ok } // SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) SetMinRam(v UpdateImagePayloadGetMinRamRetType) { setUpdateImagePayloadGetMinRamAttributeType(&o.MinRam, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetName() (res UpdateImagePayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -360,22 +443,26 @@ func (o *UpdateImagePayload) GetName() (res UpdateImagePayloadGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetNameOk() (ret UpdateImagePayloadGetNameRetType, ok bool) { return getUpdateImagePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) SetName(v UpdateImagePayloadGetNameRetType) { setUpdateImagePayloadGetNameAttributeType(&o.Name, v) } // GetProtected returns the Protected field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetProtected() (res UpdateImagePayloadgetProtectedRetType) { res, _ = o.GetProtectedOk() return @@ -383,21 +470,25 @@ func (o *UpdateImagePayload) GetProtected() (res UpdateImagePayloadgetProtectedR // GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) GetProtectedOk() (ret UpdateImagePayloadgetProtectedRetType, ok bool) { return getUpdateImagePayloadgetProtectedAttributeTypeOk(o.Protected) } // HasProtected returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) HasProtected() bool { _, ok := o.GetProtectedOk() return ok } // SetProtected gets a reference to the given bool and assigns it to the Protected field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImagePayload) SetProtected(v UpdateImagePayloadgetProtectedRetType) { setUpdateImagePayloadgetProtectedAttributeType(&o.Protected, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateImagePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateImagePayloadGetAgentAttributeTypeOk(o.Agent); ok { @@ -427,37 +518,45 @@ func (o UpdateImagePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateImagePayload struct { value *UpdateImagePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateImagePayload) Get() *UpdateImagePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateImagePayload) Set(val *UpdateImagePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateImagePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateImagePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateImagePayload(val *UpdateImagePayload) *NullableUpdateImagePayload { return &NullableUpdateImagePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateImagePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateImagePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_image_share_payload.go b/services/iaas/model_update_image_share_payload.go index e2b7e03bb..a4cddee2e 100644 --- a/services/iaas/model_update_image_share_payload.go +++ b/services/iaas/model_update_image_share_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateImageSharePayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageSharePayloadgetParentOrganizationAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageSharePayloadgetParentOrganizationArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageSharePayloadgetParentOrganizationRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(arg UpdateImageSharePayloadgetParentOrganizationAttributeType) (ret UpdateImageSharePayloadgetParentOrganizationRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(arg UpdateIm return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImageSharePayloadgetParentOrganizationAttributeType(arg *UpdateImageSharePayloadgetParentOrganizationAttributeType, val UpdateImageSharePayloadgetParentOrganizationRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setUpdateImageSharePayloadgetParentOrganizationAttributeType(arg *UpdateIma */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageSharePayloadGetProjectsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageSharePayloadGetProjectsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageSharePayloadGetProjectsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateImageSharePayloadGetProjectsAttributeTypeOk(arg UpdateImageSharePayloadGetProjectsAttributeType) (ret UpdateImageSharePayloadGetProjectsRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +67,13 @@ func getUpdateImageSharePayloadGetProjectsAttributeTypeOk(arg UpdateImageSharePa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateImageSharePayloadGetProjectsAttributeType(arg *UpdateImageSharePayloadGetProjectsAttributeType, val UpdateImageSharePayloadGetProjectsRetType) { *arg = &val } // UpdateImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateImageSharePayload struct { // Image is shared with all projects inside the image owners organization. ParentOrganization UpdateImageSharePayloadgetParentOrganizationAttributeType `json:"parentOrganization,omitempty"` @@ -69,6 +85,7 @@ type UpdateImageSharePayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateImageSharePayload() *UpdateImageSharePayload { this := UpdateImageSharePayload{} return &this @@ -77,12 +94,14 @@ func NewUpdateImageSharePayload() *UpdateImageSharePayload { // NewUpdateImageSharePayloadWithDefaults instantiates a new UpdateImageSharePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateImageSharePayloadWithDefaults() *UpdateImageSharePayload { this := UpdateImageSharePayload{} return &this } // GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImageSharePayload) GetParentOrganization() (res UpdateImageSharePayloadgetParentOrganizationRetType) { res, _ = o.GetParentOrganizationOk() return @@ -90,22 +109,26 @@ func (o *UpdateImageSharePayload) GetParentOrganization() (res UpdateImageShareP // GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImageSharePayload) GetParentOrganizationOk() (ret UpdateImageSharePayloadgetParentOrganizationRetType, ok bool) { return getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization) } // HasParentOrganization returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImageSharePayload) HasParentOrganization() bool { _, ok := o.GetParentOrganizationOk() return ok } // SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImageSharePayload) SetParentOrganization(v UpdateImageSharePayloadgetParentOrganizationRetType) { setUpdateImageSharePayloadgetParentOrganizationAttributeType(&o.ParentOrganization, v) } // GetProjects returns the Projects field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImageSharePayload) GetProjects() (res UpdateImageSharePayloadGetProjectsRetType) { res, _ = o.GetProjectsOk() return @@ -113,21 +136,25 @@ func (o *UpdateImageSharePayload) GetProjects() (res UpdateImageSharePayloadGetP // GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImageSharePayload) GetProjectsOk() (ret UpdateImageSharePayloadGetProjectsRetType, ok bool) { return getUpdateImageSharePayloadGetProjectsAttributeTypeOk(o.Projects) } // HasProjects returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImageSharePayload) HasProjects() bool { _, ok := o.GetProjectsOk() return ok } // SetProjects gets a reference to the given []string and assigns it to the Projects field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateImageSharePayload) SetProjects(v UpdateImageSharePayloadGetProjectsRetType) { setUpdateImageSharePayloadGetProjectsAttributeType(&o.Projects, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateImageSharePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateImageSharePayloadgetParentOrganizationAttributeTypeOk(o.ParentOrganization); ok { @@ -139,37 +166,45 @@ func (o UpdateImageSharePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateImageSharePayload struct { value *UpdateImageSharePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateImageSharePayload) Get() *UpdateImageSharePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateImageSharePayload) Set(val *UpdateImageSharePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateImageSharePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateImageSharePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateImageSharePayload(val *UpdateImageSharePayload) *NullableUpdateImageSharePayload { return &NullableUpdateImageSharePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateImageSharePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateImageSharePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_key_pair_payload.go b/services/iaas/model_update_key_pair_payload.go index d9ba64346..1ae3ec2eb 100644 --- a/services/iaas/model_update_key_pair_payload.go +++ b/services/iaas/model_update_key_pair_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateKeyPairPayload{} */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateKeyPairPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateKeyPairPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateKeyPairPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(arg UpdateKeyPairPayloadGetLabelsAttributeType) (ret UpdateKeyPairPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -33,13 +40,15 @@ func getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(arg UpdateKeyPairPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateKeyPairPayloadGetLabelsAttributeType(arg *UpdateKeyPairPayloadGetLabelsAttributeType, val UpdateKeyPairPayloadGetLabelsRetType) { *arg = &val } // UpdateKeyPairPayload Object that represents an update request body of a public key of an SSH keypair. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateKeyPairPayload struct { - // 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. + // 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. Labels UpdateKeyPairPayloadGetLabelsAttributeType `json:"labels,omitempty"` } @@ -47,6 +56,7 @@ type UpdateKeyPairPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateKeyPairPayload() *UpdateKeyPairPayload { this := UpdateKeyPairPayload{} return &this @@ -55,12 +65,14 @@ func NewUpdateKeyPairPayload() *UpdateKeyPairPayload { // NewUpdateKeyPairPayloadWithDefaults instantiates a new UpdateKeyPairPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateKeyPairPayloadWithDefaults() *UpdateKeyPairPayload { this := UpdateKeyPairPayload{} return &this } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateKeyPairPayload) GetLabels() (res UpdateKeyPairPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -68,21 +80,25 @@ func (o *UpdateKeyPairPayload) GetLabels() (res UpdateKeyPairPayloadGetLabelsRet // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateKeyPairPayload) GetLabelsOk() (ret UpdateKeyPairPayloadGetLabelsRetType, ok bool) { return getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateKeyPairPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateKeyPairPayload) SetLabels(v UpdateKeyPairPayloadGetLabelsRetType) { setUpdateKeyPairPayloadGetLabelsAttributeType(&o.Labels, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateKeyPairPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateKeyPairPayloadGetLabelsAttributeTypeOk(o.Labels); ok { @@ -91,37 +107,45 @@ func (o UpdateKeyPairPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateKeyPairPayload struct { value *UpdateKeyPairPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateKeyPairPayload) Get() *UpdateKeyPairPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateKeyPairPayload) Set(val *UpdateKeyPairPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateKeyPairPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateKeyPairPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateKeyPairPayload(val *UpdateKeyPairPayload) *NullableUpdateKeyPairPayload { return &NullableUpdateKeyPairPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateKeyPairPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateKeyPairPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_network_area_region_payload.go b/services/iaas/model_update_network_area_region_payload.go index 2173fc6f3..815cac99d 100644 --- a/services/iaas/model_update_network_area_region_payload.go +++ b/services/iaas/model_update_network_area_region_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateNetworkAreaRegionPayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRegionPayloadGetIpv4AttributeType = *UpdateRegionalAreaIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRegionPayloadGetIpv4ArgType = UpdateRegionalAreaIPv4 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRegionPayloadGetIpv4RetType = UpdateRegionalAreaIPv4 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(arg UpdateNetworkAreaRegionPayloadGetIpv4AttributeType) (ret UpdateNetworkAreaRegionPayloadGetIpv4RetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getUpdateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(arg UpdateNetworkAr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNetworkAreaRegionPayloadGetIpv4AttributeType(arg *UpdateNetworkAreaRegionPayloadGetIpv4AttributeType, val UpdateNetworkAreaRegionPayloadGetIpv4RetType) { *arg = &val } // UpdateNetworkAreaRegionPayload Object that represents the request body for a regional network area update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRegionPayload struct { Ipv4 UpdateNetworkAreaRegionPayloadGetIpv4AttributeType `json:"ipv4,omitempty"` } @@ -46,6 +55,7 @@ type UpdateNetworkAreaRegionPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNetworkAreaRegionPayload() *UpdateNetworkAreaRegionPayload { this := UpdateNetworkAreaRegionPayload{} return &this @@ -54,12 +64,14 @@ func NewUpdateNetworkAreaRegionPayload() *UpdateNetworkAreaRegionPayload { // NewUpdateNetworkAreaRegionPayloadWithDefaults instantiates a new UpdateNetworkAreaRegionPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNetworkAreaRegionPayloadWithDefaults() *UpdateNetworkAreaRegionPayload { this := UpdateNetworkAreaRegionPayload{} return &this } // GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkAreaRegionPayload) GetIpv4() (res UpdateNetworkAreaRegionPayloadGetIpv4RetType) { res, _ = o.GetIpv4Ok() return @@ -67,21 +79,25 @@ func (o *UpdateNetworkAreaRegionPayload) GetIpv4() (res UpdateNetworkAreaRegionP // GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkAreaRegionPayload) GetIpv4Ok() (ret UpdateNetworkAreaRegionPayloadGetIpv4RetType, ok bool) { return getUpdateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(o.Ipv4) } // HasIpv4 returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkAreaRegionPayload) HasIpv4() bool { _, ok := o.GetIpv4Ok() return ok } // SetIpv4 gets a reference to the given UpdateRegionalAreaIPv4 and assigns it to the Ipv4 field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkAreaRegionPayload) SetIpv4(v UpdateNetworkAreaRegionPayloadGetIpv4RetType) { setUpdateNetworkAreaRegionPayloadGetIpv4AttributeType(&o.Ipv4, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateNetworkAreaRegionPayloadGetIpv4AttributeTypeOk(o.Ipv4); ok { @@ -90,37 +106,45 @@ func (o UpdateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateNetworkAreaRegionPayload struct { value *UpdateNetworkAreaRegionPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkAreaRegionPayload) Get() *UpdateNetworkAreaRegionPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkAreaRegionPayload) Set(val *UpdateNetworkAreaRegionPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkAreaRegionPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkAreaRegionPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateNetworkAreaRegionPayload(val *UpdateNetworkAreaRegionPayload) *NullableUpdateNetworkAreaRegionPayload { return &NullableUpdateNetworkAreaRegionPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkAreaRegionPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_network_area_route_payload.go b/services/iaas/model_update_network_area_route_payload.go index ca41496bb..a047754ef 100644 --- a/services/iaas/model_update_network_area_route_payload.go +++ b/services/iaas/model_update_network_area_route_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateNetworkAreaRoutePayload{} */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRoutePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRoutePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRoutePayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNetworkAreaRoutePayloadGetLabelsAttributeTypeOk(arg UpdateNetworkAreaRoutePayloadGetLabelsAttributeType) (ret UpdateNetworkAreaRoutePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -33,13 +40,15 @@ func getUpdateNetworkAreaRoutePayloadGetLabelsAttributeTypeOk(arg UpdateNetworkA return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNetworkAreaRoutePayloadGetLabelsAttributeType(arg *UpdateNetworkAreaRoutePayloadGetLabelsAttributeType, val UpdateNetworkAreaRoutePayloadGetLabelsRetType) { *arg = &val } // UpdateNetworkAreaRoutePayload Object that represents the request body for a route update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkAreaRoutePayload struct { - // 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. + // 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. Labels UpdateNetworkAreaRoutePayloadGetLabelsAttributeType `json:"labels,omitempty"` } @@ -47,6 +56,7 @@ type UpdateNetworkAreaRoutePayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNetworkAreaRoutePayload() *UpdateNetworkAreaRoutePayload { this := UpdateNetworkAreaRoutePayload{} return &this @@ -55,12 +65,14 @@ func NewUpdateNetworkAreaRoutePayload() *UpdateNetworkAreaRoutePayload { // NewUpdateNetworkAreaRoutePayloadWithDefaults instantiates a new UpdateNetworkAreaRoutePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNetworkAreaRoutePayloadWithDefaults() *UpdateNetworkAreaRoutePayload { this := UpdateNetworkAreaRoutePayload{} return &this } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkAreaRoutePayload) GetLabels() (res UpdateNetworkAreaRoutePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -68,21 +80,25 @@ func (o *UpdateNetworkAreaRoutePayload) GetLabels() (res UpdateNetworkAreaRouteP // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkAreaRoutePayload) GetLabelsOk() (ret UpdateNetworkAreaRoutePayloadGetLabelsRetType, ok bool) { return getUpdateNetworkAreaRoutePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkAreaRoutePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkAreaRoutePayload) SetLabels(v UpdateNetworkAreaRoutePayloadGetLabelsRetType) { setUpdateNetworkAreaRoutePayloadGetLabelsAttributeType(&o.Labels, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateNetworkAreaRoutePayloadGetLabelsAttributeTypeOk(o.Labels); ok { @@ -91,37 +107,45 @@ func (o UpdateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateNetworkAreaRoutePayload struct { value *UpdateNetworkAreaRoutePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkAreaRoutePayload) Get() *UpdateNetworkAreaRoutePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkAreaRoutePayload) Set(val *UpdateNetworkAreaRoutePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkAreaRoutePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkAreaRoutePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateNetworkAreaRoutePayload(val *UpdateNetworkAreaRoutePayload) *NullableUpdateNetworkAreaRoutePayload { return &NullableUpdateNetworkAreaRoutePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_network_ipv4_body.go b/services/iaas/model_update_network_ipv4_body.go index 314eb7c2b..ea10a86fe 100644 --- a/services/iaas/model_update_network_ipv4_body.go +++ b/services/iaas/model_update_network_ipv4_body.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UpdateNetworkIPv4Body{} */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv4BodyGetGatewayAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv4BodyGetGatewayAttributeType) (ret UpdateNetworkIPv4BodyGetGatewayRetType, ok bool) { if arg == nil { return nil, false @@ -31,6 +34,7 @@ func getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv4Body return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNetworkIPv4BodyGetGatewayAttributeType(arg *UpdateNetworkIPv4BodyGetGatewayAttributeType, val UpdateNetworkIPv4BodyGetGatewayRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -39,7 +43,10 @@ func setUpdateNetworkIPv4BodyGetGatewayAttributeType(arg *UpdateNetworkIPv4BodyG } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv4BodyGetGatewayArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv4BodyGetGatewayRetType = *string /* @@ -47,10 +54,16 @@ type UpdateNetworkIPv4BodyGetGatewayRetType = *string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv4BodyGetNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv4BodyGetNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv4BodyGetNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(arg UpdateNetworkIPv4BodyGetNameserversAttributeType) (ret UpdateNetworkIPv4BodyGetNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -58,11 +71,13 @@ func getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(arg UpdateNetworkIPv4 return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNetworkIPv4BodyGetNameserversAttributeType(arg *UpdateNetworkIPv4BodyGetNameserversAttributeType, val UpdateNetworkIPv4BodyGetNameserversRetType) { *arg = &val } // UpdateNetworkIPv4Body The config object for a IPv4 network update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv4Body struct { // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway UpdateNetworkIPv4BodyGetGatewayAttributeType `json:"gateway,omitempty"` @@ -74,6 +89,7 @@ type UpdateNetworkIPv4Body struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { this := UpdateNetworkIPv4Body{} return &this @@ -82,12 +98,14 @@ func NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { // NewUpdateNetworkIPv4BodyWithDefaults instantiates a new UpdateNetworkIPv4Body object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { this := UpdateNetworkIPv4Body{} return &this } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) GetGateway() (res UpdateNetworkIPv4BodyGetGatewayRetType) { res, _ = o.GetGatewayOk() return @@ -96,32 +114,38 @@ func (o *UpdateNetworkIPv4Body) GetGateway() (res UpdateNetworkIPv4BodyGetGatewa // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) GetGatewayOk() (ret UpdateNetworkIPv4BodyGetGatewayRetType, ok bool) { return getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) HasGateway() bool { _, ok := o.GetGatewayOk() return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) SetGateway(v UpdateNetworkIPv4BodyGetGatewayRetType) { setUpdateNetworkIPv4BodyGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) SetGatewayNil() { o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) UnsetGateway() { o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) GetNameservers() (res UpdateNetworkIPv4BodyGetNameserversRetType) { res, _ = o.GetNameserversOk() return @@ -129,21 +153,25 @@ func (o *UpdateNetworkIPv4Body) GetNameservers() (res UpdateNetworkIPv4BodyGetNa // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) GetNameserversOk() (ret UpdateNetworkIPv4BodyGetNameserversRetType, ok bool) { return getUpdateNetworkIPv4BodyGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv4Body) SetNameservers(v UpdateNetworkIPv4BodyGetNameserversRetType) { setUpdateNetworkIPv4BodyGetNameserversAttributeType(&o.Nameservers, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateNetworkIPv4BodyGetGatewayAttributeTypeOk(o.Gateway); ok { @@ -155,37 +183,45 @@ func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateNetworkIPv4Body struct { value *UpdateNetworkIPv4Body isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkIPv4Body) Get() *UpdateNetworkIPv4Body { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkIPv4Body) Set(val *UpdateNetworkIPv4Body) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkIPv4Body) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkIPv4Body) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateNetworkIPv4Body(val *UpdateNetworkIPv4Body) *NullableUpdateNetworkIPv4Body { return &NullableUpdateNetworkIPv4Body{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkIPv4Body) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_network_ipv6_body.go b/services/iaas/model_update_network_ipv6_body.go index dc6e004a8..b7a4e8a82 100644 --- a/services/iaas/model_update_network_ipv6_body.go +++ b/services/iaas/model_update_network_ipv6_body.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UpdateNetworkIPv6Body{} */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv6BodyGetGatewayAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNetworkIPv6BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv6BodyGetGatewayAttributeType) (ret UpdateNetworkIPv6BodyGetGatewayRetType, ok bool) { if arg == nil { return nil, false @@ -31,6 +34,7 @@ func getUpdateNetworkIPv6BodyGetGatewayAttributeTypeOk(arg UpdateNetworkIPv6Body return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNetworkIPv6BodyGetGatewayAttributeType(arg *UpdateNetworkIPv6BodyGetGatewayAttributeType, val UpdateNetworkIPv6BodyGetGatewayRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -39,7 +43,10 @@ func setUpdateNetworkIPv6BodyGetGatewayAttributeType(arg *UpdateNetworkIPv6BodyG } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv6BodyGetGatewayArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv6BodyGetGatewayRetType = *string /* @@ -47,10 +54,16 @@ type UpdateNetworkIPv6BodyGetGatewayRetType = *string */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv6BodyGetNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv6BodyGetNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv6BodyGetNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNetworkIPv6BodyGetNameserversAttributeTypeOk(arg UpdateNetworkIPv6BodyGetNameserversAttributeType) (ret UpdateNetworkIPv6BodyGetNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -58,11 +71,13 @@ func getUpdateNetworkIPv6BodyGetNameserversAttributeTypeOk(arg UpdateNetworkIPv6 return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNetworkIPv6BodyGetNameserversAttributeType(arg *UpdateNetworkIPv6BodyGetNameserversAttributeType, val UpdateNetworkIPv6BodyGetNameserversRetType) { *arg = &val } // UpdateNetworkIPv6Body The config object for a IPv6 network update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNetworkIPv6Body struct { // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway UpdateNetworkIPv6BodyGetGatewayAttributeType `json:"gateway,omitempty"` @@ -74,6 +89,7 @@ type UpdateNetworkIPv6Body struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNetworkIPv6Body() *UpdateNetworkIPv6Body { this := UpdateNetworkIPv6Body{} return &this @@ -82,12 +98,14 @@ func NewUpdateNetworkIPv6Body() *UpdateNetworkIPv6Body { // NewUpdateNetworkIPv6BodyWithDefaults instantiates a new UpdateNetworkIPv6Body object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNetworkIPv6BodyWithDefaults() *UpdateNetworkIPv6Body { this := UpdateNetworkIPv6Body{} return &this } // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) GetGateway() (res UpdateNetworkIPv6BodyGetGatewayRetType) { res, _ = o.GetGatewayOk() return @@ -96,32 +114,38 @@ func (o *UpdateNetworkIPv6Body) GetGateway() (res UpdateNetworkIPv6BodyGetGatewa // GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) GetGatewayOk() (ret UpdateNetworkIPv6BodyGetGatewayRetType, ok bool) { return getUpdateNetworkIPv6BodyGetGatewayAttributeTypeOk(o.Gateway) } // HasGateway returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) HasGateway() bool { _, ok := o.GetGatewayOk() return ok } // SetGateway gets a reference to the given string and assigns it to the Gateway field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) SetGateway(v UpdateNetworkIPv6BodyGetGatewayRetType) { setUpdateNetworkIPv6BodyGetGatewayAttributeType(&o.Gateway, v) } // SetGatewayNil sets the value for Gateway to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) SetGatewayNil() { o.Gateway = nil } // UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) UnsetGateway() { o.Gateway = nil } // GetNameservers returns the Nameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) GetNameservers() (res UpdateNetworkIPv6BodyGetNameserversRetType) { res, _ = o.GetNameserversOk() return @@ -129,21 +153,25 @@ func (o *UpdateNetworkIPv6Body) GetNameservers() (res UpdateNetworkIPv6BodyGetNa // GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) GetNameserversOk() (ret UpdateNetworkIPv6BodyGetNameserversRetType, ok bool) { return getUpdateNetworkIPv6BodyGetNameserversAttributeTypeOk(o.Nameservers) } // HasNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) HasNameservers() bool { _, ok := o.GetNameserversOk() return ok } // SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNetworkIPv6Body) SetNameservers(v UpdateNetworkIPv6BodyGetNameserversRetType) { setUpdateNetworkIPv6BodyGetNameserversAttributeType(&o.Nameservers, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateNetworkIPv6BodyGetGatewayAttributeTypeOk(o.Gateway); ok { @@ -155,37 +183,45 @@ func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateNetworkIPv6Body struct { value *UpdateNetworkIPv6Body isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkIPv6Body) Get() *UpdateNetworkIPv6Body { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkIPv6Body) Set(val *UpdateNetworkIPv6Body) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkIPv6Body) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkIPv6Body) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateNetworkIPv6Body(val *UpdateNetworkIPv6Body) *NullableUpdateNetworkIPv6Body { return &NullableUpdateNetworkIPv6Body{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNetworkIPv6Body) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_nic_payload.go b/services/iaas/model_update_nic_payload.go index e13607838..ba960d6b6 100644 --- a/services/iaas/model_update_nic_payload.go +++ b/services/iaas/model_update_nic_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateNicPayload{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetAllowedAddressesAttributeType = *[]AllowedAddressesInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetAllowedAddressesArgType = []AllowedAddressesInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetAllowedAddressesRetType = []AllowedAddressesInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(arg UpdateNicPayloadGetAllowedAddressesAttributeType) (ret UpdateNicPayloadGetAllowedAddressesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(arg UpdateNicPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNicPayloadGetAllowedAddressesAttributeType(arg *UpdateNicPayloadGetAllowedAddressesAttributeType, val UpdateNicPayloadGetAllowedAddressesRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setUpdateNicPayloadGetAllowedAddressesAttributeType(arg *UpdateNicPayloadGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNicPayloadGetDescriptionAttributeTypeOk(arg UpdateNicPayloadGetDescriptionAttributeType) (ret UpdateNicPayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getUpdateNicPayloadGetDescriptionAttributeTypeOk(arg UpdateNicPayloadGetDes return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNicPayloadGetDescriptionAttributeType(arg *UpdateNicPayloadGetDescriptionAttributeType, val UpdateNicPayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetDescriptionRetType = string /* @@ -63,10 +77,16 @@ type UpdateNicPayloadGetDescriptionRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNicPayloadGetLabelsAttributeTypeOk(arg UpdateNicPayloadGetLabelsAttributeType) (ret UpdateNicPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +94,7 @@ func getUpdateNicPayloadGetLabelsAttributeTypeOk(arg UpdateNicPayloadGetLabelsAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNicPayloadGetLabelsAttributeType(arg *UpdateNicPayloadGetLabelsAttributeType, val UpdateNicPayloadGetLabelsRetType) { *arg = &val } @@ -83,8 +104,10 @@ func setUpdateNicPayloadGetLabelsAttributeType(arg *UpdateNicPayloadGetLabelsAtt */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNicPayloadGetNameAttributeTypeOk(arg UpdateNicPayloadGetNameAttributeType) (ret UpdateNicPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -92,11 +115,15 @@ func getUpdateNicPayloadGetNameAttributeTypeOk(arg UpdateNicPayloadGetNameAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNicPayloadGetNameAttributeType(arg *UpdateNicPayloadGetNameAttributeType, val UpdateNicPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetNameRetType = string /* @@ -104,10 +131,16 @@ type UpdateNicPayloadGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadgetNicSecurityAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadgetNicSecurityArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadgetNicSecurityRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNicPayloadgetNicSecurityAttributeTypeOk(arg UpdateNicPayloadgetNicSecurityAttributeType) (ret UpdateNicPayloadgetNicSecurityRetType, ok bool) { if arg == nil { return ret, false @@ -115,6 +148,7 @@ func getUpdateNicPayloadgetNicSecurityAttributeTypeOk(arg UpdateNicPayloadgetNic return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNicPayloadgetNicSecurityAttributeType(arg *UpdateNicPayloadgetNicSecurityAttributeType, val UpdateNicPayloadgetNicSecurityRetType) { *arg = &val } @@ -124,10 +158,16 @@ func setUpdateNicPayloadgetNicSecurityAttributeType(arg *UpdateNicPayloadgetNicS */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetSecurityGroupsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetSecurityGroupsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayloadGetSecurityGroupsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(arg UpdateNicPayloadGetSecurityGroupsAttributeType) (ret UpdateNicPayloadGetSecurityGroupsRetType, ok bool) { if arg == nil { return ret, false @@ -135,17 +175,19 @@ func getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(arg UpdateNicPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateNicPayloadGetSecurityGroupsAttributeType(arg *UpdateNicPayloadGetSecurityGroupsAttributeType, val UpdateNicPayloadGetSecurityGroupsRetType) { *arg = &val } // UpdateNicPayload Object that represents a network interface update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateNicPayload struct { // A list of IPs or CIDR notations. AllowedAddresses UpdateNicPayloadGetAllowedAddressesAttributeType `json:"allowedAddresses,omitempty"` // Description Object. Allows string up to 255 Characters. Description UpdateNicPayloadGetDescriptionAttributeType `json:"description,omitempty"` - // 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. + // 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. Labels UpdateNicPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name UpdateNicPayloadGetNameAttributeType `json:"name,omitempty"` @@ -159,6 +201,7 @@ type UpdateNicPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNicPayload() *UpdateNicPayload { this := UpdateNicPayload{} return &this @@ -167,12 +210,14 @@ func NewUpdateNicPayload() *UpdateNicPayload { // NewUpdateNicPayloadWithDefaults instantiates a new UpdateNicPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateNicPayloadWithDefaults() *UpdateNicPayload { this := UpdateNicPayload{} return &this } // GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetAllowedAddresses() (res UpdateNicPayloadGetAllowedAddressesRetType) { res, _ = o.GetAllowedAddressesOk() return @@ -180,22 +225,26 @@ func (o *UpdateNicPayload) GetAllowedAddresses() (res UpdateNicPayloadGetAllowed // GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetAllowedAddressesOk() (ret UpdateNicPayloadGetAllowedAddressesRetType, ok bool) { return getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses) } // HasAllowedAddresses returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) HasAllowedAddresses() bool { _, ok := o.GetAllowedAddressesOk() return ok } // SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) SetAllowedAddresses(v UpdateNicPayloadGetAllowedAddressesRetType) { setUpdateNicPayloadGetAllowedAddressesAttributeType(&o.AllowedAddresses, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetDescription() (res UpdateNicPayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -203,22 +252,26 @@ func (o *UpdateNicPayload) GetDescription() (res UpdateNicPayloadGetDescriptionR // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetDescriptionOk() (ret UpdateNicPayloadGetDescriptionRetType, ok bool) { return getUpdateNicPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) SetDescription(v UpdateNicPayloadGetDescriptionRetType) { setUpdateNicPayloadGetDescriptionAttributeType(&o.Description, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetLabels() (res UpdateNicPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -226,22 +279,26 @@ func (o *UpdateNicPayload) GetLabels() (res UpdateNicPayloadGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetLabelsOk() (ret UpdateNicPayloadGetLabelsRetType, ok bool) { return getUpdateNicPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) SetLabels(v UpdateNicPayloadGetLabelsRetType) { setUpdateNicPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetName() (res UpdateNicPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -249,22 +306,26 @@ func (o *UpdateNicPayload) GetName() (res UpdateNicPayloadGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetNameOk() (ret UpdateNicPayloadGetNameRetType, ok bool) { return getUpdateNicPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) SetName(v UpdateNicPayloadGetNameRetType) { setUpdateNicPayloadGetNameAttributeType(&o.Name, v) } // GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetNicSecurity() (res UpdateNicPayloadgetNicSecurityRetType) { res, _ = o.GetNicSecurityOk() return @@ -272,22 +333,26 @@ func (o *UpdateNicPayload) GetNicSecurity() (res UpdateNicPayloadgetNicSecurityR // GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetNicSecurityOk() (ret UpdateNicPayloadgetNicSecurityRetType, ok bool) { return getUpdateNicPayloadgetNicSecurityAttributeTypeOk(o.NicSecurity) } // HasNicSecurity returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) HasNicSecurity() bool { _, ok := o.GetNicSecurityOk() return ok } // SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) SetNicSecurity(v UpdateNicPayloadgetNicSecurityRetType) { setUpdateNicPayloadgetNicSecurityAttributeType(&o.NicSecurity, v) } // GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetSecurityGroups() (res UpdateNicPayloadGetSecurityGroupsRetType) { res, _ = o.GetSecurityGroupsOk() return @@ -295,21 +360,25 @@ func (o *UpdateNicPayload) GetSecurityGroups() (res UpdateNicPayloadGetSecurityG // GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) GetSecurityGroupsOk() (ret UpdateNicPayloadGetSecurityGroupsRetType, ok bool) { return getUpdateNicPayloadGetSecurityGroupsAttributeTypeOk(o.SecurityGroups) } // HasSecurityGroups returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) HasSecurityGroups() bool { _, ok := o.GetSecurityGroupsOk() return ok } // SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateNicPayload) SetSecurityGroups(v UpdateNicPayloadGetSecurityGroupsRetType) { setUpdateNicPayloadGetSecurityGroupsAttributeType(&o.SecurityGroups, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateNicPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateNicPayloadGetAllowedAddressesAttributeTypeOk(o.AllowedAddresses); ok { @@ -333,37 +402,45 @@ func (o UpdateNicPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateNicPayload struct { value *UpdateNicPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNicPayload) Get() *UpdateNicPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNicPayload) Set(val *UpdateNicPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNicPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNicPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateNicPayload(val *UpdateNicPayload) *NullableUpdateNicPayload { return &NullableUpdateNicPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateNicPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateNicPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_public_ip_payload.go b/services/iaas/model_update_public_ip_payload.go index efdc3e9c1..fe0f9c26b 100644 --- a/services/iaas/model_update_public_ip_payload.go +++ b/services/iaas/model_update_public_ip_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UpdatePublicIPPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdatePublicIPPayloadGetIdAttributeTypeOk(arg UpdatePublicIPPayloadGetIdAttributeType) (ret UpdatePublicIPPayloadGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getUpdatePublicIPPayloadGetIdAttributeTypeOk(arg UpdatePublicIPPayloadGetId return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdatePublicIPPayloadGetIdAttributeType(arg *UpdatePublicIPPayloadGetIdAttributeType, val UpdatePublicIPPayloadGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetIdRetType = string /* @@ -43,8 +50,10 @@ type UpdatePublicIPPayloadGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetIpAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdatePublicIPPayloadGetIpAttributeTypeOk(arg UpdatePublicIPPayloadGetIpAttributeType) (ret UpdatePublicIPPayloadGetIpRetType, ok bool) { if arg == nil { return ret, false @@ -52,11 +61,15 @@ func getUpdatePublicIPPayloadGetIpAttributeTypeOk(arg UpdatePublicIPPayloadGetIp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdatePublicIPPayloadGetIpAttributeType(arg *UpdatePublicIPPayloadGetIpAttributeType, val UpdatePublicIPPayloadGetIpRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetIpArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetIpRetType = string /* @@ -64,10 +77,16 @@ type UpdatePublicIPPayloadGetIpRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(arg UpdatePublicIPPayloadGetLabelsAttributeType) (ret UpdatePublicIPPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +94,7 @@ func getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(arg UpdatePublicIPPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdatePublicIPPayloadGetLabelsAttributeType(arg *UpdatePublicIPPayloadGetLabelsAttributeType, val UpdatePublicIPPayloadGetLabelsRetType) { *arg = &val } @@ -84,8 +104,10 @@ func setUpdatePublicIPPayloadGetLabelsAttributeType(arg *UpdatePublicIPPayloadGe */ // isNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetNetworkInterfaceAttributeType = *NullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(arg UpdatePublicIPPayloadGetNetworkInterfaceAttributeType) (ret UpdatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { if arg == nil { return nil, false @@ -93,6 +115,7 @@ func getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(arg UpdatePublic return arg.Get(), true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdatePublicIPPayloadGetNetworkInterfaceAttributeType(arg *UpdatePublicIPPayloadGetNetworkInterfaceAttributeType, val UpdatePublicIPPayloadGetNetworkInterfaceRetType) { if IsNil(*arg) { *arg = NewNullableString(val) @@ -101,16 +124,20 @@ func setUpdatePublicIPPayloadGetNetworkInterfaceAttributeType(arg *UpdatePublicI } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetNetworkInterfaceArgType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayloadGetNetworkInterfaceRetType = *string // UpdatePublicIPPayload Object that represents a public IP. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdatePublicIPPayload struct { // Universally Unique Identifier (UUID). Id UpdatePublicIPPayloadGetIdAttributeType `json:"id,omitempty"` // String that represents an IPv4 address. Ip UpdatePublicIPPayloadGetIpAttributeType `json:"ip,omitempty"` - // 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. + // 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. Labels UpdatePublicIPPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Universally Unique Identifier (UUID). NetworkInterface UpdatePublicIPPayloadGetNetworkInterfaceAttributeType `json:"networkInterface,omitempty"` @@ -120,6 +147,7 @@ type UpdatePublicIPPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdatePublicIPPayload() *UpdatePublicIPPayload { this := UpdatePublicIPPayload{} return &this @@ -128,12 +156,14 @@ func NewUpdatePublicIPPayload() *UpdatePublicIPPayload { // NewUpdatePublicIPPayloadWithDefaults instantiates a new UpdatePublicIPPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdatePublicIPPayloadWithDefaults() *UpdatePublicIPPayload { this := UpdatePublicIPPayload{} return &this } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) GetId() (res UpdatePublicIPPayloadGetIdRetType) { res, _ = o.GetIdOk() return @@ -141,22 +171,26 @@ func (o *UpdatePublicIPPayload) GetId() (res UpdatePublicIPPayloadGetIdRetType) // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) GetIdOk() (ret UpdatePublicIPPayloadGetIdRetType, ok bool) { return getUpdatePublicIPPayloadGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) SetId(v UpdatePublicIPPayloadGetIdRetType) { setUpdatePublicIPPayloadGetIdAttributeType(&o.Id, v) } // GetIp returns the Ip field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) GetIp() (res UpdatePublicIPPayloadGetIpRetType) { res, _ = o.GetIpOk() return @@ -164,22 +198,26 @@ func (o *UpdatePublicIPPayload) GetIp() (res UpdatePublicIPPayloadGetIpRetType) // GetIpOk returns a tuple with the Ip field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) GetIpOk() (ret UpdatePublicIPPayloadGetIpRetType, ok bool) { return getUpdatePublicIPPayloadGetIpAttributeTypeOk(o.Ip) } // HasIp returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) HasIp() bool { _, ok := o.GetIpOk() return ok } // SetIp gets a reference to the given string and assigns it to the Ip field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) SetIp(v UpdatePublicIPPayloadGetIpRetType) { setUpdatePublicIPPayloadGetIpAttributeType(&o.Ip, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) GetLabels() (res UpdatePublicIPPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -187,22 +225,26 @@ func (o *UpdatePublicIPPayload) GetLabels() (res UpdatePublicIPPayloadGetLabelsR // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) GetLabelsOk() (ret UpdatePublicIPPayloadGetLabelsRetType, ok bool) { return getUpdatePublicIPPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) SetLabels(v UpdatePublicIPPayloadGetLabelsRetType) { setUpdatePublicIPPayloadGetLabelsAttributeType(&o.Labels, v) } // GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) GetNetworkInterface() (res UpdatePublicIPPayloadGetNetworkInterfaceRetType) { res, _ = o.GetNetworkInterfaceOk() return @@ -211,31 +253,37 @@ func (o *UpdatePublicIPPayload) GetNetworkInterface() (res UpdatePublicIPPayload // GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) GetNetworkInterfaceOk() (ret UpdatePublicIPPayloadGetNetworkInterfaceRetType, ok bool) { return getUpdatePublicIPPayloadGetNetworkInterfaceAttributeTypeOk(o.NetworkInterface) } // HasNetworkInterface returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) HasNetworkInterface() bool { _, ok := o.GetNetworkInterfaceOk() return ok } // SetNetworkInterface gets a reference to the given string and assigns it to the NetworkInterface field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) SetNetworkInterface(v UpdatePublicIPPayloadGetNetworkInterfaceRetType) { setUpdatePublicIPPayloadGetNetworkInterfaceAttributeType(&o.NetworkInterface, v) } // SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) SetNetworkInterfaceNil() { o.NetworkInterface = nil } // UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdatePublicIPPayload) UnsetNetworkInterface() { o.NetworkInterface = nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdatePublicIPPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdatePublicIPPayloadGetIdAttributeTypeOk(o.Id); ok { @@ -253,37 +301,45 @@ func (o UpdatePublicIPPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdatePublicIPPayload struct { value *UpdatePublicIPPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdatePublicIPPayload) Get() *UpdatePublicIPPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdatePublicIPPayload) Set(val *UpdatePublicIPPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdatePublicIPPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdatePublicIPPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdatePublicIPPayload(val *UpdatePublicIPPayload) *NullableUpdatePublicIPPayload { return &NullableUpdatePublicIPPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdatePublicIPPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdatePublicIPPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_regional_area_ipv4.go b/services/iaas/model_update_regional_area_ipv4.go index 05d22f94a..829961315 100644 --- a/services/iaas/model_update_regional_area_ipv4.go +++ b/services/iaas/model_update_regional_area_ipv4.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateRegionalAreaIPv4{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetDefaultNameserversAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetDefaultNameserversArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetDefaultNameserversRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(arg UpdateRegionalAreaIPv4GetDefaultNameserversAttributeType) (ret UpdateRegionalAreaIPv4GetDefaultNameserversRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(arg UpdateReg return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRegionalAreaIPv4GetDefaultNameserversAttributeType(arg *UpdateRegionalAreaIPv4GetDefaultNameserversAttributeType, val UpdateRegionalAreaIPv4GetDefaultNameserversRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setUpdateRegionalAreaIPv4GetDefaultNameserversAttributeType(arg *UpdateRegi */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetDefaultPrefixLenArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg UpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType) (ret UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(arg UpdateRegio return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType(arg *UpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType, val UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType(arg *UpdateRegion */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetMaxPrefixLenArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetMaxPrefixLenRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg UpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType) (ret UpdateRegionalAreaIPv4GetMaxPrefixLenRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(arg UpdateRegionalA return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType(arg *UpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType, val UpdateRegionalAreaIPv4GetMaxPrefixLenRetType) { *arg = &val } @@ -82,10 +104,16 @@ func setUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType(arg *UpdateRegionalAr */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetMinPrefixLenAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetMinPrefixLenArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4GetMinPrefixLenRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(arg UpdateRegionalAreaIPv4GetMinPrefixLenAttributeType) (ret UpdateRegionalAreaIPv4GetMinPrefixLenRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +121,13 @@ func getUpdateRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(arg UpdateRegionalA return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRegionalAreaIPv4GetMinPrefixLenAttributeType(arg *UpdateRegionalAreaIPv4GetMinPrefixLenAttributeType, val UpdateRegionalAreaIPv4GetMinPrefixLenRetType) { *arg = &val } // UpdateRegionalAreaIPv4 Object that represents the request body for a regional network area IPv4 configuration update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRegionalAreaIPv4 struct { DefaultNameservers UpdateRegionalAreaIPv4GetDefaultNameserversAttributeType `json:"defaultNameservers,omitempty"` // The default prefix length for networks in the network area. @@ -112,6 +142,7 @@ type UpdateRegionalAreaIPv4 struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateRegionalAreaIPv4() *UpdateRegionalAreaIPv4 { this := UpdateRegionalAreaIPv4{} return &this @@ -120,12 +151,14 @@ func NewUpdateRegionalAreaIPv4() *UpdateRegionalAreaIPv4 { // NewUpdateRegionalAreaIPv4WithDefaults instantiates a new UpdateRegionalAreaIPv4 object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateRegionalAreaIPv4WithDefaults() *UpdateRegionalAreaIPv4 { this := UpdateRegionalAreaIPv4{} return &this } // GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) GetDefaultNameservers() (res UpdateRegionalAreaIPv4GetDefaultNameserversRetType) { res, _ = o.GetDefaultNameserversOk() return @@ -133,22 +166,26 @@ func (o *UpdateRegionalAreaIPv4) GetDefaultNameservers() (res UpdateRegionalArea // GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) GetDefaultNameserversOk() (ret UpdateRegionalAreaIPv4GetDefaultNameserversRetType, ok bool) { return getUpdateRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers) } // HasDefaultNameservers returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) HasDefaultNameservers() bool { _, ok := o.GetDefaultNameserversOk() return ok } // SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) SetDefaultNameservers(v UpdateRegionalAreaIPv4GetDefaultNameserversRetType) { setUpdateRegionalAreaIPv4GetDefaultNameserversAttributeType(&o.DefaultNameservers, v) } // GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLen() (res UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType) { res, _ = o.GetDefaultPrefixLenOk() return @@ -156,22 +193,26 @@ func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLen() (res UpdateRegionalAreaIP // GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLenOk() (ret UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType, ok bool) { return getUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeTypeOk(o.DefaultPrefixLen) } // HasDefaultPrefixLen returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) HasDefaultPrefixLen() bool { _, ok := o.GetDefaultPrefixLenOk() return ok } // SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) SetDefaultPrefixLen(v UpdateRegionalAreaIPv4GetDefaultPrefixLenRetType) { setUpdateRegionalAreaIPv4GetDefaultPrefixLenAttributeType(&o.DefaultPrefixLen, v) } // GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLen() (res UpdateRegionalAreaIPv4GetMaxPrefixLenRetType) { res, _ = o.GetMaxPrefixLenOk() return @@ -179,22 +220,26 @@ func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLen() (res UpdateRegionalAreaIPv4Ge // GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLenOk() (ret UpdateRegionalAreaIPv4GetMaxPrefixLenRetType, ok bool) { return getUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeTypeOk(o.MaxPrefixLen) } // HasMaxPrefixLen returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) HasMaxPrefixLen() bool { _, ok := o.GetMaxPrefixLenOk() return ok } // SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) SetMaxPrefixLen(v UpdateRegionalAreaIPv4GetMaxPrefixLenRetType) { setUpdateRegionalAreaIPv4GetMaxPrefixLenAttributeType(&o.MaxPrefixLen, v) } // GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) GetMinPrefixLen() (res UpdateRegionalAreaIPv4GetMinPrefixLenRetType) { res, _ = o.GetMinPrefixLenOk() return @@ -202,21 +247,25 @@ func (o *UpdateRegionalAreaIPv4) GetMinPrefixLen() (res UpdateRegionalAreaIPv4Ge // GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) GetMinPrefixLenOk() (ret UpdateRegionalAreaIPv4GetMinPrefixLenRetType, ok bool) { return getUpdateRegionalAreaIPv4GetMinPrefixLenAttributeTypeOk(o.MinPrefixLen) } // HasMinPrefixLen returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) HasMinPrefixLen() bool { _, ok := o.GetMinPrefixLenOk() return ok } // SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRegionalAreaIPv4) SetMinPrefixLen(v UpdateRegionalAreaIPv4GetMinPrefixLenRetType) { setUpdateRegionalAreaIPv4GetMinPrefixLenAttributeType(&o.MinPrefixLen, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateRegionalAreaIPv4) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateRegionalAreaIPv4GetDefaultNameserversAttributeTypeOk(o.DefaultNameservers); ok { @@ -234,37 +283,45 @@ func (o UpdateRegionalAreaIPv4) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateRegionalAreaIPv4 struct { value *UpdateRegionalAreaIPv4 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRegionalAreaIPv4) Get() *UpdateRegionalAreaIPv4 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRegionalAreaIPv4) Set(val *UpdateRegionalAreaIPv4) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRegionalAreaIPv4) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRegionalAreaIPv4) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateRegionalAreaIPv4(val *UpdateRegionalAreaIPv4) *NullableUpdateRegionalAreaIPv4 { return &NullableUpdateRegionalAreaIPv4{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRegionalAreaIPv4) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRegionalAreaIPv4) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_route_of_routing_table_payload.go b/services/iaas/model_update_route_of_routing_table_payload.go index 210b684d5..5f3d8cf70 100644 --- a/services/iaas/model_update_route_of_routing_table_payload.go +++ b/services/iaas/model_update_route_of_routing_table_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateRouteOfRoutingTablePayload{} */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRouteOfRoutingTablePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRouteOfRoutingTablePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRouteOfRoutingTablePayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRouteOfRoutingTablePayloadGetLabelsAttributeTypeOk(arg UpdateRouteOfRoutingTablePayloadGetLabelsAttributeType) (ret UpdateRouteOfRoutingTablePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -33,13 +40,15 @@ func getUpdateRouteOfRoutingTablePayloadGetLabelsAttributeTypeOk(arg UpdateRoute return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRouteOfRoutingTablePayloadGetLabelsAttributeType(arg *UpdateRouteOfRoutingTablePayloadGetLabelsAttributeType, val UpdateRouteOfRoutingTablePayloadGetLabelsRetType) { *arg = &val } // UpdateRouteOfRoutingTablePayload Object that represents the request body for a route update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRouteOfRoutingTablePayload struct { - // 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. + // 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. Labels UpdateRouteOfRoutingTablePayloadGetLabelsAttributeType `json:"labels,omitempty"` } @@ -47,6 +56,7 @@ type UpdateRouteOfRoutingTablePayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateRouteOfRoutingTablePayload() *UpdateRouteOfRoutingTablePayload { this := UpdateRouteOfRoutingTablePayload{} return &this @@ -55,12 +65,14 @@ func NewUpdateRouteOfRoutingTablePayload() *UpdateRouteOfRoutingTablePayload { // NewUpdateRouteOfRoutingTablePayloadWithDefaults instantiates a new UpdateRouteOfRoutingTablePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateRouteOfRoutingTablePayloadWithDefaults() *UpdateRouteOfRoutingTablePayload { this := UpdateRouteOfRoutingTablePayload{} return &this } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRouteOfRoutingTablePayload) GetLabels() (res UpdateRouteOfRoutingTablePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -68,21 +80,25 @@ func (o *UpdateRouteOfRoutingTablePayload) GetLabels() (res UpdateRouteOfRouting // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRouteOfRoutingTablePayload) GetLabelsOk() (ret UpdateRouteOfRoutingTablePayloadGetLabelsRetType, ok bool) { return getUpdateRouteOfRoutingTablePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRouteOfRoutingTablePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRouteOfRoutingTablePayload) SetLabels(v UpdateRouteOfRoutingTablePayloadGetLabelsRetType) { setUpdateRouteOfRoutingTablePayloadGetLabelsAttributeType(&o.Labels, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateRouteOfRoutingTablePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateRouteOfRoutingTablePayloadGetLabelsAttributeTypeOk(o.Labels); ok { @@ -91,37 +107,45 @@ func (o UpdateRouteOfRoutingTablePayload) ToMap() (map[string]interface{}, error return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateRouteOfRoutingTablePayload struct { value *UpdateRouteOfRoutingTablePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRouteOfRoutingTablePayload) Get() *UpdateRouteOfRoutingTablePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRouteOfRoutingTablePayload) Set(val *UpdateRouteOfRoutingTablePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRouteOfRoutingTablePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRouteOfRoutingTablePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateRouteOfRoutingTablePayload(val *UpdateRouteOfRoutingTablePayload) *NullableUpdateRouteOfRoutingTablePayload { return &NullableUpdateRouteOfRoutingTablePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRouteOfRoutingTablePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_routing_table_of_area_payload.go b/services/iaas/model_update_routing_table_of_area_payload.go index 5a5c9978c..f80907e75 100644 --- a/services/iaas/model_update_routing_table_of_area_payload.go +++ b/services/iaas/model_update_routing_table_of_area_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UpdateRoutingTableOfAreaPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType) (ret UpdateRoutingTableOfAreaPayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeTypeOk(arg UpdateR return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType(arg *UpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType, val UpdateRoutingTableOfAreaPayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetDescriptionRetType = string /* @@ -43,10 +50,16 @@ type UpdateRoutingTableOfAreaPayloadGetDescriptionRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadgetDynamicRoutesArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType) (ret UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeTypeOk(arg Updat return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType(arg *UpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType, val UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType) { *arg = &val } @@ -63,10 +77,16 @@ func setUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType(arg *Update */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRoutingTableOfAreaPayloadGetLabelsAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadGetLabelsAttributeType) (ret UpdateRoutingTableOfAreaPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +94,7 @@ func getUpdateRoutingTableOfAreaPayloadGetLabelsAttributeTypeOk(arg UpdateRoutin return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRoutingTableOfAreaPayloadGetLabelsAttributeType(arg *UpdateRoutingTableOfAreaPayloadGetLabelsAttributeType, val UpdateRoutingTableOfAreaPayloadGetLabelsRetType) { *arg = &val } @@ -83,8 +104,10 @@ func setUpdateRoutingTableOfAreaPayloadGetLabelsAttributeType(arg *UpdateRouting */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRoutingTableOfAreaPayloadGetNameAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadGetNameAttributeType) (ret UpdateRoutingTableOfAreaPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -92,11 +115,15 @@ func getUpdateRoutingTableOfAreaPayloadGetNameAttributeTypeOk(arg UpdateRoutingT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRoutingTableOfAreaPayloadGetNameAttributeType(arg *UpdateRoutingTableOfAreaPayloadGetNameAttributeType, val UpdateRoutingTableOfAreaPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadGetNameRetType = string /* @@ -104,10 +131,16 @@ type UpdateRoutingTableOfAreaPayloadGetNameRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadgetSystemRoutesAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadgetSystemRoutesArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayloadgetSystemRoutesRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateRoutingTableOfAreaPayloadgetSystemRoutesAttributeTypeOk(arg UpdateRoutingTableOfAreaPayloadgetSystemRoutesAttributeType) (ret UpdateRoutingTableOfAreaPayloadgetSystemRoutesRetType, ok bool) { if arg == nil { return ret, false @@ -115,17 +148,19 @@ func getUpdateRoutingTableOfAreaPayloadgetSystemRoutesAttributeTypeOk(arg Update return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateRoutingTableOfAreaPayloadgetSystemRoutesAttributeType(arg *UpdateRoutingTableOfAreaPayloadgetSystemRoutesAttributeType, val UpdateRoutingTableOfAreaPayloadgetSystemRoutesRetType) { *arg = &val } // UpdateRoutingTableOfAreaPayload Object that represents the request body for a routing table update. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateRoutingTableOfAreaPayload struct { // Description Object. Allows string up to 255 Characters. Description UpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType `json:"description,omitempty"` // The update config setting for a routing table which allows propagation of dynamic routes to this routing table. DynamicRoutes UpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType `json:"dynamicRoutes,omitempty"` - // 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. + // 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. Labels UpdateRoutingTableOfAreaPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name UpdateRoutingTableOfAreaPayloadGetNameAttributeType `json:"name,omitempty"` @@ -137,6 +172,7 @@ type UpdateRoutingTableOfAreaPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateRoutingTableOfAreaPayload() *UpdateRoutingTableOfAreaPayload { this := UpdateRoutingTableOfAreaPayload{} return &this @@ -145,12 +181,14 @@ func NewUpdateRoutingTableOfAreaPayload() *UpdateRoutingTableOfAreaPayload { // NewUpdateRoutingTableOfAreaPayloadWithDefaults instantiates a new UpdateRoutingTableOfAreaPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateRoutingTableOfAreaPayloadWithDefaults() *UpdateRoutingTableOfAreaPayload { this := UpdateRoutingTableOfAreaPayload{} return &this } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetDescription() (res UpdateRoutingTableOfAreaPayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -158,22 +196,26 @@ func (o *UpdateRoutingTableOfAreaPayload) GetDescription() (res UpdateRoutingTab // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetDescriptionOk() (ret UpdateRoutingTableOfAreaPayloadGetDescriptionRetType, ok bool) { return getUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) SetDescription(v UpdateRoutingTableOfAreaPayloadGetDescriptionRetType) { setUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeType(&o.Description, v) } // GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutes() (res UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType) { res, _ = o.GetDynamicRoutesOk() return @@ -181,22 +223,26 @@ func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutes() (res UpdateRoutingT // GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutesOk() (ret UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType, ok bool) { return getUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeTypeOk(o.DynamicRoutes) } // HasDynamicRoutes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) HasDynamicRoutes() bool { _, ok := o.GetDynamicRoutesOk() return ok } // SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) SetDynamicRoutes(v UpdateRoutingTableOfAreaPayloadgetDynamicRoutesRetType) { setUpdateRoutingTableOfAreaPayloadgetDynamicRoutesAttributeType(&o.DynamicRoutes, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetLabels() (res UpdateRoutingTableOfAreaPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -204,22 +250,26 @@ func (o *UpdateRoutingTableOfAreaPayload) GetLabels() (res UpdateRoutingTableOfA // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetLabelsOk() (ret UpdateRoutingTableOfAreaPayloadGetLabelsRetType, ok bool) { return getUpdateRoutingTableOfAreaPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) SetLabels(v UpdateRoutingTableOfAreaPayloadGetLabelsRetType) { setUpdateRoutingTableOfAreaPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetName() (res UpdateRoutingTableOfAreaPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -227,22 +277,26 @@ func (o *UpdateRoutingTableOfAreaPayload) GetName() (res UpdateRoutingTableOfAre // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetNameOk() (ret UpdateRoutingTableOfAreaPayloadGetNameRetType, ok bool) { return getUpdateRoutingTableOfAreaPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) SetName(v UpdateRoutingTableOfAreaPayloadGetNameRetType) { setUpdateRoutingTableOfAreaPayloadGetNameAttributeType(&o.Name, v) } // GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutes() (res UpdateRoutingTableOfAreaPayloadgetSystemRoutesRetType) { res, _ = o.GetSystemRoutesOk() return @@ -250,21 +304,25 @@ func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutes() (res UpdateRoutingTa // GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutesOk() (ret UpdateRoutingTableOfAreaPayloadgetSystemRoutesRetType, ok bool) { return getUpdateRoutingTableOfAreaPayloadgetSystemRoutesAttributeTypeOk(o.SystemRoutes) } // HasSystemRoutes returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) HasSystemRoutes() bool { _, ok := o.GetSystemRoutesOk() return ok } // SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateRoutingTableOfAreaPayload) SetSystemRoutes(v UpdateRoutingTableOfAreaPayloadgetSystemRoutesRetType) { setUpdateRoutingTableOfAreaPayloadgetSystemRoutesAttributeType(&o.SystemRoutes, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateRoutingTableOfAreaPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateRoutingTableOfAreaPayloadGetDescriptionAttributeTypeOk(o.Description); ok { @@ -285,37 +343,45 @@ func (o UpdateRoutingTableOfAreaPayload) ToMap() (map[string]interface{}, error) return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateRoutingTableOfAreaPayload struct { value *UpdateRoutingTableOfAreaPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRoutingTableOfAreaPayload) Get() *UpdateRoutingTableOfAreaPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRoutingTableOfAreaPayload) Set(val *UpdateRoutingTableOfAreaPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRoutingTableOfAreaPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRoutingTableOfAreaPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateRoutingTableOfAreaPayload(val *UpdateRoutingTableOfAreaPayload) *NullableUpdateRoutingTableOfAreaPayload { return &NullableUpdateRoutingTableOfAreaPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateRoutingTableOfAreaPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_security_group_payload.go b/services/iaas/model_update_security_group_payload.go index 8ba1f5131..b48172a65 100644 --- a/services/iaas/model_update_security_group_payload.go +++ b/services/iaas/model_update_security_group_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &UpdateSecurityGroupPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(arg UpdateSecurityGroupPayloadGetDescriptionAttributeType) (ret UpdateSecurityGroupPayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(arg UpdateSecuri return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateSecurityGroupPayloadGetDescriptionAttributeType(arg *UpdateSecurityGroupPayloadGetDescriptionAttributeType, val UpdateSecurityGroupPayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetDescriptionRetType = string /* @@ -43,10 +50,16 @@ type UpdateSecurityGroupPayloadGetDescriptionRetType = string */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(arg UpdateSecurityGroupPayloadGetLabelsAttributeType) (ret UpdateSecurityGroupPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(arg UpdateSecurityGro return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateSecurityGroupPayloadGetLabelsAttributeType(arg *UpdateSecurityGroupPayloadGetLabelsAttributeType, val UpdateSecurityGroupPayloadGetLabelsRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setUpdateSecurityGroupPayloadGetLabelsAttributeType(arg *UpdateSecurityGrou */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(arg UpdateSecurityGroupPayloadGetNameAttributeType) (ret UpdateSecurityGroupPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -72,18 +88,23 @@ func getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(arg UpdateSecurityGroup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateSecurityGroupPayloadGetNameAttributeType(arg *UpdateSecurityGroupPayloadGetNameAttributeType, val UpdateSecurityGroupPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayloadGetNameRetType = string // UpdateSecurityGroupPayload Object that represents an update request body of a security group. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSecurityGroupPayload struct { // Description Object. Allows string up to 255 Characters. Description UpdateSecurityGroupPayloadGetDescriptionAttributeType `json:"description,omitempty"` - // 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. + // 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. Labels UpdateSecurityGroupPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name UpdateSecurityGroupPayloadGetNameAttributeType `json:"name,omitempty"` @@ -93,6 +114,7 @@ type UpdateSecurityGroupPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateSecurityGroupPayload() *UpdateSecurityGroupPayload { this := UpdateSecurityGroupPayload{} return &this @@ -101,12 +123,14 @@ func NewUpdateSecurityGroupPayload() *UpdateSecurityGroupPayload { // NewUpdateSecurityGroupPayloadWithDefaults instantiates a new UpdateSecurityGroupPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateSecurityGroupPayloadWithDefaults() *UpdateSecurityGroupPayload { this := UpdateSecurityGroupPayload{} return &this } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) GetDescription() (res UpdateSecurityGroupPayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -114,22 +138,26 @@ func (o *UpdateSecurityGroupPayload) GetDescription() (res UpdateSecurityGroupPa // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) GetDescriptionOk() (ret UpdateSecurityGroupPayloadGetDescriptionRetType, ok bool) { return getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) SetDescription(v UpdateSecurityGroupPayloadGetDescriptionRetType) { setUpdateSecurityGroupPayloadGetDescriptionAttributeType(&o.Description, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) GetLabels() (res UpdateSecurityGroupPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -137,22 +165,26 @@ func (o *UpdateSecurityGroupPayload) GetLabels() (res UpdateSecurityGroupPayload // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) GetLabelsOk() (ret UpdateSecurityGroupPayloadGetLabelsRetType, ok bool) { return getUpdateSecurityGroupPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) SetLabels(v UpdateSecurityGroupPayloadGetLabelsRetType) { setUpdateSecurityGroupPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) GetName() (res UpdateSecurityGroupPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -160,21 +192,25 @@ func (o *UpdateSecurityGroupPayload) GetName() (res UpdateSecurityGroupPayloadGe // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) GetNameOk() (ret UpdateSecurityGroupPayloadGetNameRetType, ok bool) { return getUpdateSecurityGroupPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSecurityGroupPayload) SetName(v UpdateSecurityGroupPayloadGetNameRetType) { setUpdateSecurityGroupPayloadGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateSecurityGroupPayloadGetDescriptionAttributeTypeOk(o.Description); ok { @@ -189,37 +225,45 @@ func (o UpdateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateSecurityGroupPayload struct { value *UpdateSecurityGroupPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateSecurityGroupPayload) Get() *UpdateSecurityGroupPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateSecurityGroupPayload) Set(val *UpdateSecurityGroupPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateSecurityGroupPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateSecurityGroupPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateSecurityGroupPayload(val *UpdateSecurityGroupPayload) *NullableUpdateSecurityGroupPayload { return &NullableUpdateSecurityGroupPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateSecurityGroupPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateSecurityGroupPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_server_payload.go b/services/iaas/model_update_server_payload.go index 41024fa9d..772917365 100644 --- a/services/iaas/model_update_server_payload.go +++ b/services/iaas/model_update_server_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateServerPayload{} */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateServerPayloadGetLabelsAttributeTypeOk(arg UpdateServerPayloadGetLabelsAttributeType) (ret UpdateServerPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateServerPayloadGetLabelsAttributeTypeOk(arg UpdateServerPayloadGetLa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateServerPayloadGetLabelsAttributeType(arg *UpdateServerPayloadGetLabelsAttributeType, val UpdateServerPayloadGetLabelsRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setUpdateServerPayloadGetLabelsAttributeType(arg *UpdateServerPayloadGetLab */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetMetadataAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetMetadataArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetMetadataRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateServerPayloadGetMetadataAttributeTypeOk(arg UpdateServerPayloadGetMetadataAttributeType) (ret UpdateServerPayloadGetMetadataRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getUpdateServerPayloadGetMetadataAttributeTypeOk(arg UpdateServerPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateServerPayloadGetMetadataAttributeType(arg *UpdateServerPayloadGetMetadataAttributeType, val UpdateServerPayloadGetMetadataRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setUpdateServerPayloadGetMetadataAttributeType(arg *UpdateServerPayloadGetM */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateServerPayloadGetNameAttributeTypeOk(arg UpdateServerPayloadGetNameAttributeType) (ret UpdateServerPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -71,16 +88,21 @@ func getUpdateServerPayloadGetNameAttributeTypeOk(arg UpdateServerPayloadGetName return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateServerPayloadGetNameAttributeType(arg *UpdateServerPayloadGetNameAttributeType, val UpdateServerPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayloadGetNameRetType = string // UpdateServerPayload Object that represents an update request body of a server. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateServerPayload struct { - // 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. + // 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. Labels UpdateServerPayloadGetLabelsAttributeType `json:"labels,omitempty"` // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. Metadata UpdateServerPayloadGetMetadataAttributeType `json:"metadata,omitempty"` @@ -92,6 +114,7 @@ type UpdateServerPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateServerPayload() *UpdateServerPayload { this := UpdateServerPayload{} return &this @@ -100,12 +123,14 @@ func NewUpdateServerPayload() *UpdateServerPayload { // NewUpdateServerPayloadWithDefaults instantiates a new UpdateServerPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateServerPayloadWithDefaults() *UpdateServerPayload { this := UpdateServerPayload{} return &this } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) GetLabels() (res UpdateServerPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -113,22 +138,26 @@ func (o *UpdateServerPayload) GetLabels() (res UpdateServerPayloadGetLabelsRetTy // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) GetLabelsOk() (ret UpdateServerPayloadGetLabelsRetType, ok bool) { return getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) SetLabels(v UpdateServerPayloadGetLabelsRetType) { setUpdateServerPayloadGetLabelsAttributeType(&o.Labels, v) } // GetMetadata returns the Metadata field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) GetMetadata() (res UpdateServerPayloadGetMetadataRetType) { res, _ = o.GetMetadataOk() return @@ -136,22 +165,26 @@ func (o *UpdateServerPayload) GetMetadata() (res UpdateServerPayloadGetMetadataR // GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) GetMetadataOk() (ret UpdateServerPayloadGetMetadataRetType, ok bool) { return getUpdateServerPayloadGetMetadataAttributeTypeOk(o.Metadata) } // HasMetadata returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) HasMetadata() bool { _, ok := o.GetMetadataOk() return ok } // SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) SetMetadata(v UpdateServerPayloadGetMetadataRetType) { setUpdateServerPayloadGetMetadataAttributeType(&o.Metadata, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) GetName() (res UpdateServerPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -159,21 +192,25 @@ func (o *UpdateServerPayload) GetName() (res UpdateServerPayloadGetNameRetType) // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) GetNameOk() (ret UpdateServerPayloadGetNameRetType, ok bool) { return getUpdateServerPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateServerPayload) SetName(v UpdateServerPayloadGetNameRetType) { setUpdateServerPayloadGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateServerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { @@ -188,37 +225,45 @@ func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateServerPayload struct { value *UpdateServerPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateServerPayload) Get() *UpdateServerPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateServerPayload) Set(val *UpdateServerPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateServerPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateServerPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateServerPayload(val *UpdateServerPayload) *NullableUpdateServerPayload { return &NullableUpdateServerPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateServerPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateServerPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_snapshot_payload.go b/services/iaas/model_update_snapshot_payload.go index dff31d71c..e8a152c23 100644 --- a/services/iaas/model_update_snapshot_payload.go +++ b/services/iaas/model_update_snapshot_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateSnapshotPayload{} */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSnapshotPayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSnapshotPayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSnapshotPayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(arg UpdateSnapshotPayloadGetLabelsAttributeType) (ret UpdateSnapshotPayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(arg UpdateSnapshotPayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateSnapshotPayloadGetLabelsAttributeType(arg *UpdateSnapshotPayloadGetLabelsAttributeType, val UpdateSnapshotPayloadGetLabelsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setUpdateSnapshotPayloadGetLabelsAttributeType(arg *UpdateSnapshotPayloadGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSnapshotPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateSnapshotPayloadGetNameAttributeTypeOk(arg UpdateSnapshotPayloadGetNameAttributeType) (ret UpdateSnapshotPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -51,16 +61,21 @@ func getUpdateSnapshotPayloadGetNameAttributeTypeOk(arg UpdateSnapshotPayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateSnapshotPayloadGetNameAttributeType(arg *UpdateSnapshotPayloadGetNameAttributeType, val UpdateSnapshotPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSnapshotPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSnapshotPayloadGetNameRetType = string // UpdateSnapshotPayload Object that represents an update request body of a snapshot. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateSnapshotPayload struct { - // 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. + // 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. Labels UpdateSnapshotPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name UpdateSnapshotPayloadGetNameAttributeType `json:"name,omitempty"` @@ -70,6 +85,7 @@ type UpdateSnapshotPayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateSnapshotPayload() *UpdateSnapshotPayload { this := UpdateSnapshotPayload{} return &this @@ -78,12 +94,14 @@ func NewUpdateSnapshotPayload() *UpdateSnapshotPayload { // NewUpdateSnapshotPayloadWithDefaults instantiates a new UpdateSnapshotPayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateSnapshotPayloadWithDefaults() *UpdateSnapshotPayload { this := UpdateSnapshotPayload{} return &this } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSnapshotPayload) GetLabels() (res UpdateSnapshotPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -91,22 +109,26 @@ func (o *UpdateSnapshotPayload) GetLabels() (res UpdateSnapshotPayloadGetLabelsR // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSnapshotPayload) GetLabelsOk() (ret UpdateSnapshotPayloadGetLabelsRetType, ok bool) { return getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSnapshotPayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSnapshotPayload) SetLabels(v UpdateSnapshotPayloadGetLabelsRetType) { setUpdateSnapshotPayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSnapshotPayload) GetName() (res UpdateSnapshotPayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -114,21 +136,25 @@ func (o *UpdateSnapshotPayload) GetName() (res UpdateSnapshotPayloadGetNameRetTy // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSnapshotPayload) GetNameOk() (ret UpdateSnapshotPayloadGetNameRetType, ok bool) { return getUpdateSnapshotPayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSnapshotPayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateSnapshotPayload) SetName(v UpdateSnapshotPayloadGetNameRetType) { setUpdateSnapshotPayloadGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateSnapshotPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateSnapshotPayloadGetLabelsAttributeTypeOk(o.Labels); ok { @@ -140,37 +166,45 @@ func (o UpdateSnapshotPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateSnapshotPayload struct { value *UpdateSnapshotPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateSnapshotPayload) Get() *UpdateSnapshotPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateSnapshotPayload) Set(val *UpdateSnapshotPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateSnapshotPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateSnapshotPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateSnapshotPayload(val *UpdateSnapshotPayload) *NullableUpdateSnapshotPayload { return &NullableUpdateSnapshotPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateSnapshotPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateSnapshotPayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_update_volume_payload.go b/services/iaas/model_update_volume_payload.go index 55afc7701..231e95bc2 100644 --- a/services/iaas/model_update_volume_payload.go +++ b/services/iaas/model_update_volume_payload.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateVolumePayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadgetBootableAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadgetBootableArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadgetBootableRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateVolumePayloadgetBootableAttributeTypeOk(arg UpdateVolumePayloadgetBootableAttributeType) (ret UpdateVolumePayloadgetBootableRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateVolumePayloadgetBootableAttributeTypeOk(arg UpdateVolumePayloadget return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateVolumePayloadgetBootableAttributeType(arg *UpdateVolumePayloadgetBootableAttributeType, val UpdateVolumePayloadgetBootableRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setUpdateVolumePayloadgetBootableAttributeType(arg *UpdateVolumePayloadgetB */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateVolumePayloadGetDescriptionAttributeTypeOk(arg UpdateVolumePayloadGetDescriptionAttributeType) (ret UpdateVolumePayloadGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getUpdateVolumePayloadGetDescriptionAttributeTypeOk(arg UpdateVolumePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateVolumePayloadGetDescriptionAttributeType(arg *UpdateVolumePayloadGetDescriptionAttributeType, val UpdateVolumePayloadGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetDescriptionRetType = string /* @@ -63,10 +77,16 @@ type UpdateVolumePayloadGetDescriptionRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetImageConfigAttributeType = *ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetImageConfigArgType = ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetImageConfigRetType = ImageConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateVolumePayloadGetImageConfigAttributeTypeOk(arg UpdateVolumePayloadGetImageConfigAttributeType) (ret UpdateVolumePayloadGetImageConfigRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +94,7 @@ func getUpdateVolumePayloadGetImageConfigAttributeTypeOk(arg UpdateVolumePayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateVolumePayloadGetImageConfigAttributeType(arg *UpdateVolumePayloadGetImageConfigAttributeType, val UpdateVolumePayloadGetImageConfigRetType) { *arg = &val } @@ -83,10 +104,16 @@ func setUpdateVolumePayloadGetImageConfigAttributeType(arg *UpdateVolumePayloadG */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateVolumePayloadGetLabelsAttributeTypeOk(arg UpdateVolumePayloadGetLabelsAttributeType) (ret UpdateVolumePayloadGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -94,6 +121,7 @@ func getUpdateVolumePayloadGetLabelsAttributeTypeOk(arg UpdateVolumePayloadGetLa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateVolumePayloadGetLabelsAttributeType(arg *UpdateVolumePayloadGetLabelsAttributeType, val UpdateVolumePayloadGetLabelsRetType) { *arg = &val } @@ -103,8 +131,10 @@ func setUpdateVolumePayloadGetLabelsAttributeType(arg *UpdateVolumePayloadGetLab */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateVolumePayloadGetNameAttributeTypeOk(arg UpdateVolumePayloadGetNameAttributeType) (ret UpdateVolumePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -112,21 +142,26 @@ func getUpdateVolumePayloadGetNameAttributeTypeOk(arg UpdateVolumePayloadGetName return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateVolumePayloadGetNameAttributeType(arg *UpdateVolumePayloadGetNameAttributeType, val UpdateVolumePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayloadGetNameRetType = string // UpdateVolumePayload Object that represents an update request body of a volume. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateVolumePayload struct { // Indicates if a volume is bootable. Bootable UpdateVolumePayloadgetBootableAttributeType `json:"bootable,omitempty"` // Description Object. Allows string up to 255 Characters. Description UpdateVolumePayloadGetDescriptionAttributeType `json:"description,omitempty"` ImageConfig UpdateVolumePayloadGetImageConfigAttributeType `json:"imageConfig,omitempty"` - // 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. + // 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. Labels UpdateVolumePayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name UpdateVolumePayloadGetNameAttributeType `json:"name,omitempty"` @@ -136,6 +171,7 @@ type UpdateVolumePayload struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateVolumePayload() *UpdateVolumePayload { this := UpdateVolumePayload{} return &this @@ -144,12 +180,14 @@ func NewUpdateVolumePayload() *UpdateVolumePayload { // NewUpdateVolumePayloadWithDefaults instantiates a new UpdateVolumePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateVolumePayloadWithDefaults() *UpdateVolumePayload { this := UpdateVolumePayload{} return &this } // GetBootable returns the Bootable field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetBootable() (res UpdateVolumePayloadgetBootableRetType) { res, _ = o.GetBootableOk() return @@ -157,22 +195,26 @@ func (o *UpdateVolumePayload) GetBootable() (res UpdateVolumePayloadgetBootableR // GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetBootableOk() (ret UpdateVolumePayloadgetBootableRetType, ok bool) { return getUpdateVolumePayloadgetBootableAttributeTypeOk(o.Bootable) } // HasBootable returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) HasBootable() bool { _, ok := o.GetBootableOk() return ok } // SetBootable gets a reference to the given bool and assigns it to the Bootable field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) SetBootable(v UpdateVolumePayloadgetBootableRetType) { setUpdateVolumePayloadgetBootableAttributeType(&o.Bootable, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetDescription() (res UpdateVolumePayloadGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -180,22 +222,26 @@ func (o *UpdateVolumePayload) GetDescription() (res UpdateVolumePayloadGetDescri // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetDescriptionOk() (ret UpdateVolumePayloadGetDescriptionRetType, ok bool) { return getUpdateVolumePayloadGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) SetDescription(v UpdateVolumePayloadGetDescriptionRetType) { setUpdateVolumePayloadGetDescriptionAttributeType(&o.Description, v) } // GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetImageConfig() (res UpdateVolumePayloadGetImageConfigRetType) { res, _ = o.GetImageConfigOk() return @@ -203,22 +249,26 @@ func (o *UpdateVolumePayload) GetImageConfig() (res UpdateVolumePayloadGetImageC // GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetImageConfigOk() (ret UpdateVolumePayloadGetImageConfigRetType, ok bool) { return getUpdateVolumePayloadGetImageConfigAttributeTypeOk(o.ImageConfig) } // HasImageConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) HasImageConfig() bool { _, ok := o.GetImageConfigOk() return ok } // SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) SetImageConfig(v UpdateVolumePayloadGetImageConfigRetType) { setUpdateVolumePayloadGetImageConfigAttributeType(&o.ImageConfig, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetLabels() (res UpdateVolumePayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -226,22 +276,26 @@ func (o *UpdateVolumePayload) GetLabels() (res UpdateVolumePayloadGetLabelsRetTy // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetLabelsOk() (ret UpdateVolumePayloadGetLabelsRetType, ok bool) { return getUpdateVolumePayloadGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) SetLabels(v UpdateVolumePayloadGetLabelsRetType) { setUpdateVolumePayloadGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetName() (res UpdateVolumePayloadGetNameRetType) { res, _ = o.GetNameOk() return @@ -249,21 +303,25 @@ func (o *UpdateVolumePayload) GetName() (res UpdateVolumePayloadGetNameRetType) // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) GetNameOk() (ret UpdateVolumePayloadGetNameRetType, ok bool) { return getUpdateVolumePayloadGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateVolumePayload) SetName(v UpdateVolumePayloadGetNameRetType) { setUpdateVolumePayloadGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateVolumePayloadgetBootableAttributeTypeOk(o.Bootable); ok { @@ -284,37 +342,45 @@ func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateVolumePayload struct { value *UpdateVolumePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateVolumePayload) Get() *UpdateVolumePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateVolumePayload) Set(val *UpdateVolumePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateVolumePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateVolumePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateVolumePayload(val *UpdateVolumePayload) *NullableUpdateVolumePayload { return &NullableUpdateVolumePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateVolumePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateVolumePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_volume.go b/services/iaas/model_volume.go index 107cb9f09..77bc7b566 100644 --- a/services/iaas/model_volume.go +++ b/services/iaas/model_volume.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &Volume{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetAvailabilityZoneAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetAvailabilityZoneAttributeTypeOk(arg VolumeGetAvailabilityZoneAttributeType) (ret VolumeGetAvailabilityZoneRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getVolumeGetAvailabilityZoneAttributeTypeOk(arg VolumeGetAvailabilityZoneAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetAvailabilityZoneAttributeType(arg *VolumeGetAvailabilityZoneAttributeType, val VolumeGetAvailabilityZoneRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetAvailabilityZoneArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetAvailabilityZoneRetType = string /* @@ -44,10 +51,16 @@ type VolumeGetAvailabilityZoneRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumegetBootableAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumegetBootableArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumegetBootableRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumegetBootableAttributeTypeOk(arg VolumegetBootableAttributeType) (ret VolumegetBootableRetType, ok bool) { if arg == nil { return ret, false @@ -55,6 +68,7 @@ func getVolumegetBootableAttributeTypeOk(arg VolumegetBootableAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumegetBootableAttributeType(arg *VolumegetBootableAttributeType, val VolumegetBootableRetType) { *arg = &val } @@ -64,10 +78,16 @@ func setVolumegetBootableAttributeType(arg *VolumegetBootableAttributeType, val */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetCreatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetCreatedAtAttributeTypeOk(arg VolumeGetCreatedAtAttributeType) (ret VolumeGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -75,6 +95,7 @@ func getVolumeGetCreatedAtAttributeTypeOk(arg VolumeGetCreatedAtAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetCreatedAtAttributeType(arg *VolumeGetCreatedAtAttributeType, val VolumeGetCreatedAtRetType) { *arg = &val } @@ -84,8 +105,10 @@ func setVolumeGetCreatedAtAttributeType(arg *VolumeGetCreatedAtAttributeType, va */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetDescriptionAttributeTypeOk(arg VolumeGetDescriptionAttributeType) (ret VolumeGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +116,15 @@ func getVolumeGetDescriptionAttributeTypeOk(arg VolumeGetDescriptionAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetDescriptionAttributeType(arg *VolumeGetDescriptionAttributeType, val VolumeGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetDescriptionRetType = string /* @@ -105,10 +132,16 @@ type VolumeGetDescriptionRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumegetEncryptedAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumegetEncryptedArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumegetEncryptedRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumegetEncryptedAttributeTypeOk(arg VolumegetEncryptedAttributeType) (ret VolumegetEncryptedRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +149,7 @@ func getVolumegetEncryptedAttributeTypeOk(arg VolumegetEncryptedAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumegetEncryptedAttributeType(arg *VolumegetEncryptedAttributeType, val VolumegetEncryptedRetType) { *arg = &val } @@ -125,10 +159,16 @@ func setVolumegetEncryptedAttributeType(arg *VolumegetEncryptedAttributeType, va */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetEncryptionParametersAttributeType = *VolumeEncryptionParameter + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetEncryptionParametersArgType = VolumeEncryptionParameter + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetEncryptionParametersRetType = VolumeEncryptionParameter +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetEncryptionParametersAttributeTypeOk(arg VolumeGetEncryptionParametersAttributeType) (ret VolumeGetEncryptionParametersRetType, ok bool) { if arg == nil { return ret, false @@ -136,6 +176,7 @@ func getVolumeGetEncryptionParametersAttributeTypeOk(arg VolumeGetEncryptionPara return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetEncryptionParametersAttributeType(arg *VolumeGetEncryptionParametersAttributeType, val VolumeGetEncryptionParametersRetType) { *arg = &val } @@ -145,8 +186,10 @@ func setVolumeGetEncryptionParametersAttributeType(arg *VolumeGetEncryptionParam */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetIdAttributeTypeOk(arg VolumeGetIdAttributeType) (ret VolumeGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -154,11 +197,15 @@ func getVolumeGetIdAttributeTypeOk(arg VolumeGetIdAttributeType) (ret VolumeGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetIdAttributeType(arg *VolumeGetIdAttributeType, val VolumeGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetIdRetType = string /* @@ -166,10 +213,16 @@ type VolumeGetIdRetType = string */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetImageConfigAttributeType = *ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetImageConfigArgType = ImageConfig + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetImageConfigRetType = ImageConfig +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetImageConfigAttributeTypeOk(arg VolumeGetImageConfigAttributeType) (ret VolumeGetImageConfigRetType, ok bool) { if arg == nil { return ret, false @@ -177,6 +230,7 @@ func getVolumeGetImageConfigAttributeTypeOk(arg VolumeGetImageConfigAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetImageConfigAttributeType(arg *VolumeGetImageConfigAttributeType, val VolumeGetImageConfigRetType) { *arg = &val } @@ -186,10 +240,16 @@ func setVolumeGetImageConfigAttributeType(arg *VolumeGetImageConfigAttributeType */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetLabelsAttributeTypeOk(arg VolumeGetLabelsAttributeType) (ret VolumeGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -197,6 +257,7 @@ func getVolumeGetLabelsAttributeTypeOk(arg VolumeGetLabelsAttributeType) (ret Vo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetLabelsAttributeType(arg *VolumeGetLabelsAttributeType, val VolumeGetLabelsRetType) { *arg = &val } @@ -206,8 +267,10 @@ func setVolumeGetLabelsAttributeType(arg *VolumeGetLabelsAttributeType, val Volu */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetNameAttributeTypeOk(arg VolumeGetNameAttributeType) (ret VolumeGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -215,11 +278,15 @@ func getVolumeGetNameAttributeTypeOk(arg VolumeGetNameAttributeType) (ret Volume return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetNameAttributeType(arg *VolumeGetNameAttributeType, val VolumeGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetNameRetType = string /* @@ -227,8 +294,10 @@ type VolumeGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetPerformanceClassAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetPerformanceClassAttributeTypeOk(arg VolumeGetPerformanceClassAttributeType) (ret VolumeGetPerformanceClassRetType, ok bool) { if arg == nil { return ret, false @@ -236,11 +305,15 @@ func getVolumeGetPerformanceClassAttributeTypeOk(arg VolumeGetPerformanceClassAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetPerformanceClassAttributeType(arg *VolumeGetPerformanceClassAttributeType, val VolumeGetPerformanceClassRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetPerformanceClassArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetPerformanceClassRetType = string /* @@ -248,8 +321,10 @@ type VolumeGetPerformanceClassRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetServerIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetServerIdAttributeTypeOk(arg VolumeGetServerIdAttributeType) (ret VolumeGetServerIdRetType, ok bool) { if arg == nil { return ret, false @@ -257,11 +332,15 @@ func getVolumeGetServerIdAttributeTypeOk(arg VolumeGetServerIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetServerIdAttributeType(arg *VolumeGetServerIdAttributeType, val VolumeGetServerIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetServerIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetServerIdRetType = string /* @@ -269,10 +348,16 @@ type VolumeGetServerIdRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetSizeAttributeTypeOk(arg VolumeGetSizeAttributeType) (ret VolumeGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -280,6 +365,7 @@ func getVolumeGetSizeAttributeTypeOk(arg VolumeGetSizeAttributeType) (ret Volume return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetSizeAttributeType(arg *VolumeGetSizeAttributeType, val VolumeGetSizeRetType) { *arg = &val } @@ -289,10 +375,16 @@ func setVolumeGetSizeAttributeType(arg *VolumeGetSizeAttributeType, val VolumeGe */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetSourceAttributeType = *VolumeSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetSourceArgType = VolumeSource + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetSourceRetType = VolumeSource +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetSourceAttributeTypeOk(arg VolumeGetSourceAttributeType) (ret VolumeGetSourceRetType, ok bool) { if arg == nil { return ret, false @@ -300,6 +392,7 @@ func getVolumeGetSourceAttributeTypeOk(arg VolumeGetSourceAttributeType) (ret Vo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetSourceAttributeType(arg *VolumeGetSourceAttributeType, val VolumeGetSourceRetType) { *arg = &val } @@ -309,8 +402,10 @@ func setVolumeGetSourceAttributeType(arg *VolumeGetSourceAttributeType, val Volu */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetStatusAttributeTypeOk(arg VolumeGetStatusAttributeType) (ret VolumeGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -318,11 +413,15 @@ func getVolumeGetStatusAttributeTypeOk(arg VolumeGetStatusAttributeType) (ret Vo return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetStatusAttributeType(arg *VolumeGetStatusAttributeType, val VolumeGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetStatusRetType = string /* @@ -330,10 +429,16 @@ type VolumeGetStatusRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetUpdatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetUpdatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeGetUpdatedAtRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeGetUpdatedAtAttributeTypeOk(arg VolumeGetUpdatedAtAttributeType) (ret VolumeGetUpdatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -341,11 +446,13 @@ func getVolumeGetUpdatedAtAttributeTypeOk(arg VolumeGetUpdatedAtAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeGetUpdatedAtAttributeType(arg *VolumeGetUpdatedAtAttributeType, val VolumeGetUpdatedAtRetType) { *arg = &val } // Volume Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Volume struct { // Object that represents an availability zone. // REQUIRED @@ -362,7 +469,7 @@ type Volume struct { // Universally Unique Identifier (UUID). Id VolumeGetIdAttributeType `json:"id,omitempty"` ImageConfig VolumeGetImageConfigAttributeType `json:"imageConfig,omitempty"` - // 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. + // 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. Labels VolumeGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. Name VolumeGetNameAttributeType `json:"name,omitempty"` @@ -379,12 +486,14 @@ type Volume struct { UpdatedAt VolumeGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Volume Volume // NewVolume instantiates a new Volume object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolume(availabilityZone VolumeGetAvailabilityZoneArgType) *Volume { this := Volume{} setVolumeGetAvailabilityZoneAttributeType(&this.AvailabilityZone, availabilityZone) @@ -394,12 +503,14 @@ func NewVolume(availabilityZone VolumeGetAvailabilityZoneArgType) *Volume { // NewVolumeWithDefaults instantiates a new Volume object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeWithDefaults() *Volume { this := Volume{} return &this } // GetAvailabilityZone returns the AvailabilityZone field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetAvailabilityZone() (ret VolumeGetAvailabilityZoneRetType) { ret, _ = o.GetAvailabilityZoneOk() return ret @@ -407,16 +518,19 @@ func (o *Volume) GetAvailabilityZone() (ret VolumeGetAvailabilityZoneRetType) { // GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetAvailabilityZoneOk() (ret VolumeGetAvailabilityZoneRetType, ok bool) { return getVolumeGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone) } // SetAvailabilityZone sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetAvailabilityZone(v VolumeGetAvailabilityZoneRetType) { setVolumeGetAvailabilityZoneAttributeType(&o.AvailabilityZone, v) } // GetBootable returns the Bootable field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetBootable() (res VolumegetBootableRetType) { res, _ = o.GetBootableOk() return @@ -424,22 +538,26 @@ func (o *Volume) GetBootable() (res VolumegetBootableRetType) { // GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetBootableOk() (ret VolumegetBootableRetType, ok bool) { return getVolumegetBootableAttributeTypeOk(o.Bootable) } // HasBootable returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasBootable() bool { _, ok := o.GetBootableOk() return ok } // SetBootable gets a reference to the given bool and assigns it to the Bootable field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetBootable(v VolumegetBootableRetType) { setVolumegetBootableAttributeType(&o.Bootable, v) } // GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetCreatedAt() (res VolumeGetCreatedAtRetType) { res, _ = o.GetCreatedAtOk() return @@ -447,22 +565,26 @@ func (o *Volume) GetCreatedAt() (res VolumeGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetCreatedAtOk() (ret VolumeGetCreatedAtRetType, ok bool) { return getVolumeGetCreatedAtAttributeTypeOk(o.CreatedAt) } // HasCreatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasCreatedAt() bool { _, ok := o.GetCreatedAtOk() return ok } // SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetCreatedAt(v VolumeGetCreatedAtRetType) { setVolumeGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetDescription() (res VolumeGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -470,22 +592,26 @@ func (o *Volume) GetDescription() (res VolumeGetDescriptionRetType) { // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetDescriptionOk() (ret VolumeGetDescriptionRetType, ok bool) { return getVolumeGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetDescription(v VolumeGetDescriptionRetType) { setVolumeGetDescriptionAttributeType(&o.Description, v) } // GetEncrypted returns the Encrypted field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetEncrypted() (res VolumegetEncryptedRetType) { res, _ = o.GetEncryptedOk() return @@ -493,22 +619,26 @@ func (o *Volume) GetEncrypted() (res VolumegetEncryptedRetType) { // GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetEncryptedOk() (ret VolumegetEncryptedRetType, ok bool) { return getVolumegetEncryptedAttributeTypeOk(o.Encrypted) } // HasEncrypted returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasEncrypted() bool { _, ok := o.GetEncryptedOk() return ok } // SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetEncrypted(v VolumegetEncryptedRetType) { setVolumegetEncryptedAttributeType(&o.Encrypted, v) } // GetEncryptionParameters returns the EncryptionParameters field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetEncryptionParameters() (res VolumeGetEncryptionParametersRetType) { res, _ = o.GetEncryptionParametersOk() return @@ -516,22 +646,26 @@ func (o *Volume) GetEncryptionParameters() (res VolumeGetEncryptionParametersRet // GetEncryptionParametersOk returns a tuple with the EncryptionParameters field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetEncryptionParametersOk() (ret VolumeGetEncryptionParametersRetType, ok bool) { return getVolumeGetEncryptionParametersAttributeTypeOk(o.EncryptionParameters) } // HasEncryptionParameters returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasEncryptionParameters() bool { _, ok := o.GetEncryptionParametersOk() return ok } // SetEncryptionParameters gets a reference to the given VolumeEncryptionParameter and assigns it to the EncryptionParameters field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetEncryptionParameters(v VolumeGetEncryptionParametersRetType) { setVolumeGetEncryptionParametersAttributeType(&o.EncryptionParameters, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetId() (res VolumeGetIdRetType) { res, _ = o.GetIdOk() return @@ -539,22 +673,26 @@ func (o *Volume) GetId() (res VolumeGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetIdOk() (ret VolumeGetIdRetType, ok bool) { return getVolumeGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetId(v VolumeGetIdRetType) { setVolumeGetIdAttributeType(&o.Id, v) } // GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetImageConfig() (res VolumeGetImageConfigRetType) { res, _ = o.GetImageConfigOk() return @@ -562,22 +700,26 @@ func (o *Volume) GetImageConfig() (res VolumeGetImageConfigRetType) { // GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetImageConfigOk() (ret VolumeGetImageConfigRetType, ok bool) { return getVolumeGetImageConfigAttributeTypeOk(o.ImageConfig) } // HasImageConfig returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasImageConfig() bool { _, ok := o.GetImageConfigOk() return ok } // SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetImageConfig(v VolumeGetImageConfigRetType) { setVolumeGetImageConfigAttributeType(&o.ImageConfig, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetLabels() (res VolumeGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -585,22 +727,26 @@ func (o *Volume) GetLabels() (res VolumeGetLabelsRetType) { // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetLabelsOk() (ret VolumeGetLabelsRetType, ok bool) { return getVolumeGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetLabels(v VolumeGetLabelsRetType) { setVolumeGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetName() (res VolumeGetNameRetType) { res, _ = o.GetNameOk() return @@ -608,22 +754,26 @@ func (o *Volume) GetName() (res VolumeGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetNameOk() (ret VolumeGetNameRetType, ok bool) { return getVolumeGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetName(v VolumeGetNameRetType) { setVolumeGetNameAttributeType(&o.Name, v) } // GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetPerformanceClass() (res VolumeGetPerformanceClassRetType) { res, _ = o.GetPerformanceClassOk() return @@ -631,22 +781,26 @@ func (o *Volume) GetPerformanceClass() (res VolumeGetPerformanceClassRetType) { // GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetPerformanceClassOk() (ret VolumeGetPerformanceClassRetType, ok bool) { return getVolumeGetPerformanceClassAttributeTypeOk(o.PerformanceClass) } // HasPerformanceClass returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasPerformanceClass() bool { _, ok := o.GetPerformanceClassOk() return ok } // SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetPerformanceClass(v VolumeGetPerformanceClassRetType) { setVolumeGetPerformanceClassAttributeType(&o.PerformanceClass, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetServerId() (res VolumeGetServerIdRetType) { res, _ = o.GetServerIdOk() return @@ -654,22 +808,26 @@ func (o *Volume) GetServerId() (res VolumeGetServerIdRetType) { // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetServerIdOk() (ret VolumeGetServerIdRetType, ok bool) { return getVolumeGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasServerId() bool { _, ok := o.GetServerIdOk() return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetServerId(v VolumeGetServerIdRetType) { setVolumeGetServerIdAttributeType(&o.ServerId, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetSize() (res VolumeGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -677,22 +835,26 @@ func (o *Volume) GetSize() (res VolumeGetSizeRetType) { // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetSizeOk() (ret VolumeGetSizeRetType, ok bool) { return getVolumeGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetSize(v VolumeGetSizeRetType) { setVolumeGetSizeAttributeType(&o.Size, v) } // GetSource returns the Source field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetSource() (res VolumeGetSourceRetType) { res, _ = o.GetSourceOk() return @@ -700,22 +862,26 @@ func (o *Volume) GetSource() (res VolumeGetSourceRetType) { // GetSourceOk returns a tuple with the Source field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetSourceOk() (ret VolumeGetSourceRetType, ok bool) { return getVolumeGetSourceAttributeTypeOk(o.Source) } // HasSource returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasSource() bool { _, ok := o.GetSourceOk() return ok } // SetSource gets a reference to the given VolumeSource and assigns it to the Source field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetSource(v VolumeGetSourceRetType) { setVolumeGetSourceAttributeType(&o.Source, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetStatus() (res VolumeGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -723,22 +889,26 @@ func (o *Volume) GetStatus() (res VolumeGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetStatusOk() (ret VolumeGetStatusRetType, ok bool) { return getVolumeGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetStatus(v VolumeGetStatusRetType) { setVolumeGetStatusAttributeType(&o.Status, v) } // GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetUpdatedAt() (res VolumeGetUpdatedAtRetType) { res, _ = o.GetUpdatedAtOk() return @@ -746,21 +916,25 @@ func (o *Volume) GetUpdatedAt() (res VolumeGetUpdatedAtRetType) { // GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) GetUpdatedAtOk() (ret VolumeGetUpdatedAtRetType, ok bool) { return getVolumeGetUpdatedAtAttributeTypeOk(o.UpdatedAt) } // HasUpdatedAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) HasUpdatedAt() bool { _, ok := o.GetUpdatedAtOk() return ok } // SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Volume) SetUpdatedAt(v VolumeGetUpdatedAtRetType) { setVolumeGetUpdatedAtAttributeType(&o.UpdatedAt, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Volume) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getVolumeGetAvailabilityZoneAttributeTypeOk(o.AvailabilityZone); ok { @@ -814,37 +988,45 @@ func (o Volume) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableVolume struct { value *Volume isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolume) Get() *Volume { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolume) Set(val *Volume) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolume) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolume) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableVolume(val *Volume) *NullableVolume { return &NullableVolume{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolume) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolume) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_volume_attachment.go b/services/iaas/model_volume_attachment.go index dcd52a91d..2552e8f3b 100644 --- a/services/iaas/model_volume_attachment.go +++ b/services/iaas/model_volume_attachment.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &VolumeAttachment{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentgetDeleteOnTerminationAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentgetDeleteOnTerminationArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentgetDeleteOnTerminationRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(arg VolumeAttachmentgetDeleteOnTerminationAttributeType) (ret VolumeAttachmentgetDeleteOnTerminationRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(arg VolumeAttachme return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeAttachmentgetDeleteOnTerminationAttributeType(arg *VolumeAttachmentgetDeleteOnTerminationAttributeType, val VolumeAttachmentgetDeleteOnTerminationRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setVolumeAttachmentgetDeleteOnTerminationAttributeType(arg *VolumeAttachmen */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentGetServerIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeAttachmentGetServerIdAttributeTypeOk(arg VolumeAttachmentGetServerIdAttributeType) (ret VolumeAttachmentGetServerIdRetType, ok bool) { if arg == nil { return ret, false @@ -51,11 +61,15 @@ func getVolumeAttachmentGetServerIdAttributeTypeOk(arg VolumeAttachmentGetServer return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeAttachmentGetServerIdAttributeType(arg *VolumeAttachmentGetServerIdAttributeType, val VolumeAttachmentGetServerIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentGetServerIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentGetServerIdRetType = string /* @@ -63,8 +77,10 @@ type VolumeAttachmentGetServerIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentGetVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeAttachmentGetVolumeIdAttributeTypeOk(arg VolumeAttachmentGetVolumeIdAttributeType) (ret VolumeAttachmentGetVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,14 +88,19 @@ func getVolumeAttachmentGetVolumeIdAttributeTypeOk(arg VolumeAttachmentGetVolume return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeAttachmentGetVolumeIdAttributeType(arg *VolumeAttachmentGetVolumeIdAttributeType, val VolumeAttachmentGetVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentGetVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentGetVolumeIdRetType = string // VolumeAttachment Object that represents a Volume attachment to a server. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachment struct { // Delete the volume during the termination of the server. Defaults to false. DeleteOnTermination VolumeAttachmentgetDeleteOnTerminationAttributeType `json:"deleteOnTermination,omitempty"` @@ -93,6 +114,7 @@ type VolumeAttachment struct { // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeAttachment() *VolumeAttachment { this := VolumeAttachment{} return &this @@ -101,12 +123,14 @@ func NewVolumeAttachment() *VolumeAttachment { // NewVolumeAttachmentWithDefaults instantiates a new VolumeAttachment object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeAttachmentWithDefaults() *VolumeAttachment { this := VolumeAttachment{} return &this } // GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) GetDeleteOnTermination() (res VolumeAttachmentgetDeleteOnTerminationRetType) { res, _ = o.GetDeleteOnTerminationOk() return @@ -114,22 +138,26 @@ func (o *VolumeAttachment) GetDeleteOnTermination() (res VolumeAttachmentgetDele // GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) GetDeleteOnTerminationOk() (ret VolumeAttachmentgetDeleteOnTerminationRetType, ok bool) { return getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination) } // HasDeleteOnTermination returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) HasDeleteOnTermination() bool { _, ok := o.GetDeleteOnTerminationOk() return ok } // SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) SetDeleteOnTermination(v VolumeAttachmentgetDeleteOnTerminationRetType) { setVolumeAttachmentgetDeleteOnTerminationAttributeType(&o.DeleteOnTermination, v) } // GetServerId returns the ServerId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) GetServerId() (res VolumeAttachmentGetServerIdRetType) { res, _ = o.GetServerIdOk() return @@ -137,22 +165,26 @@ func (o *VolumeAttachment) GetServerId() (res VolumeAttachmentGetServerIdRetType // GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) GetServerIdOk() (ret VolumeAttachmentGetServerIdRetType, ok bool) { return getVolumeAttachmentGetServerIdAttributeTypeOk(o.ServerId) } // HasServerId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) HasServerId() bool { _, ok := o.GetServerIdOk() return ok } // SetServerId gets a reference to the given string and assigns it to the ServerId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) SetServerId(v VolumeAttachmentGetServerIdRetType) { setVolumeAttachmentGetServerIdAttributeType(&o.ServerId, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) GetVolumeId() (res VolumeAttachmentGetVolumeIdRetType) { res, _ = o.GetVolumeIdOk() return @@ -160,21 +192,25 @@ func (o *VolumeAttachment) GetVolumeId() (res VolumeAttachmentGetVolumeIdRetType // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) GetVolumeIdOk() (ret VolumeAttachmentGetVolumeIdRetType, ok bool) { return getVolumeAttachmentGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) HasVolumeId() bool { _, ok := o.GetVolumeIdOk() return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachment) SetVolumeId(v VolumeAttachmentGetVolumeIdRetType) { setVolumeAttachmentGetVolumeIdAttributeType(&o.VolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o VolumeAttachment) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getVolumeAttachmentgetDeleteOnTerminationAttributeTypeOk(o.DeleteOnTermination); ok { @@ -189,37 +225,45 @@ func (o VolumeAttachment) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableVolumeAttachment struct { value *VolumeAttachment isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeAttachment) Get() *VolumeAttachment { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeAttachment) Set(val *VolumeAttachment) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeAttachment) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeAttachment) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableVolumeAttachment(val *VolumeAttachment) *NullableVolumeAttachment { return &NullableVolumeAttachment{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeAttachment) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeAttachment) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_volume_attachment_list_response.go b/services/iaas/model_volume_attachment_list_response.go index db6794f38..277f22a16 100644 --- a/services/iaas/model_volume_attachment_list_response.go +++ b/services/iaas/model_volume_attachment_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &VolumeAttachmentListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentListResponseGetItemsAttributeType = *[]VolumeAttachment + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentListResponseGetItemsArgType = []VolumeAttachment + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentListResponseGetItemsRetType = []VolumeAttachment +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeAttachmentListResponseGetItemsAttributeTypeOk(arg VolumeAttachmentListResponseGetItemsAttributeType) (ret VolumeAttachmentListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getVolumeAttachmentListResponseGetItemsAttributeTypeOk(arg VolumeAttachment return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeAttachmentListResponseGetItemsAttributeType(arg *VolumeAttachmentListResponseGetItemsAttributeType, val VolumeAttachmentListResponseGetItemsRetType) { *arg = &val } // VolumeAttachmentListResponse Volume attachment list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeAttachmentListResponse struct { // A list containing Volume attachments of a server. // REQUIRED Items VolumeAttachmentListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _VolumeAttachmentListResponse VolumeAttachmentListResponse // NewVolumeAttachmentListResponse instantiates a new VolumeAttachmentListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeAttachmentListResponse(items VolumeAttachmentListResponseGetItemsArgType) *VolumeAttachmentListResponse { this := VolumeAttachmentListResponse{} setVolumeAttachmentListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewVolumeAttachmentListResponse(items VolumeAttachmentListResponseGetItemsA // NewVolumeAttachmentListResponseWithDefaults instantiates a new VolumeAttachmentListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeAttachmentListResponseWithDefaults() *VolumeAttachmentListResponse { this := VolumeAttachmentListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachmentListResponse) GetItems() (ret VolumeAttachmentListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *VolumeAttachmentListResponse) GetItems() (ret VolumeAttachmentListRespo // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachmentListResponse) GetItemsOk() (ret VolumeAttachmentListResponseGetItemsRetType, ok bool) { return getVolumeAttachmentListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeAttachmentListResponse) SetItems(v VolumeAttachmentListResponseGetItemsRetType) { setVolumeAttachmentListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getVolumeAttachmentListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableVolumeAttachmentListResponse struct { value *VolumeAttachmentListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeAttachmentListResponse) Get() *VolumeAttachmentListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeAttachmentListResponse) Set(val *VolumeAttachmentListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeAttachmentListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeAttachmentListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableVolumeAttachmentListResponse(val *VolumeAttachmentListResponse) *NullableVolumeAttachmentListResponse { return &NullableVolumeAttachmentListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeAttachmentListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_volume_encryption_parameter.go b/services/iaas/model_volume_encryption_parameter.go index 2cbed9e35..3296f43ab 100644 --- a/services/iaas/model_volume_encryption_parameter.go +++ b/services/iaas/model_volume_encryption_parameter.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &VolumeEncryptionParameter{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeEncryptionParameterGetKekKeyIdAttributeTypeOk(arg VolumeEncryptionParameterGetKekKeyIdAttributeType) (ret VolumeEncryptionParameterGetKekKeyIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getVolumeEncryptionParameterGetKekKeyIdAttributeTypeOk(arg VolumeEncryption return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeEncryptionParameterGetKekKeyIdAttributeType(arg *VolumeEncryptionParameterGetKekKeyIdAttributeType, val VolumeEncryptionParameterGetKekKeyIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyIdRetType = string /* @@ -43,10 +50,16 @@ type VolumeEncryptionParameterGetKekKeyIdRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyVersionAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyVersionArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyVersionRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeEncryptionParameterGetKekKeyVersionAttributeTypeOk(arg VolumeEncryptionParameterGetKekKeyVersionAttributeType) (ret VolumeEncryptionParameterGetKekKeyVersionRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getVolumeEncryptionParameterGetKekKeyVersionAttributeTypeOk(arg VolumeEncry return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeEncryptionParameterGetKekKeyVersionAttributeType(arg *VolumeEncryptionParameterGetKekKeyVersionAttributeType, val VolumeEncryptionParameterGetKekKeyVersionRetType) { *arg = &val } @@ -63,8 +77,10 @@ func setVolumeEncryptionParameterGetKekKeyVersionAttributeType(arg *VolumeEncryp */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyringIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeEncryptionParameterGetKekKeyringIdAttributeTypeOk(arg VolumeEncryptionParameterGetKekKeyringIdAttributeType) (ret VolumeEncryptionParameterGetKekKeyringIdRetType, ok bool) { if arg == nil { return ret, false @@ -72,11 +88,15 @@ func getVolumeEncryptionParameterGetKekKeyringIdAttributeTypeOk(arg VolumeEncryp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeEncryptionParameterGetKekKeyringIdAttributeType(arg *VolumeEncryptionParameterGetKekKeyringIdAttributeType, val VolumeEncryptionParameterGetKekKeyringIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyringIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekKeyringIdRetType = string /* @@ -84,8 +104,10 @@ type VolumeEncryptionParameterGetKekKeyringIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekProjectIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeEncryptionParameterGetKekProjectIdAttributeTypeOk(arg VolumeEncryptionParameterGetKekProjectIdAttributeType) (ret VolumeEncryptionParameterGetKekProjectIdRetType, ok bool) { if arg == nil { return ret, false @@ -93,11 +115,15 @@ func getVolumeEncryptionParameterGetKekProjectIdAttributeTypeOk(arg VolumeEncryp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeEncryptionParameterGetKekProjectIdAttributeType(arg *VolumeEncryptionParameterGetKekProjectIdAttributeType, val VolumeEncryptionParameterGetKekProjectIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekProjectIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKekProjectIdRetType = string /* @@ -105,10 +131,16 @@ type VolumeEncryptionParameterGetKekProjectIdRetType = string */ // isByteArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKeyPayloadAttributeType = *[]byte + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKeyPayloadArgType = []byte + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetKeyPayloadRetType = []byte +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeEncryptionParameterGetKeyPayloadAttributeTypeOk(arg VolumeEncryptionParameterGetKeyPayloadAttributeType) (ret VolumeEncryptionParameterGetKeyPayloadRetType, ok bool) { if arg == nil { return ret, false @@ -116,6 +148,7 @@ func getVolumeEncryptionParameterGetKeyPayloadAttributeTypeOk(arg VolumeEncrypti return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeEncryptionParameterGetKeyPayloadAttributeType(arg *VolumeEncryptionParameterGetKeyPayloadAttributeType, val VolumeEncryptionParameterGetKeyPayloadRetType) { *arg = &val } @@ -125,8 +158,10 @@ func setVolumeEncryptionParameterGetKeyPayloadAttributeType(arg *VolumeEncryptio */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetServiceAccountAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeEncryptionParameterGetServiceAccountAttributeTypeOk(arg VolumeEncryptionParameterGetServiceAccountAttributeType) (ret VolumeEncryptionParameterGetServiceAccountRetType, ok bool) { if arg == nil { return ret, false @@ -134,14 +169,19 @@ func getVolumeEncryptionParameterGetServiceAccountAttributeTypeOk(arg VolumeEncr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeEncryptionParameterGetServiceAccountAttributeType(arg *VolumeEncryptionParameterGetServiceAccountAttributeType, val VolumeEncryptionParameterGetServiceAccountRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetServiceAccountArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameterGetServiceAccountRetType = string // VolumeEncryptionParameter Parameter to connect to a key-encryption-key within the STACKIT-KMS to create encrypted volumes. If no key_payload is set, a random passphrase is generated, which will be encrypted against the STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the responses. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeEncryptionParameter struct { // Universally Unique Identifier (UUID). // REQUIRED @@ -161,12 +201,14 @@ type VolumeEncryptionParameter struct { ServiceAccount VolumeEncryptionParameterGetServiceAccountAttributeType `json:"serviceAccount" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _VolumeEncryptionParameter VolumeEncryptionParameter // NewVolumeEncryptionParameter instantiates a new VolumeEncryptionParameter object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeEncryptionParameter(kekKeyId VolumeEncryptionParameterGetKekKeyIdArgType, kekKeyVersion VolumeEncryptionParameterGetKekKeyVersionArgType, kekKeyringId VolumeEncryptionParameterGetKekKeyringIdArgType, serviceAccount VolumeEncryptionParameterGetServiceAccountArgType) *VolumeEncryptionParameter { this := VolumeEncryptionParameter{} setVolumeEncryptionParameterGetKekKeyIdAttributeType(&this.KekKeyId, kekKeyId) @@ -179,12 +221,14 @@ func NewVolumeEncryptionParameter(kekKeyId VolumeEncryptionParameterGetKekKeyIdA // NewVolumeEncryptionParameterWithDefaults instantiates a new VolumeEncryptionParameter object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeEncryptionParameterWithDefaults() *VolumeEncryptionParameter { this := VolumeEncryptionParameter{} return &this } // GetKekKeyId returns the KekKeyId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKekKeyId() (ret VolumeEncryptionParameterGetKekKeyIdRetType) { ret, _ = o.GetKekKeyIdOk() return ret @@ -192,16 +236,19 @@ func (o *VolumeEncryptionParameter) GetKekKeyId() (ret VolumeEncryptionParameter // GetKekKeyIdOk returns a tuple with the KekKeyId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKekKeyIdOk() (ret VolumeEncryptionParameterGetKekKeyIdRetType, ok bool) { return getVolumeEncryptionParameterGetKekKeyIdAttributeTypeOk(o.KekKeyId) } // SetKekKeyId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) SetKekKeyId(v VolumeEncryptionParameterGetKekKeyIdRetType) { setVolumeEncryptionParameterGetKekKeyIdAttributeType(&o.KekKeyId, v) } // GetKekKeyVersion returns the KekKeyVersion field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKekKeyVersion() (ret VolumeEncryptionParameterGetKekKeyVersionRetType) { ret, _ = o.GetKekKeyVersionOk() return ret @@ -209,16 +256,19 @@ func (o *VolumeEncryptionParameter) GetKekKeyVersion() (ret VolumeEncryptionPara // GetKekKeyVersionOk returns a tuple with the KekKeyVersion field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKekKeyVersionOk() (ret VolumeEncryptionParameterGetKekKeyVersionRetType, ok bool) { return getVolumeEncryptionParameterGetKekKeyVersionAttributeTypeOk(o.KekKeyVersion) } // SetKekKeyVersion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) SetKekKeyVersion(v VolumeEncryptionParameterGetKekKeyVersionRetType) { setVolumeEncryptionParameterGetKekKeyVersionAttributeType(&o.KekKeyVersion, v) } // GetKekKeyringId returns the KekKeyringId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKekKeyringId() (ret VolumeEncryptionParameterGetKekKeyringIdRetType) { ret, _ = o.GetKekKeyringIdOk() return ret @@ -226,16 +276,19 @@ func (o *VolumeEncryptionParameter) GetKekKeyringId() (ret VolumeEncryptionParam // GetKekKeyringIdOk returns a tuple with the KekKeyringId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKekKeyringIdOk() (ret VolumeEncryptionParameterGetKekKeyringIdRetType, ok bool) { return getVolumeEncryptionParameterGetKekKeyringIdAttributeTypeOk(o.KekKeyringId) } // SetKekKeyringId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) SetKekKeyringId(v VolumeEncryptionParameterGetKekKeyringIdRetType) { setVolumeEncryptionParameterGetKekKeyringIdAttributeType(&o.KekKeyringId, v) } // GetKekProjectId returns the KekProjectId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKekProjectId() (res VolumeEncryptionParameterGetKekProjectIdRetType) { res, _ = o.GetKekProjectIdOk() return @@ -243,22 +296,26 @@ func (o *VolumeEncryptionParameter) GetKekProjectId() (res VolumeEncryptionParam // GetKekProjectIdOk returns a tuple with the KekProjectId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKekProjectIdOk() (ret VolumeEncryptionParameterGetKekProjectIdRetType, ok bool) { return getVolumeEncryptionParameterGetKekProjectIdAttributeTypeOk(o.KekProjectId) } // HasKekProjectId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) HasKekProjectId() bool { _, ok := o.GetKekProjectIdOk() return ok } // SetKekProjectId gets a reference to the given string and assigns it to the KekProjectId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) SetKekProjectId(v VolumeEncryptionParameterGetKekProjectIdRetType) { setVolumeEncryptionParameterGetKekProjectIdAttributeType(&o.KekProjectId, v) } // GetKeyPayload returns the KeyPayload field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKeyPayload() (res VolumeEncryptionParameterGetKeyPayloadRetType) { res, _ = o.GetKeyPayloadOk() return @@ -266,22 +323,26 @@ func (o *VolumeEncryptionParameter) GetKeyPayload() (res VolumeEncryptionParamet // GetKeyPayloadOk returns a tuple with the KeyPayload field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetKeyPayloadOk() (ret VolumeEncryptionParameterGetKeyPayloadRetType, ok bool) { return getVolumeEncryptionParameterGetKeyPayloadAttributeTypeOk(o.KeyPayload) } // HasKeyPayload returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) HasKeyPayload() bool { _, ok := o.GetKeyPayloadOk() return ok } // SetKeyPayload gets a reference to the given string and assigns it to the KeyPayload field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) SetKeyPayload(v VolumeEncryptionParameterGetKeyPayloadRetType) { setVolumeEncryptionParameterGetKeyPayloadAttributeType(&o.KeyPayload, v) } // GetServiceAccount returns the ServiceAccount field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetServiceAccount() (ret VolumeEncryptionParameterGetServiceAccountRetType) { ret, _ = o.GetServiceAccountOk() return ret @@ -289,15 +350,18 @@ func (o *VolumeEncryptionParameter) GetServiceAccount() (ret VolumeEncryptionPar // GetServiceAccountOk returns a tuple with the ServiceAccount field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) GetServiceAccountOk() (ret VolumeEncryptionParameterGetServiceAccountRetType, ok bool) { return getVolumeEncryptionParameterGetServiceAccountAttributeTypeOk(o.ServiceAccount) } // SetServiceAccount sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeEncryptionParameter) SetServiceAccount(v VolumeEncryptionParameterGetServiceAccountRetType) { setVolumeEncryptionParameterGetServiceAccountAttributeType(&o.ServiceAccount, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o VolumeEncryptionParameter) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getVolumeEncryptionParameterGetKekKeyIdAttributeTypeOk(o.KekKeyId); ok { @@ -321,37 +385,45 @@ func (o VolumeEncryptionParameter) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableVolumeEncryptionParameter struct { value *VolumeEncryptionParameter isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeEncryptionParameter) Get() *VolumeEncryptionParameter { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeEncryptionParameter) Set(val *VolumeEncryptionParameter) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeEncryptionParameter) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeEncryptionParameter) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableVolumeEncryptionParameter(val *VolumeEncryptionParameter) *NullableVolumeEncryptionParameter { return &NullableVolumeEncryptionParameter{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeEncryptionParameter) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeEncryptionParameter) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_volume_list_response.go b/services/iaas/model_volume_list_response.go index 69e6e753a..6fd70a8b4 100644 --- a/services/iaas/model_volume_list_response.go +++ b/services/iaas/model_volume_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &VolumeListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeListResponseGetItemsAttributeType = *[]Volume + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeListResponseGetItemsArgType = []Volume + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeListResponseGetItemsRetType = []Volume +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeListResponseGetItemsAttributeTypeOk(arg VolumeListResponseGetItemsAttributeType) (ret VolumeListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getVolumeListResponseGetItemsAttributeTypeOk(arg VolumeListResponseGetItems return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeListResponseGetItemsAttributeType(arg *VolumeListResponseGetItemsAttributeType, val VolumeListResponseGetItemsRetType) { *arg = &val } // VolumeListResponse Volume list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeListResponse struct { // A list containing volume objects. // REQUIRED Items VolumeListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _VolumeListResponse VolumeListResponse // NewVolumeListResponse instantiates a new VolumeListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeListResponse(items VolumeListResponseGetItemsArgType) *VolumeListResponse { this := VolumeListResponse{} setVolumeListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewVolumeListResponse(items VolumeListResponseGetItemsArgType) *VolumeListR // NewVolumeListResponseWithDefaults instantiates a new VolumeListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeListResponseWithDefaults() *VolumeListResponse { this := VolumeListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeListResponse) GetItems() (ret VolumeListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *VolumeListResponse) GetItems() (ret VolumeListResponseGetItemsRetType) // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeListResponse) GetItemsOk() (ret VolumeListResponseGetItemsRetType, ok bool) { return getVolumeListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeListResponse) SetItems(v VolumeListResponseGetItemsRetType) { setVolumeListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o VolumeListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getVolumeListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o VolumeListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableVolumeListResponse struct { value *VolumeListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeListResponse) Get() *VolumeListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeListResponse) Set(val *VolumeListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableVolumeListResponse(val *VolumeListResponse) *NullableVolumeListResponse { return &NullableVolumeListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_volume_performance_class.go b/services/iaas/model_volume_performance_class.go index 4dcf5669a..0ba93d4a2 100644 --- a/services/iaas/model_volume_performance_class.go +++ b/services/iaas/model_volume_performance_class.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &VolumePerformanceClass{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumePerformanceClassGetDescriptionAttributeTypeOk(arg VolumePerformanceClassGetDescriptionAttributeType) (ret VolumePerformanceClassGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getVolumePerformanceClassGetDescriptionAttributeTypeOk(arg VolumePerformanc return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumePerformanceClassGetDescriptionAttributeType(arg *VolumePerformanceClassGetDescriptionAttributeType, val VolumePerformanceClassGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetDescriptionRetType = string /* @@ -43,10 +50,16 @@ type VolumePerformanceClassGetDescriptionRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetIopsAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetIopsArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetIopsRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumePerformanceClassGetIopsAttributeTypeOk(arg VolumePerformanceClassGetIopsAttributeType) (ret VolumePerformanceClassGetIopsRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getVolumePerformanceClassGetIopsAttributeTypeOk(arg VolumePerformanceClassG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumePerformanceClassGetIopsAttributeType(arg *VolumePerformanceClassGetIopsAttributeType, val VolumePerformanceClassGetIopsRetType) { *arg = &val } @@ -63,10 +77,16 @@ func setVolumePerformanceClassGetIopsAttributeType(arg *VolumePerformanceClassGe */ // isFreeform +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetLabelsAttributeType = *map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetLabelsArgType = map[string]interface{} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetLabelsRetType = map[string]interface{} +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumePerformanceClassGetLabelsAttributeTypeOk(arg VolumePerformanceClassGetLabelsAttributeType) (ret VolumePerformanceClassGetLabelsRetType, ok bool) { if arg == nil { return ret, false @@ -74,6 +94,7 @@ func getVolumePerformanceClassGetLabelsAttributeTypeOk(arg VolumePerformanceClas return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumePerformanceClassGetLabelsAttributeType(arg *VolumePerformanceClassGetLabelsAttributeType, val VolumePerformanceClassGetLabelsRetType) { *arg = &val } @@ -83,8 +104,10 @@ func setVolumePerformanceClassGetLabelsAttributeType(arg *VolumePerformanceClass */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumePerformanceClassGetNameAttributeTypeOk(arg VolumePerformanceClassGetNameAttributeType) (ret VolumePerformanceClassGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -92,11 +115,15 @@ func getVolumePerformanceClassGetNameAttributeTypeOk(arg VolumePerformanceClassG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumePerformanceClassGetNameAttributeType(arg *VolumePerformanceClassGetNameAttributeType, val VolumePerformanceClassGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetNameRetType = string /* @@ -104,10 +131,16 @@ type VolumePerformanceClassGetNameRetType = string */ // isLong +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetThroughputAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetThroughputArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassGetThroughputRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumePerformanceClassGetThroughputAttributeTypeOk(arg VolumePerformanceClassGetThroughputAttributeType) (ret VolumePerformanceClassGetThroughputRetType, ok bool) { if arg == nil { return ret, false @@ -115,17 +148,19 @@ func getVolumePerformanceClassGetThroughputAttributeTypeOk(arg VolumePerformance return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumePerformanceClassGetThroughputAttributeType(arg *VolumePerformanceClassGetThroughputAttributeType, val VolumePerformanceClassGetThroughputRetType) { *arg = &val } // VolumePerformanceClass Object that represents a Volume performance class. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClass struct { // Description Object. Allows string up to 255 Characters. Description VolumePerformanceClassGetDescriptionAttributeType `json:"description,omitempty"` // Input/Output Operations per second. Iops VolumePerformanceClassGetIopsAttributeType `json:"iops,omitempty"` - // 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. + // 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. Labels VolumePerformanceClassGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. // REQUIRED @@ -134,12 +169,14 @@ type VolumePerformanceClass struct { Throughput VolumePerformanceClassGetThroughputAttributeType `json:"throughput,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _VolumePerformanceClass VolumePerformanceClass // NewVolumePerformanceClass instantiates a new VolumePerformanceClass object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumePerformanceClass(name VolumePerformanceClassGetNameArgType) *VolumePerformanceClass { this := VolumePerformanceClass{} setVolumePerformanceClassGetNameAttributeType(&this.Name, name) @@ -149,12 +186,14 @@ func NewVolumePerformanceClass(name VolumePerformanceClassGetNameArgType) *Volum // NewVolumePerformanceClassWithDefaults instantiates a new VolumePerformanceClass object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumePerformanceClassWithDefaults() *VolumePerformanceClass { this := VolumePerformanceClass{} return &this } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetDescription() (res VolumePerformanceClassGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -162,22 +201,26 @@ func (o *VolumePerformanceClass) GetDescription() (res VolumePerformanceClassGet // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetDescriptionOk() (ret VolumePerformanceClassGetDescriptionRetType, ok bool) { return getVolumePerformanceClassGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) SetDescription(v VolumePerformanceClassGetDescriptionRetType) { setVolumePerformanceClassGetDescriptionAttributeType(&o.Description, v) } // GetIops returns the Iops field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetIops() (res VolumePerformanceClassGetIopsRetType) { res, _ = o.GetIopsOk() return @@ -185,22 +228,26 @@ func (o *VolumePerformanceClass) GetIops() (res VolumePerformanceClassGetIopsRet // GetIopsOk returns a tuple with the Iops field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetIopsOk() (ret VolumePerformanceClassGetIopsRetType, ok bool) { return getVolumePerformanceClassGetIopsAttributeTypeOk(o.Iops) } // HasIops returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) HasIops() bool { _, ok := o.GetIopsOk() return ok } // SetIops gets a reference to the given int64 and assigns it to the Iops field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) SetIops(v VolumePerformanceClassGetIopsRetType) { setVolumePerformanceClassGetIopsAttributeType(&o.Iops, v) } // GetLabels returns the Labels field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetLabels() (res VolumePerformanceClassGetLabelsRetType) { res, _ = o.GetLabelsOk() return @@ -208,22 +255,26 @@ func (o *VolumePerformanceClass) GetLabels() (res VolumePerformanceClassGetLabel // GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetLabelsOk() (ret VolumePerformanceClassGetLabelsRetType, ok bool) { return getVolumePerformanceClassGetLabelsAttributeTypeOk(o.Labels) } // HasLabels returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) HasLabels() bool { _, ok := o.GetLabelsOk() return ok } // SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) SetLabels(v VolumePerformanceClassGetLabelsRetType) { setVolumePerformanceClassGetLabelsAttributeType(&o.Labels, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetName() (ret VolumePerformanceClassGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -231,16 +282,19 @@ func (o *VolumePerformanceClass) GetName() (ret VolumePerformanceClassGetNameRet // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetNameOk() (ret VolumePerformanceClassGetNameRetType, ok bool) { return getVolumePerformanceClassGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) SetName(v VolumePerformanceClassGetNameRetType) { setVolumePerformanceClassGetNameAttributeType(&o.Name, v) } // GetThroughput returns the Throughput field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetThroughput() (res VolumePerformanceClassGetThroughputRetType) { res, _ = o.GetThroughputOk() return @@ -248,21 +302,25 @@ func (o *VolumePerformanceClass) GetThroughput() (res VolumePerformanceClassGetT // GetThroughputOk returns a tuple with the Throughput field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) GetThroughputOk() (ret VolumePerformanceClassGetThroughputRetType, ok bool) { return getVolumePerformanceClassGetThroughputAttributeTypeOk(o.Throughput) } // HasThroughput returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) HasThroughput() bool { _, ok := o.GetThroughputOk() return ok } // SetThroughput gets a reference to the given int64 and assigns it to the Throughput field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClass) SetThroughput(v VolumePerformanceClassGetThroughputRetType) { setVolumePerformanceClassGetThroughputAttributeType(&o.Throughput, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o VolumePerformanceClass) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getVolumePerformanceClassGetDescriptionAttributeTypeOk(o.Description); ok { @@ -283,37 +341,45 @@ func (o VolumePerformanceClass) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableVolumePerformanceClass struct { value *VolumePerformanceClass isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumePerformanceClass) Get() *VolumePerformanceClass { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumePerformanceClass) Set(val *VolumePerformanceClass) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumePerformanceClass) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumePerformanceClass) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableVolumePerformanceClass(val *VolumePerformanceClass) *NullableVolumePerformanceClass { return &NullableVolumePerformanceClass{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumePerformanceClass) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumePerformanceClass) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_volume_performance_class_list_response.go b/services/iaas/model_volume_performance_class_list_response.go index 42dff3807..168e392f5 100644 --- a/services/iaas/model_volume_performance_class_list_response.go +++ b/services/iaas/model_volume_performance_class_list_response.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &VolumePerformanceClassListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassListResponseGetItemsAttributeType = *[]VolumePerformanceClass + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassListResponseGetItemsArgType = []VolumePerformanceClass + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassListResponseGetItemsRetType = []VolumePerformanceClass +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(arg VolumePerformanceClassListResponseGetItemsAttributeType) (ret VolumePerformanceClassListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,23 +40,27 @@ func getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(arg VolumePerf return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumePerformanceClassListResponseGetItemsAttributeType(arg *VolumePerformanceClassListResponseGetItemsAttributeType, val VolumePerformanceClassListResponseGetItemsRetType) { *arg = &val } // VolumePerformanceClassListResponse Volume performance class list response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumePerformanceClassListResponse struct { // A list containing Volume performance classes. // REQUIRED Items VolumePerformanceClassListResponseGetItemsAttributeType `json:"items" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _VolumePerformanceClassListResponse VolumePerformanceClassListResponse // NewVolumePerformanceClassListResponse instantiates a new VolumePerformanceClassListResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumePerformanceClassListResponse(items VolumePerformanceClassListResponseGetItemsArgType) *VolumePerformanceClassListResponse { this := VolumePerformanceClassListResponse{} setVolumePerformanceClassListResponseGetItemsAttributeType(&this.Items, items) @@ -59,12 +70,14 @@ func NewVolumePerformanceClassListResponse(items VolumePerformanceClassListRespo // NewVolumePerformanceClassListResponseWithDefaults instantiates a new VolumePerformanceClassListResponse object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumePerformanceClassListResponseWithDefaults() *VolumePerformanceClassListResponse { this := VolumePerformanceClassListResponse{} return &this } // GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClassListResponse) GetItems() (ret VolumePerformanceClassListResponseGetItemsRetType) { ret, _ = o.GetItemsOk() return ret @@ -72,15 +85,18 @@ func (o *VolumePerformanceClassListResponse) GetItems() (ret VolumePerformanceCl // GetItemsOk returns a tuple with the Items field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClassListResponse) GetItemsOk() (ret VolumePerformanceClassListResponseGetItemsRetType, ok bool) { return getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(o.Items) } // SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumePerformanceClassListResponse) SetItems(v VolumePerformanceClassListResponseGetItemsRetType) { setVolumePerformanceClassListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o VolumePerformanceClassListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getVolumePerformanceClassListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -89,37 +105,45 @@ func (o VolumePerformanceClassListResponse) ToMap() (map[string]interface{}, err return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableVolumePerformanceClassListResponse struct { value *VolumePerformanceClassListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumePerformanceClassListResponse) Get() *VolumePerformanceClassListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumePerformanceClassListResponse) Set(val *VolumePerformanceClassListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumePerformanceClassListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumePerformanceClassListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableVolumePerformanceClassListResponse(val *VolumePerformanceClassListResponse) *NullableVolumePerformanceClassListResponse { return &NullableVolumePerformanceClassListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumePerformanceClassListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumePerformanceClassListResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/model_volume_source.go b/services/iaas/model_volume_source.go index a7c082392..f9d8e4255 100644 --- a/services/iaas/model_volume_source.go +++ b/services/iaas/model_volume_source.go @@ -8,6 +8,7 @@ API version: 2 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package iaas import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &VolumeSource{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeSourceGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeSourceGetIdAttributeTypeOk(arg VolumeSourceGetIdAttributeType) (ret VolumeSourceGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getVolumeSourceGetIdAttributeTypeOk(arg VolumeSourceGetIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeSourceGetIdAttributeType(arg *VolumeSourceGetIdAttributeType, val VolumeSourceGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeSourceGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeSourceGetIdRetType = string /* @@ -43,8 +50,10 @@ type VolumeSourceGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeSourceGetTypeAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getVolumeSourceGetTypeAttributeTypeOk(arg VolumeSourceGetTypeAttributeType) (ret VolumeSourceGetTypeRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getVolumeSourceGetTypeAttributeTypeOk(arg VolumeSourceGetTypeAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setVolumeSourceGetTypeAttributeType(arg *VolumeSourceGetTypeAttributeType, val VolumeSourceGetTypeRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeSourceGetTypeArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeSourceGetTypeRetType = string // VolumeSource The source object of a volume. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type VolumeSource struct { // Universally Unique Identifier (UUID). // REQUIRED @@ -69,12 +83,14 @@ type VolumeSource struct { Type VolumeSourceGetTypeAttributeType `json:"type" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _VolumeSource VolumeSource // NewVolumeSource instantiates a new VolumeSource object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeSource(id VolumeSourceGetIdArgType, types VolumeSourceGetTypeArgType) *VolumeSource { this := VolumeSource{} setVolumeSourceGetIdAttributeType(&this.Id, id) @@ -85,12 +101,14 @@ func NewVolumeSource(id VolumeSourceGetIdArgType, types VolumeSourceGetTypeArgTy // NewVolumeSourceWithDefaults instantiates a new VolumeSource object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewVolumeSourceWithDefaults() *VolumeSource { this := VolumeSource{} return &this } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeSource) GetId() (ret VolumeSourceGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -98,16 +116,19 @@ func (o *VolumeSource) GetId() (ret VolumeSourceGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeSource) GetIdOk() (ret VolumeSourceGetIdRetType, ok bool) { return getVolumeSourceGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeSource) SetId(v VolumeSourceGetIdRetType) { setVolumeSourceGetIdAttributeType(&o.Id, v) } // GetType returns the Type field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeSource) GetType() (ret VolumeSourceGetTypeRetType) { ret, _ = o.GetTypeOk() return ret @@ -115,15 +136,18 @@ func (o *VolumeSource) GetType() (ret VolumeSourceGetTypeRetType) { // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeSource) GetTypeOk() (ret VolumeSourceGetTypeRetType, ok bool) { return getVolumeSourceGetTypeAttributeTypeOk(o.Type) } // SetType sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *VolumeSource) SetType(v VolumeSourceGetTypeRetType) { setVolumeSourceGetTypeAttributeType(&o.Type, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o VolumeSource) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getVolumeSourceGetIdAttributeTypeOk(o.Id); ok { @@ -135,37 +159,45 @@ func (o VolumeSource) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableVolumeSource struct { value *VolumeSource isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeSource) Get() *VolumeSource { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeSource) Set(val *VolumeSource) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeSource) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeSource) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableVolumeSource(val *VolumeSource) *NullableVolumeSource { return &NullableVolumeSource{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableVolumeSource) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableVolumeSource) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/iaas/oas_commit b/services/iaas/oas_commit index 064e1081f..f5e4510f9 100644 --- a/services/iaas/oas_commit +++ b/services/iaas/oas_commit @@ -1 +1 @@ -cfcfc32bc1ae335acecd7bf7ffb60354fdc565ab +73b7457504497158e2836857f5ca4d2e6186ee5d diff --git a/services/iaas/utils.go b/services/iaas/utils.go index beafc9945..8779e69e6 100644 --- a/services/iaas/utils.go +++ b/services/iaas/utils.go @@ -18,341 +18,419 @@ import ( ) // PtrBool is a helper routine that returns a pointer to given boolean value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrBool(v bool) *bool { return &v } // PtrInt is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt(v int) *int { return &v } // PtrInt32 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt32(v int32) *int32 { return &v } // PtrInt64 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt64(v int64) *int64 { return &v } // PtrFloat32 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat32(v float32) *float32 { return &v } // PtrFloat64 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat64(v float64) *float64 { return &v } // PtrString is a helper routine that returns a pointer to given string value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrTime(v time.Time) *time.Time { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableValue[T any] struct { value *T isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) Get() *T { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Set(val *T) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBool struct { value *bool isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) Get() *bool { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Set(val *bool) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBool(val *bool) *NullableBool { return &NullableBool{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt struct { value *int isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) Get() *int { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Set(val *int) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt(val *int) *NullableInt { return &NullableInt{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt32 struct { value *int32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) Get() *int32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Set(val *int32) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt32(val *int32) *NullableInt32 { return &NullableInt32{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt64 struct { value *int64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) Get() *int64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Set(val *int64) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt64(val *int64) *NullableInt64 { return &NullableInt64{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat32 struct { value *float32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) Get() *float32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Set(val *float32) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFloat32(val *float32) *NullableFloat32 { return &NullableFloat32{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat64 struct { value *float64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) Get() *float64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Set(val *float64) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFloat64(val *float64) *NullableFloat64 { return &NullableFloat64{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableString struct { value *string isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) Get() *string { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Set(val *string) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableString(val *string) *NullableString { return &NullableString{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableTime struct { value *time.Time isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) Get() *time.Time { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Set(val *time.Time) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableTime(val *time.Time) *NullableTime { return &NullableTime{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) MarshalJSON() ([]byte, error) { return v.value.MarshalJSON() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } // IsNil checks if an input is nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func IsNil(i interface{}) bool { if i == nil { return true @@ -369,13 +447,16 @@ func IsNil(i interface{}) bool { return false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MappedNullable interface { ToMap() (map[string]interface{}, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // randString returns a random string with a specified length. It panics if n <= 0. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func randString(n int) string { b := make([]byte, n) for i := range b { diff --git a/services/iaas/v1api/api_default.go b/services/iaas/v1api/api_default.go new file mode 100644 index 000000000..f861d7182 --- /dev/null +++ b/services/iaas/v1api/api_default.go @@ -0,0 +1,26151 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + AddNetworkToServer Create and attach a network interface from the specified network. + + Create and attach a network interface from the specified network to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiAddNetworkToServerRequest + + Deprecated + */ + AddNetworkToServer(ctx context.Context, projectId string, serverId string, networkId string) ApiAddNetworkToServerRequest + + // AddNetworkToServerExecute executes the request + // Deprecated + AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error + + /* + AddNicToServer Attach an existing network interface. + + Attach an existing network interface to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiAddNicToServerRequest + + Deprecated + */ + AddNicToServer(ctx context.Context, projectId string, serverId string, nicId string) ApiAddNicToServerRequest + + // AddNicToServerExecute executes the request + // Deprecated + AddNicToServerExecute(r ApiAddNicToServerRequest) error + + /* + AddPublicIpToServer Associate a public IP to the server. + + Associate a public IP to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiAddPublicIpToServerRequest + + Deprecated + */ + AddPublicIpToServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest + + // AddPublicIpToServerExecute executes the request + // Deprecated + AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error + + /* + AddSecurityGroupToServer Add a server to a security group. + + Add an existing server to an existing security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiAddSecurityGroupToServerRequest + + Deprecated + */ + AddSecurityGroupToServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest + + // AddSecurityGroupToServerExecute executes the request + // Deprecated + AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error + + /* + AddServiceAccountToServer Attach service account to a server. + + Attach an additional service account to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiAddServiceAccountToServerRequest + + Deprecated + */ + AddServiceAccountToServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest + + // AddServiceAccountToServerExecute executes the request + // @return ServiceAccountMailListResponse + // Deprecated + AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) + + /* + AddVolumeToServer Attach a volume to a server. + + Attach an existing volume to an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiAddVolumeToServerRequest + + Deprecated + */ + AddVolumeToServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiAddVolumeToServerRequest + + // AddVolumeToServerExecute executes the request + // @return VolumeAttachment + // Deprecated + AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) + + /* + CreateAffinityGroup Create a new affinity group in a project. + + Create a new server affinity group in the given project ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateAffinityGroupRequest + + Deprecated + */ + CreateAffinityGroup(ctx context.Context, projectId string) ApiCreateAffinityGroupRequest + + // CreateAffinityGroupExecute executes the request + // @return AffinityGroup + // Deprecated + CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) + + /* + CreateBackup Create new Backup. + + Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateBackupRequest + + Deprecated + */ + CreateBackup(ctx context.Context, projectId string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return Backup + // Deprecated + CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) + + /* + CreateImage Create new Image. + + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateImageRequest + + Deprecated + */ + CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest + + // CreateImageExecute executes the request + // @return ImageCreateResponse + // Deprecated + CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) + + /* + CreateKeyPair Import a public key. + + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. Supported keypair types are ecdsa, ed25519 and rsa. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateKeyPairRequest + + Deprecated + */ + CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest + + // CreateKeyPairExecute executes the request + // @return Keypair + // Deprecated + CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) + + /* + CreateNetwork Create new network. + + Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateNetworkRequest + + Deprecated + */ + CreateNetwork(ctx context.Context, projectId string) ApiCreateNetworkRequest + + // CreateNetworkExecute executes the request + // @return Network + // Deprecated + CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) + + /* + CreateNetworkArea Create new network area in an organization. + + Create a new network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiCreateNetworkAreaRequest + + Deprecated + */ + CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest + + // CreateNetworkAreaExecute executes the request + // @return NetworkArea + // Deprecated + CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) + + /* + CreateNetworkAreaRange Create new network range in a network area. + + Create a new network range in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiCreateNetworkAreaRangeRequest + + Deprecated + */ + CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRangeRequest + + // CreateNetworkAreaRangeExecute executes the request + // @return NetworkRangeListResponse + // Deprecated + CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) + + /* + CreateNetworkAreaRoute Create new network routes. + + Create one or several new network routes in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiCreateNetworkAreaRouteRequest + + Deprecated + */ + CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRouteRequest + + // CreateNetworkAreaRouteExecute executes the request + // @return RouteListResponse + // Deprecated + CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) + + /* + CreateNic Create new network interface. + + Create a new network interface in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiCreateNicRequest + + Deprecated + */ + CreateNic(ctx context.Context, projectId string, networkId string) ApiCreateNicRequest + + // CreateNicExecute executes the request + // @return NIC + // Deprecated + CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) + + /* + CreatePublicIP Create new public IP. + + Create a new public IP in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreatePublicIPRequest + + Deprecated + */ + CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest + + // CreatePublicIPExecute executes the request + // @return PublicIp + // Deprecated + CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) + + /* + CreateSecurityGroup Create new security group. + + Create a new security group in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateSecurityGroupRequest + + Deprecated + */ + CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest + + // CreateSecurityGroupExecute executes the request + // @return SecurityGroup + // Deprecated + CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) + + /* + CreateSecurityGroupRule Create new security group rule. + + Create a new security group rule in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiCreateSecurityGroupRuleRequest + + Deprecated + */ + CreateSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string) ApiCreateSecurityGroupRuleRequest + + // CreateSecurityGroupRuleExecute executes the request + // @return SecurityGroupRule + // Deprecated + CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) + + /* + CreateServer Create new server. + + Create a new server in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateServerRequest + + Deprecated + */ + CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest + + // CreateServerExecute executes the request + // @return Server + // Deprecated + CreateServerExecute(r ApiCreateServerRequest) (*Server, error) + + /* + CreateSnapshot Create new Snapshot. + + Create a new Snapshot from a Volume in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateSnapshotRequest + + Deprecated + */ + CreateSnapshot(ctx context.Context, projectId string) ApiCreateSnapshotRequest + + // CreateSnapshotExecute executes the request + // @return Snapshot + // Deprecated + CreateSnapshotExecute(r ApiCreateSnapshotRequest) (*Snapshot, error) + + /* + CreateVolume Create new volume. + + Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateVolumeRequest + + Deprecated + */ + CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest + + // CreateVolumeExecute executes the request + // @return Volume + // Deprecated + CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) + + /* + DeallocateServer Deallocate an existing server. + + Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest + + Deprecated + */ + DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest + + // DeallocateServerExecute executes the request + // Deprecated + DeallocateServerExecute(r ApiDeallocateServerRequest) error + + /* + DeleteAffinityGroup Delete a affinity group in a project. + + Delete a affinity group in the given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiDeleteAffinityGroupRequest + + Deprecated + */ + DeleteAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiDeleteAffinityGroupRequest + + // DeleteAffinityGroupExecute executes the request + // Deprecated + DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error + + /* + DeleteBackup Delete a backup. + + Delete a backup that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiDeleteBackupRequest + + Deprecated + */ + DeleteBackup(ctx context.Context, projectId string, backupId string) ApiDeleteBackupRequest + + // DeleteBackupExecute executes the request + // Deprecated + DeleteBackupExecute(r ApiDeleteBackupRequest) error + + /* + DeleteImage Delete an Image. + + Delete an image that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageRequest + + Deprecated + */ + DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest + + // DeleteImageExecute executes the request + // Deprecated + DeleteImageExecute(r ApiDeleteImageRequest) error + + /* + DeleteImageShare Remove image share. + + Remove the image share. New scope will be local. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest + + Deprecated + */ + DeleteImageShare(ctx context.Context, projectId string, imageId string) ApiDeleteImageShareRequest + + // DeleteImageShareExecute executes the request + // Deprecated + DeleteImageShareExecute(r ApiDeleteImageShareRequest) error + + /* + DeleteImageShareConsumer Remove an image share consumer. + + Remove consumer from a shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiDeleteImageShareConsumerRequest + + Deprecated + */ + DeleteImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest + + // DeleteImageShareConsumerExecute executes the request + // Deprecated + DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error + + /* + DeleteKeyPair Delete an SSH keypair. + + Delete an SSH keypair from a user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest + + Deprecated + */ + DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest + + // DeleteKeyPairExecute executes the request + // Deprecated + DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error + + /* + DeleteNetwork Delete network. + + Delete a network. If the network is still in use, the deletion will fail. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest + + Deprecated + */ + DeleteNetwork(ctx context.Context, projectId string, networkId string) ApiDeleteNetworkRequest + + // DeleteNetworkExecute executes the request + // Deprecated + DeleteNetworkExecute(r ApiDeleteNetworkRequest) error + + /* + DeleteNetworkArea Delete a network area. + + Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiDeleteNetworkAreaRequest + + Deprecated + */ + DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest + + // DeleteNetworkAreaExecute executes the request + // Deprecated + DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error + + /* + DeleteNetworkAreaRange Delete a network range. + + Delete a network range of a network area. The deletion will fail if the network range is still used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiDeleteNetworkAreaRangeRequest + + Deprecated + */ + DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest + + // DeleteNetworkAreaRangeExecute executes the request + // Deprecated + DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error + + /* + DeleteNetworkAreaRoute Delete a network route. + + Delete a network route of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteNetworkAreaRouteRequest + + Deprecated + */ + DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiDeleteNetworkAreaRouteRequest + + // DeleteNetworkAreaRouteExecute executes the request + // Deprecated + DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error + + /* + DeleteNic Delete a network interface. + + Delete a network interface that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest + + Deprecated + */ + DeleteNic(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNicRequest + + // DeleteNicExecute executes the request + // Deprecated + DeleteNicExecute(r ApiDeleteNicRequest) error + + /* + DeletePublicIP Delete a public IP. + + Delete a public IP that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest + + Deprecated + */ + DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest + + // DeletePublicIPExecute executes the request + // Deprecated + DeletePublicIPExecute(r ApiDeletePublicIPRequest) error + + /* + DeleteSecurityGroup Delete security group. + + Delete a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest + + Deprecated + */ + DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest + + // DeleteSecurityGroupExecute executes the request + // Deprecated + DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error + + /* + DeleteSecurityGroupRule Delete security group rule. + + Delete a security group rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest + + Deprecated + */ + DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest + + // DeleteSecurityGroupRuleExecute executes the request + // Deprecated + DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error + + /* + DeleteServer Delete a server. + + Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest + + Deprecated + */ + DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest + + // DeleteServerExecute executes the request + // Deprecated + DeleteServerExecute(r ApiDeleteServerRequest) error + + /* + DeleteSnapshot Delete a snapshot. + + Delete a snapshot that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiDeleteSnapshotRequest + + Deprecated + */ + DeleteSnapshot(ctx context.Context, projectId string, snapshotId string) ApiDeleteSnapshotRequest + + // DeleteSnapshotExecute executes the request + // Deprecated + DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) error + + /* + DeleteVolume Delete a volume. + + Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest + + Deprecated + */ + DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest + + // DeleteVolumeExecute executes the request + // Deprecated + DeleteVolumeExecute(r ApiDeleteVolumeRequest) error + + /* + GetAffinityGroup Get the affinity group. + + Get the affinity group created in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiGetAffinityGroupRequest + + Deprecated + */ + GetAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiGetAffinityGroupRequest + + // GetAffinityGroupExecute executes the request + // @return AffinityGroup + // Deprecated + GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) + + /* + GetAttachedVolume Get Volume Attachment details. + + Get the details of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest + + Deprecated + */ + GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest + + // GetAttachedVolumeExecute executes the request + // @return VolumeAttachment + // Deprecated + GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) + + /* + GetBackup Get details about a backup. + + Get details about a block device backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiGetBackupRequest + + Deprecated + */ + GetBackup(ctx context.Context, projectId string, backupId string) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return Backup + // Deprecated + GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) + + /* + GetImage Get details about an image. + + Get details about a specific Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageRequest + + Deprecated + */ + GetImage(ctx context.Context, projectId string, imageId string) ApiGetImageRequest + + // GetImageExecute executes the request + // @return Image + // Deprecated + GetImageExecute(r ApiGetImageRequest) (*Image, error) + + /* + GetImageShare Get share details of an image. + + Get share details about an shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest + + Deprecated + */ + GetImageShare(ctx context.Context, projectId string, imageId string) ApiGetImageShareRequest + + // GetImageShareExecute executes the request + // @return ImageShare + // Deprecated + GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) + + /* + GetImageShareConsumer Get image share consumer. + + Get details about an image share consumer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest + + Deprecated + */ + GetImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest + + // GetImageShareConsumerExecute executes the request + // @return ImageShareConsumer + // Deprecated + GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) + + /* + GetKeyPair Get SSH keypair details. + + Get details about an SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiGetKeyPairRequest + + Deprecated + */ + GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest + + // GetKeyPairExecute executes the request + // @return Keypair + // Deprecated + GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) + + /* + GetMachineType Get details about a machine type. + + Get details about a specific machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param machineType STACKIT machine type Name. + @return ApiGetMachineTypeRequest + + Deprecated + */ + GetMachineType(ctx context.Context, projectId string, machineType string) ApiGetMachineTypeRequest + + // GetMachineTypeExecute executes the request + // @return MachineType + // Deprecated + GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) + + /* + GetNetwork Get network details. + + Get details about a network of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest + + Deprecated + */ + GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest + + // GetNetworkExecute executes the request + // @return Network + // Deprecated + GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) + + /* + GetNetworkArea Get details about a network area. + + Get details about a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest + + Deprecated + */ + GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest + + // GetNetworkAreaExecute executes the request + // @return NetworkArea + // Deprecated + GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) + + /* + GetNetworkAreaRange Get details about a network range. + + Get details about a network range in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiGetNetworkAreaRangeRequest + + Deprecated + */ + GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiGetNetworkAreaRangeRequest + + // GetNetworkAreaRangeExecute executes the request + // @return NetworkRange + // Deprecated + GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) + + /* + GetNetworkAreaRoute Get details about a network route. + + Get details about a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetNetworkAreaRouteRequest + + Deprecated + */ + GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiGetNetworkAreaRouteRequest + + // GetNetworkAreaRouteExecute executes the request + // @return Route + // Deprecated + GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) + + /* + GetNic Get details about a network interface of a network. + + Get details about a network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiGetNicRequest + + Deprecated + */ + GetNic(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNicRequest + + // GetNicExecute executes the request + // @return NIC + // Deprecated + GetNicExecute(r ApiGetNicRequest) (*NIC, error) + + /* + GetOrganizationRequest Lookup an organization request ID. + + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest + + Deprecated + */ + GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest + + // GetOrganizationRequestExecute executes the request + // @return Request + // Deprecated + GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) + + /* + GetProjectDetails Get project details. + + Get details about a STACKIT project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiGetProjectDetailsRequest + + Deprecated + */ + GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest + + // GetProjectDetailsExecute executes the request + // @return Project + // Deprecated + GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) + + /* + GetProjectNIC Get details about a network interface of a project. + + Get details about a network interface inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param nicId The identifier (ID) of a network interface. + @return ApiGetProjectNICRequest + + Deprecated + */ + GetProjectNIC(ctx context.Context, projectId string, nicId string) ApiGetProjectNICRequest + + // GetProjectNICExecute executes the request + // @return NIC + // Deprecated + GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) + + /* + GetProjectRequest Lookup a project request ID. + + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest + + Deprecated + */ + GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest + + // GetProjectRequestExecute executes the request + // @return Request + // Deprecated + GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) + + /* + GetPublicIP Get details about a public IP. + + Get details about a public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest + + Deprecated + */ + GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest + + // GetPublicIPExecute executes the request + // @return PublicIp + // Deprecated + GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) + + /* + GetSecurityGroup Get security group details. + + Get details about a security group of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest + + Deprecated + */ + GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest + + // GetSecurityGroupExecute executes the request + // @return SecurityGroup + // Deprecated + GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) + + /* + GetSecurityGroupRule Get security group rule details. + + Get details about a security group rule of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest + + Deprecated + */ + GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest + + // GetSecurityGroupRuleExecute executes the request + // @return SecurityGroupRule + // Deprecated + GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) + + /* + GetServer Get server details. + + Get details about a server by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest + + Deprecated + */ + GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest + + // GetServerExecute executes the request + // @return Server + // Deprecated + GetServerExecute(r ApiGetServerRequest) (*Server, error) + + /* + GetServerConsole Get server console. + + Get a URL for server remote console. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest + + Deprecated + */ + GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest + + // GetServerConsoleExecute executes the request + // @return ServerConsoleUrl + // Deprecated + GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) + + /* + GetServerLog Get server log. + + Get server console log. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerLogRequest + + Deprecated + */ + GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest + + // GetServerLogExecute executes the request + // @return GetServerLog200Response + // Deprecated + GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) + + /* + GetSnapshot Get details about a snapshot. + + Get details about a block device snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiGetSnapshotRequest + + Deprecated + */ + GetSnapshot(ctx context.Context, projectId string, snapshotId string) ApiGetSnapshotRequest + + // GetSnapshotExecute executes the request + // @return Snapshot + // Deprecated + GetSnapshotExecute(r ApiGetSnapshotRequest) (*Snapshot, error) + + /* + GetVolume Get details about a volume. + + Get details about a block device volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest + + Deprecated + */ + GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest + + // GetVolumeExecute executes the request + // @return Volume + // Deprecated + GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) + + /* + GetVolumePerformanceClass Get details about a volume performance class. + + Get details about a specific volume performance class. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest + + Deprecated + */ + GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest + + // GetVolumePerformanceClassExecute executes the request + // @return VolumePerformanceClass + // Deprecated + GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) + + /* + ListAffinityGroups Get the affinity groups setup for a project. + + Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListAffinityGroupsRequest + + Deprecated + */ + ListAffinityGroups(ctx context.Context, projectId string) ApiListAffinityGroupsRequest + + // ListAffinityGroupsExecute executes the request + // @return AffinityGroupListResponse + // Deprecated + ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) + + /* + ListAttachedVolumes List all volume attachments of a server. + + Get a list of all volume attachments of a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest + + Deprecated + */ + ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest + + // ListAttachedVolumesExecute executes the request + // @return VolumeAttachmentListResponse + // Deprecated + ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) + + /* + ListAvailabilityZones List all availability zones. + + Get a list of all availability zones. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListAvailabilityZonesRequest + + Deprecated + */ + ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest + + // ListAvailabilityZonesExecute executes the request + // @return AvailabilityZoneListResponse + // Deprecated + ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) + + /* + ListBackups List all backups inside a project. + + Get a list of all backups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListBackupsRequest + + Deprecated + */ + ListBackups(ctx context.Context, projectId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return BackupListResponse + // Deprecated + ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) + + /* + ListImages List all Images inside a project. + + Get a list of all images inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListImagesRequest + + Deprecated + */ + ListImages(ctx context.Context, projectId string) ApiListImagesRequest + + // ListImagesExecute executes the request + // @return ImageListResponse + // Deprecated + ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) + + /* + ListKeyPairs List all SSH keypairs for the requesting user. + + Get a list of all SSH keypairs assigned to the requesting user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListKeyPairsRequest + + Deprecated + */ + ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest + + // ListKeyPairsExecute executes the request + // @return KeyPairListResponse + // Deprecated + ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) + + /* + ListMachineTypes List all machine types available for a project. + + Get a list of all machine type available in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListMachineTypesRequest + + Deprecated + */ + ListMachineTypes(ctx context.Context, projectId string) ApiListMachineTypesRequest + + // ListMachineTypesExecute executes the request + // @return MachineTypeListResponse + // Deprecated + ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) + + /* + ListNetworkAreaProjects List all projects using a network area. + + Get a list of all projects using a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest + + Deprecated + */ + ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest + + // ListNetworkAreaProjectsExecute executes the request + // @return ProjectListResponse + // Deprecated + ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) + + /* + ListNetworkAreaRanges List all network ranges in a network area. + + Get a list of all network ranges in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRangesRequest + + Deprecated + */ + ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRangesRequest + + // ListNetworkAreaRangesExecute executes the request + // @return NetworkRangeListResponse + // Deprecated + ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) + + /* + ListNetworkAreaRoutes List all network routes in a network area. + + Get a list of all network routes defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRoutesRequest + + Deprecated + */ + ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRoutesRequest + + // ListNetworkAreaRoutesExecute executes the request + // @return RouteListResponse + // Deprecated + ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) + + /* + ListNetworkAreas List all network areas in an organization. + + Get a list of all visible network areas defined in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiListNetworkAreasRequest + + Deprecated + */ + ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest + + // ListNetworkAreasExecute executes the request + // @return NetworkAreaListResponse + // Deprecated + ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) + + /* + ListNetworks List all networks inside a project. + + Get a list of all networks inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListNetworksRequest + + Deprecated + */ + ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest + + // ListNetworksExecute executes the request + // @return NetworkListResponse + // Deprecated + ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) + + /* + ListNics List all network interfaces inside a network. + + Get a list of all network interfaces inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListNicsRequest + + Deprecated + */ + ListNics(ctx context.Context, projectId string, networkId string) ApiListNicsRequest + + // ListNicsExecute executes the request + // @return NICListResponse + // Deprecated + ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) + + /* + ListProjectNICs List all network interfaces inside a project. + + Get a list of all network interfaces inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListProjectNICsRequest + + Deprecated + */ + ListProjectNICs(ctx context.Context, projectId string) ApiListProjectNICsRequest + + // ListProjectNICsExecute executes the request + // @return NICListResponse + // Deprecated + ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) + + /* + ListPublicIPRanges List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPublicIPRangesRequest + + Deprecated + */ + ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest + + // ListPublicIPRangesExecute executes the request + // @return PublicNetworkListResponse + // Deprecated + ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) + + /* + ListPublicIPs List all public IPs inside a project. + + Get a list of all public IPs inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListPublicIPsRequest + + Deprecated + */ + ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest + + // ListPublicIPsExecute executes the request + // @return PublicIpListResponse + // Deprecated + ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) + + /* + ListQuotas List project quotas. + + List quota limits and usage for project resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListQuotasRequest + + Deprecated + */ + ListQuotas(ctx context.Context, projectId string) ApiListQuotasRequest + + // ListQuotasExecute executes the request + // @return QuotaListResponse + // Deprecated + ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) + + /* + ListSecurityGroupRules List all rules for a security group. + + Get a list of all rules inside a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiListSecurityGroupRulesRequest + + Deprecated + */ + ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest + + // ListSecurityGroupRulesExecute executes the request + // @return SecurityGroupRuleListResponse + // Deprecated + ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) + + /* + ListSecurityGroups List all security groups inside a project. + + Get a list of all security groups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListSecurityGroupsRequest + + Deprecated + */ + ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest + + // ListSecurityGroupsExecute executes the request + // @return SecurityGroupListResponse + // Deprecated + ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) + + /* + ListServerNics Get all network interfaces. + + Get all network interfaces attached to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerNicsRequest + + Deprecated + */ + ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest + + // ListServerNicsExecute executes the request + // @return NICListResponse + // Deprecated + ListServerNicsExecute(r ApiListServerNicsRequest) (*NICListResponse, error) + + /* + ListServerServiceAccounts List all service accounts of the Server. + + Get the list of the service accounts of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerServiceAccountsRequest + + Deprecated + */ + ListServerServiceAccounts(ctx context.Context, projectId string, serverId string) ApiListServerServiceAccountsRequest + + // ListServerServiceAccountsExecute executes the request + // @return ServiceAccountMailListResponse + // Deprecated + ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) + + /* + ListServers List all servers inside a project. + + Get a list of all servers inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListServersRequest + + Deprecated + */ + ListServers(ctx context.Context, projectId string) ApiListServersRequest + + // ListServersExecute executes the request + // @return ServerListResponse + // Deprecated + ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) + + /* + ListSnapshots List all snapshots inside a project. + + Get a list of all snapshots inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListSnapshotsRequest + + Deprecated + */ + ListSnapshots(ctx context.Context, projectId string) ApiListSnapshotsRequest + + // ListSnapshotsExecute executes the request + // @return SnapshotListResponse + // Deprecated + ListSnapshotsExecute(r ApiListSnapshotsRequest) (*SnapshotListResponse, error) + + /* + ListVolumePerformanceClasses List all volume performance classes available for a project. + + Get a list of all volume performance classes available inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListVolumePerformanceClassesRequest + + Deprecated + */ + ListVolumePerformanceClasses(ctx context.Context, projectId string) ApiListVolumePerformanceClassesRequest + + // ListVolumePerformanceClassesExecute executes the request + // @return VolumePerformanceClassListResponse + // Deprecated + ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) + + /* + ListVolumes List all volumes inside a project. + + Get a list of all volumes inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListVolumesRequest + + Deprecated + */ + ListVolumes(ctx context.Context, projectId string) ApiListVolumesRequest + + // ListVolumesExecute executes the request + // @return VolumeListResponse + // Deprecated + ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) + + /* + PartialUpdateNetwork Update network settings. + + Update the settings of a network inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest + + Deprecated + */ + PartialUpdateNetwork(ctx context.Context, projectId string, networkId string) ApiPartialUpdateNetworkRequest + + // PartialUpdateNetworkExecute executes the request + // Deprecated + PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error + + /* + PartialUpdateNetworkArea Update network area settings. + + Update the settings of a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiPartialUpdateNetworkAreaRequest + + Deprecated + */ + PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest + + // PartialUpdateNetworkAreaExecute executes the request + // @return NetworkArea + // Deprecated + PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) + + /* + RebootServer Reboot the server. + + Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRebootServerRequest + + Deprecated + */ + RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest + + // RebootServerExecute executes the request + // Deprecated + RebootServerExecute(r ApiRebootServerRequest) error + + /* + RemoveNetworkFromServer Detach and delete all network interfaces associated with the specified network. + + Detach and delete all network interfaces associated with the specified network from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiRemoveNetworkFromServerRequest + + Deprecated + */ + RemoveNetworkFromServer(ctx context.Context, projectId string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest + + // RemoveNetworkFromServerExecute executes the request + // Deprecated + RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error + + /* + RemoveNicFromServer Detach a network interface. + + Detach a network interface from a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiRemoveNicFromServerRequest + + Deprecated + */ + RemoveNicFromServer(ctx context.Context, projectId string, serverId string, nicId string) ApiRemoveNicFromServerRequest + + // RemoveNicFromServerExecute executes the request + // Deprecated + RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error + + /* + RemovePublicIpFromServer Dissociate a public IP from a server. + + Dissociate a public IP on an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiRemovePublicIpFromServerRequest + + Deprecated + */ + RemovePublicIpFromServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest + + // RemovePublicIpFromServerExecute executes the request + // Deprecated + RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error + + /* + RemoveSecurityGroupFromServer Remove a server from a security group. + + Remove a server from a attached security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiRemoveSecurityGroupFromServerRequest + + Deprecated + */ + RemoveSecurityGroupFromServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest + + // RemoveSecurityGroupFromServerExecute executes the request + // Deprecated + RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error + + /* + RemoveServiceAccountFromServer Detach a service account from a server. + + Detach an additional service account from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiRemoveServiceAccountFromServerRequest + + Deprecated + */ + RemoveServiceAccountFromServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest + + // RemoveServiceAccountFromServerExecute executes the request + // @return ServiceAccountMailListResponse + // Deprecated + RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) + + /* + RemoveVolumeFromServer Detach a volume from a server. + + Detach an existing volume from an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiRemoveVolumeFromServerRequest + + Deprecated + */ + RemoveVolumeFromServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest + + // RemoveVolumeFromServerExecute executes the request + // Deprecated + RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error + + /* + RescueServer Rescue an existing server. + + Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRescueServerRequest + + Deprecated + */ + RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest + + // RescueServerExecute executes the request + // Deprecated + RescueServerExecute(r ApiRescueServerRequest) error + + /* + ResizeServer Resize a server. + + Resize the server to the given machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiResizeServerRequest + + Deprecated + */ + ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest + + // ResizeServerExecute executes the request + // Deprecated + ResizeServerExecute(r ApiResizeServerRequest) error + + /* + ResizeVolume Update the size of a volume. + + Update the size of a block device volume. The new volume size must be larger than the current size. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiResizeVolumeRequest + + Deprecated + */ + ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest + + // ResizeVolumeExecute executes the request + // Deprecated + ResizeVolumeExecute(r ApiResizeVolumeRequest) error + + /* + RestoreBackup Restore Backup to the referenced source Volume. + + Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiRestoreBackupRequest + + Deprecated + */ + RestoreBackup(ctx context.Context, projectId string, backupId string) ApiRestoreBackupRequest + + // RestoreBackupExecute executes the request + // Deprecated + RestoreBackupExecute(r ApiRestoreBackupRequest) error + + /* + SetImageShare Set image share. + + Set share of an Image. New Options will replace existing settings. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiSetImageShareRequest + + Deprecated + */ + SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest + + // SetImageShareExecute executes the request + // @return ImageShare + // Deprecated + SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) + + /* + StartServer Boot up a server. + + Start an existing server or allocates the server if deallocated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStartServerRequest + + Deprecated + */ + StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest + + // StartServerExecute executes the request + // Deprecated + StartServerExecute(r ApiStartServerRequest) error + + /* + StopServer Stop an existing server. + + Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStopServerRequest + + Deprecated + */ + StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest + + // StopServerExecute executes the request + // Deprecated + StopServerExecute(r ApiStopServerRequest) error + + /* + UnrescueServer Unrescue an existing server. + + Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUnrescueServerRequest + + Deprecated + */ + UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest + + // UnrescueServerExecute executes the request + // Deprecated + UnrescueServerExecute(r ApiUnrescueServerRequest) error + + /* + UpdateAttachedVolume Update Volume Attachment Parameters. + + Update the properties of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateAttachedVolumeRequest + + Deprecated + */ + UpdateAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest + + // UpdateAttachedVolumeExecute executes the request + // @return VolumeAttachment + // Deprecated + UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) + + /* + UpdateBackup Update information of a backup. + + Update name or labels of the backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiUpdateBackupRequest + + Deprecated + */ + UpdateBackup(ctx context.Context, projectId string, backupId string) ApiUpdateBackupRequest + + // UpdateBackupExecute executes the request + // @return Backup + // Deprecated + UpdateBackupExecute(r ApiUpdateBackupRequest) (*Backup, error) + + /* + UpdateImage Update Image Parameters. + + Update the properties of an existing Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageRequest + + Deprecated + */ + UpdateImage(ctx context.Context, projectId string, imageId string) ApiUpdateImageRequest + + // UpdateImageExecute executes the request + // @return Image + // Deprecated + UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) + + /* + UpdateImageScopeLocal Update Image Scope to Local. + + Update the scope property of an existing Image inside a project to local. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageScopeLocalRequest + + Deprecated + */ + UpdateImageScopeLocal(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopeLocalRequest + + // UpdateImageScopeLocalExecute executes the request + // @return Image + // Deprecated + UpdateImageScopeLocalExecute(r ApiUpdateImageScopeLocalRequest) (*Image, error) + + /* + UpdateImageScopePublic Update Image Scope to Public. + + Update the scope property of an existing Image inside a project to public. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageScopePublicRequest + + Deprecated + */ + UpdateImageScopePublic(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopePublicRequest + + // UpdateImageScopePublicExecute executes the request + // @return Image + // Deprecated + UpdateImageScopePublicExecute(r ApiUpdateImageScopePublicRequest) (*Image, error) + + /* + UpdateImageShare Update image share. + + Update share of an Image. Projects will be appended to existing list. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageShareRequest + + Deprecated + */ + UpdateImageShare(ctx context.Context, projectId string, imageId string) ApiUpdateImageShareRequest + + // UpdateImageShareExecute executes the request + // @return ImageShare + // Deprecated + UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) + + /* + UpdateKeyPair Update information of an SSH keypair. + + Update labels of the SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiUpdateKeyPairRequest + + Deprecated + */ + UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest + + // UpdateKeyPairExecute executes the request + // @return Keypair + // Deprecated + UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) + + /* + UpdateNetworkAreaRoute Update a network route. + + Update a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateNetworkAreaRouteRequest + + Deprecated + */ + UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiUpdateNetworkAreaRouteRequest + + // UpdateNetworkAreaRouteExecute executes the request + // @return Route + // Deprecated + UpdateNetworkAreaRouteExecute(r ApiUpdateNetworkAreaRouteRequest) (*Route, error) + + /* + UpdateNic Update a network interface. + + Update the properties of an existing network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiUpdateNicRequest + + Deprecated + */ + UpdateNic(ctx context.Context, projectId string, networkId string, nicId string) ApiUpdateNicRequest + + // UpdateNicExecute executes the request + // @return NIC + // Deprecated + UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) + + /* + UpdatePublicIP Update a public IP. + + Update the properties of an existing public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiUpdatePublicIPRequest + + Deprecated + */ + UpdatePublicIP(ctx context.Context, projectId string, publicIpId string) ApiUpdatePublicIPRequest + + // UpdatePublicIPExecute executes the request + // @return PublicIp + // Deprecated + UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) + + /* + UpdateSecurityGroup Update information of a security group. + + Update labels of the security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiUpdateSecurityGroupRequest + + Deprecated + */ + UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest + + // UpdateSecurityGroupExecute executes the request + // @return SecurityGroup + // Deprecated + UpdateSecurityGroupExecute(r ApiUpdateSecurityGroupRequest) (*SecurityGroup, error) + + /* + UpdateServer Update information of a server. + + Update name or labels of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUpdateServerRequest + + Deprecated + */ + UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest + + // UpdateServerExecute executes the request + // @return Server + // Deprecated + UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) + + /* + UpdateSnapshot Update information of the snapshot. + + Update information like name or labels of the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiUpdateSnapshotRequest + + Deprecated + */ + UpdateSnapshot(ctx context.Context, projectId string, snapshotId string) ApiUpdateSnapshotRequest + + // UpdateSnapshotExecute executes the request + // @return Snapshot + // Deprecated + UpdateSnapshotExecute(r ApiUpdateSnapshotRequest) (*Snapshot, error) + + /* + UpdateVolume Update information of a volume. + + Update name, description or labels of the volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateVolumeRequest + + Deprecated + */ + UpdateVolume(ctx context.Context, projectId string, volumeId string) ApiUpdateVolumeRequest + + // UpdateVolumeExecute executes the request + // @return Volume + // Deprecated + UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiAddNetworkToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + networkId string +} + +func (r ApiAddNetworkToServerRequest) Execute() error { + return r.ApiService.AddNetworkToServerExecute(r) +} + +/* +AddNetworkToServer Create and attach a network interface from the specified network. + +Create and attach a network interface from the specified network to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiAddNetworkToServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) AddNetworkToServer(ctx context.Context, projectId string, serverId string, networkId string) ApiAddNetworkToServerRequest { + return ApiAddNetworkToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + networkId: networkId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddNetworkToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddNicToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + nicId string +} + +func (r ApiAddNicToServerRequest) Execute() error { + return r.ApiService.AddNicToServerExecute(r) +} + +/* +AddNicToServer Attach an existing network interface. + +Attach an existing network interface to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiAddNicToServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) AddNicToServer(ctx context.Context, projectId string, serverId string, nicId string) ApiAddNicToServerRequest { + return ApiAddNicToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + nicId: nicId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) AddNicToServerExecute(r ApiAddNicToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddNicToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddPublicIpToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + publicIpId string +} + +func (r ApiAddPublicIpToServerRequest) Execute() error { + return r.ApiService.AddPublicIpToServerExecute(r) +} + +/* +AddPublicIpToServer Associate a public IP to the server. + +Associate a public IP to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiAddPublicIpToServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) AddPublicIpToServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest { + return ApiAddPublicIpToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddPublicIpToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddSecurityGroupToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + securityGroupId string +} + +func (r ApiAddSecurityGroupToServerRequest) Execute() error { + return r.ApiService.AddSecurityGroupToServerExecute(r) +} + +/* +AddSecurityGroupToServer Add a server to a security group. + +Add an existing server to an existing security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiAddSecurityGroupToServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) AddSecurityGroupToServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest { + return ApiAddSecurityGroupToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddSecurityGroupToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddServiceAccountToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + serviceAccountMail string +} + +func (r ApiAddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.AddServiceAccountToServerExecute(r) +} + +/* +AddServiceAccountToServer Attach service account to a server. + +Attach an additional service account to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiAddServiceAccountToServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) AddServiceAccountToServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest { + return ApiAddServiceAccountToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +// +// Deprecated +func (a *DefaultAPIService) AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddServiceAccountToServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(parameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, reportError("serviceAccountMail must have less than 255 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiAddVolumeToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + volumeId string + addVolumeToServerPayload *AddVolumeToServerPayload +} + +// Request a volume attachment creation. +func (r ApiAddVolumeToServerRequest) AddVolumeToServerPayload(addVolumeToServerPayload AddVolumeToServerPayload) ApiAddVolumeToServerRequest { + r.addVolumeToServerPayload = &addVolumeToServerPayload + return r +} + +func (r ApiAddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.AddVolumeToServerExecute(r) +} + +/* +AddVolumeToServer Attach a volume to a server. + +Attach an existing volume to an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiAddVolumeToServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) AddVolumeToServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiAddVolumeToServerRequest { + return ApiAddVolumeToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +// +// Deprecated +func (a *DefaultAPIService) AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddVolumeToServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addVolumeToServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createAffinityGroupPayload *CreateAffinityGroupPayload +} + +// Request a affinity group creation. +func (r ApiCreateAffinityGroupRequest) CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest { + r.createAffinityGroupPayload = &createAffinityGroupPayload + return r +} + +func (r ApiCreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { + return r.ApiService.CreateAffinityGroupExecute(r) +} + +/* +CreateAffinityGroup Create a new affinity group in a project. + +Create a new server affinity group in the given project ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateAffinityGroupRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateAffinityGroup(ctx context.Context, projectId string) ApiCreateAffinityGroupRequest { + return ApiCreateAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return AffinityGroup +// +// Deprecated +func (a *DefaultAPIService) CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateAffinityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/affinity-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createAffinityGroupPayload == nil { + return localVarReturnValue, reportError("createAffinityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAffinityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createBackupPayload *CreateBackupPayload +} + +// Request a backup creation. +func (r ApiCreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { + r.createBackupPayload = &createBackupPayload + return r +} + +func (r ApiCreateBackupRequest) Execute() (*Backup, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup Create new Backup. + +Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateBackupRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Backup +// +// Deprecated +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createBackupPayload == nil { + return localVarReturnValue, reportError("createBackupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createImagePayload *CreateImagePayload +} + +// Request an image creation. +func (r ApiCreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { + r.createImagePayload = &createImagePayload + return r +} + +func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { + return r.ApiService.CreateImageExecute(r) +} + +/* +CreateImage Create new Image. + +Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateImageRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest { + return ApiCreateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ImageCreateResponse +// +// Deprecated +func (a *DefaultAPIService) CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageCreateResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createImagePayload == nil { + return localVarReturnValue, reportError("createImagePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createImagePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + createKeyPairPayload *CreateKeyPairPayload +} + +// Request a public key import. +func (r ApiCreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { + r.createKeyPairPayload = &createKeyPairPayload + return r +} + +func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.CreateKeyPairExecute(r) +} + +/* +CreateKeyPair Import a public key. + +Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. Supported keypair types are ecdsa, ed25519 and rsa. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateKeyPairRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return ApiCreateKeyPairRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Keypair +// +// Deprecated +func (a *DefaultAPIService) CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/keypairs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createKeyPairPayload == nil { + return localVarReturnValue, reportError("createKeyPairPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createKeyPairPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createNetworkPayload *CreateNetworkPayload +} + +// Request a network creation. +func (r ApiCreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { + r.createNetworkPayload = &createNetworkPayload + return r +} + +func (r ApiCreateNetworkRequest) Execute() (*Network, error) { + return r.ApiService.CreateNetworkExecute(r) +} + +/* +CreateNetwork Create new network. + +Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateNetworkRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateNetwork(ctx context.Context, projectId string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Network +// +// Deprecated +func (a *DefaultAPIService) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createNetworkPayload == nil { + return localVarReturnValue, reportError("createNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + createNetworkAreaPayload *CreateNetworkAreaPayload +} + +// Request an area creation. +func (r ApiCreateNetworkAreaRequest) CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest { + r.createNetworkAreaPayload = &createNetworkAreaPayload + return r +} + +func (r ApiCreateNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.CreateNetworkAreaExecute(r) +} + +/* +CreateNetworkArea Create new network area in an organization. + +Create a new network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiCreateNetworkAreaRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { + return ApiCreateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Execute executes the request +// +// @return NetworkArea +// +// Deprecated +func (a *DefaultAPIService) CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if r.createNetworkAreaPayload == nil { + return localVarReturnValue, reportError("createNetworkAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + createNetworkAreaRangePayload *CreateNetworkAreaRangePayload +} + +// Request an addition of network ranges to an area. +func (r ApiCreateNetworkAreaRangeRequest) CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest { + r.createNetworkAreaRangePayload = &createNetworkAreaRangePayload + return r +} + +func (r ApiCreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, error) { + return r.ApiService.CreateNetworkAreaRangeExecute(r) +} + +/* +CreateNetworkAreaRange Create new network range in a network area. + +Create a new network range in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiCreateNetworkAreaRangeRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRangeRequest { + return ApiCreateNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return NetworkRangeListResponse +// +// Deprecated +func (a *DefaultAPIService) CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRangeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkAreaRange") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.createNetworkAreaRangePayload == nil { + return localVarReturnValue, reportError("createNetworkAreaRangePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaRangePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + createNetworkAreaRoutePayload *CreateNetworkAreaRoutePayload +} + +// Request an addition of routes to an area. +func (r ApiCreateNetworkAreaRouteRequest) CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest { + r.createNetworkAreaRoutePayload = &createNetworkAreaRoutePayload + return r +} + +func (r ApiCreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.CreateNetworkAreaRouteExecute(r) +} + +/* +CreateNetworkAreaRoute Create new network routes. + +Create one or several new network routes in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiCreateNetworkAreaRouteRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRouteRequest { + return ApiCreateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return RouteListResponse +// +// Deprecated +func (a *DefaultAPIService) CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.createNetworkAreaRoutePayload == nil { + return localVarReturnValue, reportError("createNetworkAreaRoutePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaRoutePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + networkId string + createNicPayload *CreateNicPayload +} + +// Request a network interface creation. +func (r ApiCreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { + r.createNicPayload = &createNicPayload + return r +} + +func (r ApiCreateNicRequest) Execute() (*NIC, error) { + return r.ApiService.CreateNicExecute(r) +} + +/* +CreateNic Create new network interface. + +Create a new network interface in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiCreateNicRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateNic(ctx context.Context, projectId string, networkId string) ApiCreateNicRequest { + return ApiCreateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return NIC +// +// Deprecated +func (a *DefaultAPIService) CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if r.createNicPayload == nil { + return localVarReturnValue, reportError("createNicPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNicPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreatePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createPublicIPPayload *CreatePublicIPPayload +} + +// Request a public IP creation. +func (r ApiCreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { + r.createPublicIPPayload = &createPublicIPPayload + return r +} + +func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.CreatePublicIPExecute(r) +} + +/* +CreatePublicIP Create new public IP. + +Create a new public IP in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreatePublicIPRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest { + return ApiCreatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return PublicIp +// +// Deprecated +func (a *DefaultAPIService) CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreatePublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createPublicIPPayload == nil { + return localVarReturnValue, reportError("createPublicIPPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createPublicIPPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createSecurityGroupPayload *CreateSecurityGroupPayload +} + +// Request a security group creation. +func (r ApiCreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { + r.createSecurityGroupPayload = &createSecurityGroupPayload + return r +} + +func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.CreateSecurityGroupExecute(r) +} + +/* +CreateSecurityGroup Create new security group. + +Create a new security group in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateSecurityGroupRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest { + return ApiCreateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return SecurityGroup +// +// Deprecated +func (a *DefaultAPIService) CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createSecurityGroupPayload == nil { + return localVarReturnValue, reportError("createSecurityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSecurityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + securityGroupId string + createSecurityGroupRulePayload *CreateSecurityGroupRulePayload +} + +// Request for a security group rule creation. +func (r ApiCreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { + r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload + return r +} + +func (r ApiCreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { + return r.ApiService.CreateSecurityGroupRuleExecute(r) +} + +/* +CreateSecurityGroupRule Create new security group rule. + +Create a new security group rule in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiCreateSecurityGroupRuleRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { + return ApiCreateSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRule +// +// Deprecated +func (a *DefaultAPIService) CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateSecurityGroupRule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if r.createSecurityGroupRulePayload == nil { + return localVarReturnValue, reportError("createSecurityGroupRulePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSecurityGroupRulePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createServerPayload *CreateServerPayload +} + +// Request a server creation. +func (r ApiCreateServerRequest) CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest { + r.createServerPayload = &createServerPayload + return r +} + +func (r ApiCreateServerRequest) Execute() (*Server, error) { + return r.ApiService.CreateServerExecute(r) +} + +/* +CreateServer Create new server. + +Create a new server in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest { + return ApiCreateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Server +// +// Deprecated +func (a *DefaultAPIService) CreateServerExecute(r ApiCreateServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createServerPayload == nil { + return localVarReturnValue, reportError("createServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createSnapshotPayload *CreateSnapshotPayload +} + +// Request a snapshot creation. +func (r ApiCreateSnapshotRequest) CreateSnapshotPayload(createSnapshotPayload CreateSnapshotPayload) ApiCreateSnapshotRequest { + r.createSnapshotPayload = &createSnapshotPayload + return r +} + +func (r ApiCreateSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.CreateSnapshotExecute(r) +} + +/* +CreateSnapshot Create new Snapshot. + +Create a new Snapshot from a Volume in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateSnapshotRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateSnapshot(ctx context.Context, projectId string) ApiCreateSnapshotRequest { + return ApiCreateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Snapshot +// +// Deprecated +func (a *DefaultAPIService) CreateSnapshotExecute(r ApiCreateSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createSnapshotPayload == nil { + return localVarReturnValue, reportError("createSnapshotPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSnapshotPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createVolumePayload *CreateVolumePayload +} + +// Request a volume creation. +func (r ApiCreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { + r.createVolumePayload = &createVolumePayload + return r +} + +func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.CreateVolumeExecute(r) +} + +/* +CreateVolume Create new volume. + +Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiCreateVolumeRequest + +Deprecated +*/ +func (a *DefaultAPIService) CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest { + return ApiCreateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Volume +// +// Deprecated +func (a *DefaultAPIService) CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/volumes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createVolumePayload == nil { + return localVarReturnValue, reportError("createVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeallocateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiDeallocateServerRequest) Execute() error { + return r.ApiService.DeallocateServerExecute(r) +} + +/* +DeallocateServer Deallocate an existing server. + +Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest { + return ApiDeallocateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeallocateServerExecute(r ApiDeallocateServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeallocateServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/deallocate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + affinityGroupId string +} + +func (r ApiDeleteAffinityGroupRequest) Execute() error { + return r.ApiService.DeleteAffinityGroupExecute(r) +} + +/* +DeleteAffinityGroup Delete a affinity group in a project. + +Delete a affinity group in the given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiDeleteAffinityGroupRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiDeleteAffinityGroupRequest { + return ApiDeleteAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + affinityGroupId: affinityGroupId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteAffinityGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(parameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.affinityGroupId) < 36 { + return reportError("affinityGroupId must have at least 36 elements") + } + if strlen(r.affinityGroupId) > 36 { + return reportError("affinityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + backupId string + force *bool +} + +// Force action. +func (r ApiDeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { + r.force = &force + return r +} + +func (r ApiDeleteBackupRequest) Execute() error { + return r.ApiService.DeleteBackupExecute(r) +} + +/* +DeleteBackup Delete a backup. + +Delete a backup that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiDeleteBackupRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteBackup(ctx context.Context, projectId string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return reportError("backupId must have less than 36 elements") + } + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "force", defaultValue, "form", "") + r.force = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string +} + +func (r ApiDeleteImageRequest) Execute() error { + return r.ApiService.DeleteImageExecute(r) +} + +/* +DeleteImage Delete an Image. + +Delete an image that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest { + return ApiDeleteImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteImageExecute(r ApiDeleteImageRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImage") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string +} + +func (r ApiDeleteImageShareRequest) Execute() error { + return r.ApiService.DeleteImageShareExecute(r) +} + +/* +DeleteImageShare Remove image share. + +Remove the image share. New scope will be local. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteImageShare(ctx context.Context, projectId string, imageId string) ApiDeleteImageShareRequest { + return ApiDeleteImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteImageShareExecute(r ApiDeleteImageShareRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImageShare") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageShareConsumerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string + consumerProjectId string +} + +func (r ApiDeleteImageShareConsumerRequest) Execute() error { + return r.ApiService.DeleteImageShareConsumerExecute(r) +} + +/* +DeleteImageShareConsumer Remove an image share consumer. + +Remove consumer from a shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiDeleteImageShareConsumerRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { + return ApiDeleteImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImageShareConsumer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(parameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + if strlen(r.consumerProjectId) < 36 { + return reportError("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return reportError("consumerProjectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string +} + +func (r ApiDeleteKeyPairRequest) Execute() error { + return r.ApiService.DeleteKeyPairExecute(r) +} + +/* +DeleteKeyPair Delete an SSH keypair. + +Delete an SSH keypair from a user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteKeyPair") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return reportError("keypairName must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + networkId string +} + +func (r ApiDeleteNetworkRequest) Execute() error { + return r.ApiService.DeleteNetworkExecute(r) +} + +/* +DeleteNetwork Delete network. + +Delete a network. If the network is still in use, the deletion will fail. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteNetwork(ctx context.Context, projectId string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiDeleteNetworkAreaRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaExecute(r) +} + +/* +DeleteNetworkArea Delete a network area. + +Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiDeleteNetworkAreaRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { + return ApiDeleteNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkArea") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + networkRangeId string +} + +func (r ApiDeleteNetworkAreaRangeRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaRangeExecute(r) +} + +/* +DeleteNetworkAreaRange Delete a network range. + +Delete a network range of a network area. The deletion will fail if the network range is still used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiDeleteNetworkAreaRangeRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { + return ApiDeleteNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + networkRangeId: networkRangeId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkAreaRange") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.networkRangeId) < 36 { + return reportError("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return reportError("networkRangeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + routeId string +} + +func (r ApiDeleteNetworkAreaRouteRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaRouteExecute(r) +} + +/* +DeleteNetworkAreaRoute Delete a network route. + +Delete a network route of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteNetworkAreaRouteRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiDeleteNetworkAreaRouteRequest { + return ApiDeleteNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkAreaRoute") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + networkId string + nicId string +} + +func (r ApiDeleteNicRequest) Execute() error { + return r.ApiService.DeleteNicExecute(r) +} + +/* +DeleteNic Delete a network interface. + +Delete a network interface that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteNic(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNicRequest { + return ApiDeleteNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteNicExecute(r ApiDeleteNicRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNic") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeletePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + publicIpId string +} + +func (r ApiDeletePublicIPRequest) Execute() error { + return r.ApiService.DeletePublicIPExecute(r) +} + +/* +DeletePublicIP Delete a public IP. + +Delete a public IP that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest { + return ApiDeletePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeletePublicIPExecute(r ApiDeletePublicIPRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeletePublicIP") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + securityGroupId string +} + +func (r ApiDeleteSecurityGroupRequest) Execute() error { + return r.ApiService.DeleteSecurityGroupExecute(r) +} + +/* +DeleteSecurityGroup Delete security group. + +Delete a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return ApiDeleteSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteSecurityGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + securityGroupId string + securityGroupRuleId string +} + +func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { + return r.ApiService.DeleteSecurityGroupRuleExecute(r) +} + +/* +DeleteSecurityGroupRule Delete security group rule. + +Delete a security group rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return ApiDeleteSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteSecurityGroupRule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(parameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return reportError("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return reportError("securityGroupRuleId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiDeleteServerRequest) Execute() error { + return r.ApiService.DeleteServerExecute(r) +} + +/* +DeleteServer Delete a server. + +Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteServerExecute(r ApiDeleteServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + snapshotId string +} + +func (r ApiDeleteSnapshotRequest) Execute() error { + return r.ApiService.DeleteSnapshotExecute(r) +} + +/* +DeleteSnapshot Delete a snapshot. + +Delete a snapshot that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiDeleteSnapshotRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteSnapshot(ctx context.Context, projectId string, snapshotId string) ApiDeleteSnapshotRequest { + return ApiDeleteSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteSnapshot") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return reportError("snapshotId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + volumeId string +} + +func (r ApiDeleteVolumeRequest) Execute() error { + return r.ApiService.DeleteVolumeExecute(r) +} + +/* +DeleteVolume Delete a volume. + +Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest + +Deprecated +*/ +func (a *DefaultAPIService) DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest { + return ApiDeleteVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DeleteVolumeExecute(r ApiDeleteVolumeRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiGetAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + affinityGroupId string +} + +func (r ApiGetAffinityGroupRequest) Execute() (*AffinityGroup, error) { + return r.ApiService.GetAffinityGroupExecute(r) +} + +/* +GetAffinityGroup Get the affinity group. + +Get the affinity group created in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiGetAffinityGroupRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiGetAffinityGroupRequest { + return ApiGetAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + affinityGroupId: affinityGroupId, + } +} + +// Execute executes the request +// +// @return AffinityGroup +// +// Deprecated +func (a *DefaultAPIService) GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAffinityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/affinity-groups/{affinityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(parameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.affinityGroupId) < 36 { + return localVarReturnValue, reportError("affinityGroupId must have at least 36 elements") + } + if strlen(r.affinityGroupId) > 36 { + return localVarReturnValue, reportError("affinityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetAttachedVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + volumeId string +} + +func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.GetAttachedVolumeExecute(r) +} + +/* +GetAttachedVolume Get Volume Attachment details. + +Get the details of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return ApiGetAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +// +// Deprecated +func (a *DefaultAPIService) GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*Backup, error) { + return r.ApiService.GetBackupExecute(r) +} + +/* +GetBackup Get details about a backup. + +Get details about a block device backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiGetBackupRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return Backup +// +// Deprecated +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return localVarReturnValue, reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return localVarReturnValue, reportError("backupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string +} + +func (r ApiGetImageRequest) Execute() (*Image, error) { + return r.ApiService.GetImageExecute(r) +} + +/* +GetImage Get details about an image. + +Get details about a specific Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetImage(ctx context.Context, projectId string, imageId string) ApiGetImageRequest { + return ApiGetImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return Image +// +// Deprecated +func (a *DefaultAPIService) GetImageExecute(r ApiGetImageRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string +} + +func (r ApiGetImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.GetImageShareExecute(r) +} + +/* +GetImageShare Get share details of an image. + +Get share details about an shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetImageShare(ctx context.Context, projectId string, imageId string) ApiGetImageShareRequest { + return ApiGetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +// +// Deprecated +func (a *DefaultAPIService) GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageShareConsumerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string + consumerProjectId string +} + +func (r ApiGetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { + return r.ApiService.GetImageShareConsumerExecute(r) +} + +/* +GetImageShareConsumer Get image share consumer. + +Get details about an image share consumer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { + return ApiGetImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// Execute executes the request +// +// @return ImageShareConsumer +// +// Deprecated +func (a *DefaultAPIService) GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShareConsumer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImageShareConsumer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share/{consumerProjectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(parameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if strlen(r.consumerProjectId) < 36 { + return localVarReturnValue, reportError("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return localVarReturnValue, reportError("consumerProjectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string +} + +func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.GetKeyPairExecute(r) +} + +/* +GetKeyPair Get SSH keypair details. + +Get details about an SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiGetKeyPairRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return ApiGetKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +// +// @return Keypair +// +// Deprecated +func (a *DefaultAPIService) GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return localVarReturnValue, reportError("keypairName must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetMachineTypeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + machineType string +} + +func (r ApiGetMachineTypeRequest) Execute() (*MachineType, error) { + return r.ApiService.GetMachineTypeExecute(r) +} + +/* +GetMachineType Get details about a machine type. + +Get details about a specific machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param machineType STACKIT machine type Name. + @return ApiGetMachineTypeRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetMachineType(ctx context.Context, projectId string, machineType string) ApiGetMachineTypeRequest { + return ApiGetMachineTypeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + machineType: machineType, + } +} + +// Execute executes the request +// +// @return MachineType +// +// Deprecated +func (a *DefaultAPIService) GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MachineType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMachineType") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/machine-types/{machineType}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"machineType"+"}", url.PathEscape(parameterValueToString(r.machineType, "machineType")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.machineType) > 127 { + return localVarReturnValue, reportError("machineType must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + networkId string +} + +func (r ApiGetNetworkRequest) Execute() (*Network, error) { + return r.ApiService.GetNetworkExecute(r) +} + +/* +GetNetwork Get network details. + +Get details about a network of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return Network +// +// Deprecated +func (a *DefaultAPIService) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.GetNetworkAreaExecute(r) +} + +/* +GetNetworkArea Get details about a network area. + +Get details about a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return ApiGetNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return NetworkArea +// +// Deprecated +func (a *DefaultAPIService) GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + networkRangeId string +} + +func (r ApiGetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { + return r.ApiService.GetNetworkAreaRangeExecute(r) +} + +/* +GetNetworkAreaRange Get details about a network range. + +Get details about a network range in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiGetNetworkAreaRangeRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiGetNetworkAreaRangeRequest { + return ApiGetNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + networkRangeId: networkRangeId, + } +} + +// Execute executes the request +// +// @return NetworkRange +// +// Deprecated +func (a *DefaultAPIService) GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkAreaRange") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.networkRangeId) < 36 { + return localVarReturnValue, reportError("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return localVarReturnValue, reportError("networkRangeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + routeId string +} + +func (r ApiGetNetworkAreaRouteRequest) Execute() (*Route, error) { + return r.ApiService.GetNetworkAreaRouteExecute(r) +} + +/* +GetNetworkAreaRoute Get details about a network route. + +Get details about a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetNetworkAreaRouteRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiGetNetworkAreaRouteRequest { + return ApiGetNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +// +// Deprecated +func (a *DefaultAPIService) GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + networkId string + nicId string +} + +func (r ApiGetNicRequest) Execute() (*NIC, error) { + return r.ApiService.GetNicExecute(r) +} + +/* +GetNic Get details about a network interface of a network. + +Get details about a network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiGetNicRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetNic(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNicRequest { + return ApiGetNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +// +// Deprecated +func (a *DefaultAPIService) GetNicExecute(r ApiGetNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetOrganizationRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + requestId string +} + +func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { + return r.ApiService.GetOrganizationRequestExecute(r) +} + +/* +GetOrganizationRequest Lookup an organization request ID. + +Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return ApiGetOrganizationRequestRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, + } +} + +// Execute executes the request +// +// @return Request +// +// Deprecated +func (a *DefaultAPIService) GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Request + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetOrganizationRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.requestId) < 36 { + return localVarReturnValue, reportError("requestId must have at least 36 elements") + } + if strlen(r.requestId) > 36 { + return localVarReturnValue, reportError("requestId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectDetailsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { + return r.ApiService.GetProjectDetailsExecute(r) +} + +/* +GetProjectDetails Get project details. + +Get details about a STACKIT project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiGetProjectDetailsRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return ApiGetProjectDetailsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Project +// +// Deprecated +func (a *DefaultAPIService) GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Project + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectDetails") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectNICRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + nicId string +} + +func (r ApiGetProjectNICRequest) Execute() (*NIC, error) { + return r.ApiService.GetProjectNICExecute(r) +} + +/* +GetProjectNIC Get details about a network interface of a project. + +Get details about a network interface inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param nicId The identifier (ID) of a network interface. + @return ApiGetProjectNICRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetProjectNIC(ctx context.Context, projectId string, nicId string) ApiGetProjectNICRequest { + return ApiGetProjectNICRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +// +// Deprecated +func (a *DefaultAPIService) GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectNIC") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + requestId string +} + +func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { + return r.ApiService.GetProjectRequestExecute(r) +} + +/* +GetProjectRequest Lookup a project request ID. + +Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest { + return ApiGetProjectRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + requestId: requestId, + } +} + +// Execute executes the request +// +// @return Request +// +// Deprecated +func (a *DefaultAPIService) GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Request + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.requestId) < 36 { + return localVarReturnValue, reportError("requestId must have at least 36 elements") + } + if strlen(r.requestId) > 36 { + return localVarReturnValue, reportError("requestId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetPublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + publicIpId string +} + +func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.GetPublicIPExecute(r) +} + +/* +GetPublicIP Get details about a public IP. + +Get details about a public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest { + return ApiGetPublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// +// @return PublicIp +// +// Deprecated +func (a *DefaultAPIService) GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetPublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + securityGroupId string +} + +func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.GetSecurityGroupExecute(r) +} + +/* +GetSecurityGroup Get security group details. + +Get details about a security group of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest { + return ApiGetSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroup +// +// Deprecated +func (a *DefaultAPIService) GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + securityGroupId string + securityGroupRuleId string +} + +func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { + return r.ApiService.GetSecurityGroupRuleExecute(r) +} + +/* +GetSecurityGroupRule Get security group rule details. + +Get details about a security group rule of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return ApiGetSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRule +// +// Deprecated +func (a *DefaultAPIService) GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSecurityGroupRule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(parameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return localVarReturnValue, reportError("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return localVarReturnValue, reportError("securityGroupRuleId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + details *bool +} + +// Show detailed information about server. +func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { + r.details = &details + return r +} + +func (r ApiGetServerRequest) Execute() (*Server, error) { + return r.ApiService.GetServerExecute(r) +} + +/* +GetServer Get server details. + +Get details about a server by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return Server +// +// Deprecated +func (a *DefaultAPIService) GetServerExecute(r ApiGetServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "details", defaultValue, "form", "") + r.details = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerConsoleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { + return r.ApiService.GetServerConsoleExecute(r) +} + +/* +GetServerConsole Get server console. + +Get a URL for server remote console. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return ServerConsoleUrl +// +// Deprecated +func (a *DefaultAPIService) GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServerConsoleUrl + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServerConsole") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/console" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerLogRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + length *int64 +} + +// Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. +func (r ApiGetServerLogRequest) Length(length int64) ApiGetServerLogRequest { + r.length = &length + return r +} + +func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { + return r.ApiService.GetServerLogExecute(r) +} + +/* +GetServerLog Get server log. + +Get server console log. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerLogRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest { + return ApiGetServerLogRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return GetServerLog200Response +// +// Deprecated +func (a *DefaultAPIService) GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetServerLog200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServerLog") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/log" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + if r.length != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length", r.length, "form", "") + } else { + var defaultValue int64 = 2000 + parameterAddToHeaderOrQuery(localVarQueryParams, "length", defaultValue, "form", "") + r.length = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + snapshotId string +} + +func (r ApiGetSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.GetSnapshotExecute(r) +} + +/* +GetSnapshot Get details about a snapshot. + +Get details about a block device snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiGetSnapshotRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetSnapshot(ctx context.Context, projectId string, snapshotId string) ApiGetSnapshotRequest { + return ApiGetSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, + } +} + +// Execute executes the request +// +// @return Snapshot +// +// Deprecated +func (a *DefaultAPIService) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return localVarReturnValue, reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return localVarReturnValue, reportError("snapshotId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + volumeId string +} + +func (r ApiGetVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.GetVolumeExecute(r) +} + +/* +GetVolume Get details about a volume. + +Get details about a block device volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest { + return ApiGetVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return Volume +// +// Deprecated +func (a *DefaultAPIService) GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetVolumePerformanceClassRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + volumePerformanceClass string +} + +func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { + return r.ApiService.GetVolumePerformanceClassExecute(r) +} + +/* +GetVolumePerformanceClass Get details about a volume performance class. + +Get details about a specific volume performance class. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest + +Deprecated +*/ +func (a *DefaultAPIService) GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return ApiGetVolumePerformanceClassRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumePerformanceClass: volumePerformanceClass, + } +} + +// Execute executes the request +// +// @return VolumePerformanceClass +// +// Deprecated +func (a *DefaultAPIService) GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumePerformanceClass + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVolumePerformanceClass") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/volume-performance-classes/{volumePerformanceClass}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(parameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumePerformanceClass) > 127 { + return localVarReturnValue, reportError("volumePerformanceClass must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAffinityGroupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) { + return r.ApiService.ListAffinityGroupsExecute(r) +} + +/* +ListAffinityGroups Get the affinity groups setup for a project. + +Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListAffinityGroupsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListAffinityGroups(ctx context.Context, projectId string) ApiListAffinityGroupsRequest { + return ApiListAffinityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return AffinityGroupListResponse +// +// Deprecated +func (a *DefaultAPIService) ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAffinityGroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/affinity-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAttachedVolumesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { + return r.ApiService.ListAttachedVolumesExecute(r) +} + +/* +ListAttachedVolumes List all volume attachments of a server. + +Get a list of all volume attachments of a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { + return ApiListAttachedVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return VolumeAttachmentListResponse +// +// Deprecated +func (a *DefaultAPIService) ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachmentListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAttachedVolumes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAvailabilityZonesRequest struct { + ctx context.Context + ApiService DefaultAPI +} + +func (r ApiListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { + return r.ApiService.ListAvailabilityZonesExecute(r) +} + +/* +ListAvailabilityZones List all availability zones. + +Get a list of all availability zones. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListAvailabilityZonesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest { + return ApiListAvailabilityZonesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return AvailabilityZoneListResponse +// +// Deprecated +func (a *DefaultAPIService) ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AvailabilityZoneListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAvailabilityZones") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/availability-zones" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListBackupsRequest) LabelSelector(labelSelector string) ApiListBackupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListBackupsRequest) Execute() (*BackupListResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups List all backups inside a project. + +Get a list of all backups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListBackupsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return BackupListResponse +// +// Deprecated +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListImagesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + all *bool + labelSelector *string +} + +// List all Images. +func (r ApiListImagesRequest) All(all bool) ApiListImagesRequest { + r.all = &all + return r +} + +// Filter resources by labels. +func (r ApiListImagesRequest) LabelSelector(labelSelector string) ApiListImagesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListImagesRequest) Execute() (*ImageListResponse, error) { + return r.ApiService.ListImagesExecute(r) +} + +/* +ListImages List all Images inside a project. + +Get a list of all images inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListImagesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListImages(ctx context.Context, projectId string) ApiListImagesRequest { + return ApiListImagesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ImageListResponse +// +// Deprecated +func (a *DefaultAPIService) ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListImages") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.all != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "all", r.all, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "all", defaultValue, "form", "") + r.all = &defaultValue + } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListKeyPairsRequest struct { + ctx context.Context + ApiService DefaultAPI + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { + return r.ApiService.ListKeyPairsExecute(r) +} + +/* +ListKeyPairs List all SSH keypairs for the requesting user. + +Get a list of all SSH keypairs assigned to the requesting user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListKeyPairsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ApiListKeyPairsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KeyPairListResponse +// +// Deprecated +func (a *DefaultAPIService) ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyPairListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListKeyPairs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/keypairs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListMachineTypesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + filter *string +} + +// Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. +func (r ApiListMachineTypesRequest) Filter(filter string) ApiListMachineTypesRequest { + r.filter = &filter + return r +} + +func (r ApiListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { + return r.ApiService.ListMachineTypesExecute(r) +} + +/* +ListMachineTypes List all machine types available for a project. + +Get a list of all machine type available in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListMachineTypesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListMachineTypes(ctx context.Context, projectId string) ApiListMachineTypesRequest { + return ApiListMachineTypesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return MachineTypeListResponse +// +// Deprecated +func (a *DefaultAPIService) ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MachineTypeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListMachineTypes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/machine-types" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaProjectsRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { + return r.ApiService.ListNetworkAreaProjectsExecute(r) +} + +/* +ListNetworkAreaProjects List all projects using a network area. + +Get a list of all projects using a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ApiListNetworkAreaProjectsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return ProjectListResponse +// +// Deprecated +func (a *DefaultAPIService) ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProjectListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaProjects") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/projects" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaRangesRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, error) { + return r.ApiService.ListNetworkAreaRangesExecute(r) +} + +/* +ListNetworkAreaRanges List all network ranges in a network area. + +Get a list of all network ranges in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRangesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRangesRequest { + return ApiListNetworkAreaRangesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return NetworkRangeListResponse +// +// Deprecated +func (a *DefaultAPIService) ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRangeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaRanges") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaRoutesRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworkAreaRoutesRequest) LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.ListNetworkAreaRoutesExecute(r) +} + +/* +ListNetworkAreaRoutes List all network routes in a network area. + +Get a list of all network routes defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRoutesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRoutesRequest { + return ApiListNetworkAreaRoutesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return RouteListResponse +// +// Deprecated +func (a *DefaultAPIService) ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaRoutes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreasRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { + return r.ApiService.ListNetworkAreasExecute(r) +} + +/* +ListNetworkAreas List all network areas in an organization. + +Get a list of all visible network areas defined in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiListNetworkAreasRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ApiListNetworkAreasRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Execute executes the request +// +// @return NetworkAreaListResponse +// +// Deprecated +func (a *DefaultAPIService) ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkAreaListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreas") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworksRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { + return r.ApiService.ListNetworksExecute(r) +} + +/* +ListNetworks List all networks inside a project. + +Get a list of all networks inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListNetworksRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return NetworkListResponse +// +// Deprecated +func (a *DefaultAPIService) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworks") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNicsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + networkId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNicsRequest) LabelSelector(labelSelector string) ApiListNicsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNicsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListNicsExecute(r) +} + +/* +ListNics List all network interfaces inside a network. + +Get a list of all network interfaces inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListNicsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListNics(ctx context.Context, projectId string, networkId string) ApiListNicsRequest { + return ApiListNicsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return NICListResponse +// +// Deprecated +func (a *DefaultAPIService) ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListProjectNICsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListProjectNICsRequest) LabelSelector(labelSelector string) ApiListProjectNICsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListProjectNICsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListProjectNICsExecute(r) +} + +/* +ListProjectNICs List all network interfaces inside a project. + +Get a list of all network interfaces inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListProjectNICsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListProjectNICs(ctx context.Context, projectId string) ApiListProjectNICsRequest { + return ApiListProjectNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return NICListResponse +// +// Deprecated +func (a *DefaultAPIService) ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListProjectNICs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListPublicIPRangesRequest struct { + ctx context.Context + ApiService DefaultAPI +} + +func (r ApiListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { + return r.ApiService.ListPublicIPRangesExecute(r) +} + +/* +ListPublicIPRanges List all public IP ranges. + +Get a list of all public IP ranges that STACKIT uses. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPublicIPRangesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ApiListPublicIPRangesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PublicNetworkListResponse +// +// Deprecated +func (a *DefaultAPIService) ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicNetworkListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListPublicIPRanges") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/networks/public-ip-ranges" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListPublicIPsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { + return r.ApiService.ListPublicIPsExecute(r) +} + +/* +ListPublicIPs List all public IPs inside a project. + +Get a list of all public IPs inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListPublicIPsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest { + return ApiListPublicIPsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return PublicIpListResponse +// +// Deprecated +func (a *DefaultAPIService) ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIpListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListPublicIPs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListQuotasRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListQuotasRequest) Execute() (*QuotaListResponse, error) { + return r.ApiService.ListQuotasExecute(r) +} + +/* +ListQuotas List project quotas. + +List quota limits and usage for project resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListQuotasRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListQuotas(ctx context.Context, projectId string) ApiListQuotasRequest { + return ApiListQuotasRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return QuotaListResponse +// +// Deprecated +func (a *DefaultAPIService) ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *QuotaListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListQuotas") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/quotas" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListSecurityGroupRulesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + securityGroupId string +} + +func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { + return r.ApiService.ListSecurityGroupRulesExecute(r) +} + +/* +ListSecurityGroupRules List all rules for a security group. + +Get a list of all rules inside a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiListSecurityGroupRulesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest { + return ApiListSecurityGroupRulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRuleListResponse +// +// Deprecated +func (a *DefaultAPIService) ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRuleListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSecurityGroupRules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}/rules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListSecurityGroupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { + return r.ApiService.ListSecurityGroupsExecute(r) +} + +/* +ListSecurityGroups List all security groups inside a project. + +Get a list of all security groups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListSecurityGroupsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest { + return ApiListSecurityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return SecurityGroupListResponse +// +// Deprecated +func (a *DefaultAPIService) ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSecurityGroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServerNicsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiListServerNicsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListServerNicsExecute(r) +} + +/* +ListServerNics Get all network interfaces. + +Get all network interfaces attached to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerNicsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest { + return ApiListServerNicsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return NICListResponse +// +// Deprecated +func (a *DefaultAPIService) ListServerNicsExecute(r ApiListServerNicsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServerNics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServerServiceAccountsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.ListServerServiceAccountsExecute(r) +} + +/* +ListServerServiceAccounts List all service accounts of the Server. + +Get the list of the service accounts of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerServiceAccountsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListServerServiceAccounts(ctx context.Context, projectId string, serverId string) ApiListServerServiceAccountsRequest { + return ApiListServerServiceAccountsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +// +// Deprecated +func (a *DefaultAPIService) ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServerServiceAccounts") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service-accounts" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + details *bool + labelSelector *string +} + +// Show detailed information about server. +func (r ApiListServersRequest) Details(details bool) ApiListServersRequest { + r.details = &details + return r +} + +// Filter resources by labels. +func (r ApiListServersRequest) LabelSelector(labelSelector string) ApiListServersRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListServersRequest) Execute() (*ServerListResponse, error) { + return r.ApiService.ListServersExecute(r) +} + +/* +ListServers List all servers inside a project. + +Get a list of all servers inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListServersRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListServers(ctx context.Context, projectId string) ApiListServersRequest { + return ApiListServersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ServerListResponse +// +// Deprecated +func (a *DefaultAPIService) ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServerListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "details", defaultValue, "form", "") + r.details = &defaultValue + } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListSnapshotsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListSnapshotsRequest) LabelSelector(labelSelector string) ApiListSnapshotsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListSnapshotsRequest) Execute() (*SnapshotListResponse, error) { + return r.ApiService.ListSnapshotsExecute(r) +} + +/* +ListSnapshots List all snapshots inside a project. + +Get a list of all snapshots inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListSnapshotsRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListSnapshots(ctx context.Context, projectId string) ApiListSnapshotsRequest { + return ApiListSnapshotsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return SnapshotListResponse +// +// Deprecated +func (a *DefaultAPIService) ListSnapshotsExecute(r ApiListSnapshotsRequest) (*SnapshotListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SnapshotListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSnapshots") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVolumePerformanceClassesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListVolumePerformanceClassesRequest) LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassListResponse, error) { + return r.ApiService.ListVolumePerformanceClassesExecute(r) +} + +/* +ListVolumePerformanceClasses List all volume performance classes available for a project. + +Get a list of all volume performance classes available inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListVolumePerformanceClassesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListVolumePerformanceClasses(ctx context.Context, projectId string) ApiListVolumePerformanceClassesRequest { + return ApiListVolumePerformanceClassesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return VolumePerformanceClassListResponse +// +// Deprecated +func (a *DefaultAPIService) ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumePerformanceClassListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVolumePerformanceClasses") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/volume-performance-classes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVolumesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListVolumesRequest) LabelSelector(labelSelector string) ApiListVolumesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListVolumesRequest) Execute() (*VolumeListResponse, error) { + return r.ApiService.ListVolumesExecute(r) +} + +/* +ListVolumes List all volumes inside a project. + +Get a list of all volumes inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiListVolumesRequest + +Deprecated +*/ +func (a *DefaultAPIService) ListVolumes(ctx context.Context, projectId string) ApiListVolumesRequest { + return ApiListVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return VolumeListResponse +// +// Deprecated +func (a *DefaultAPIService) ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVolumes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/volumes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + networkId string + partialUpdateNetworkPayload *PartialUpdateNetworkPayload +} + +// Request an update of a network. +func (r ApiPartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { + r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload + return r +} + +func (r ApiPartialUpdateNetworkRequest) Execute() error { + return r.ApiService.PartialUpdateNetworkExecute(r) +} + +/* +PartialUpdateNetwork Update network settings. + +Update the settings of a network inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest + +Deprecated +*/ +func (a *DefaultAPIService) PartialUpdateNetwork(ctx context.Context, projectId string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + if r.partialUpdateNetworkPayload == nil { + return reportError("partialUpdateNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiPartialUpdateNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + partialUpdateNetworkAreaPayload *PartialUpdateNetworkAreaPayload +} + +// Request to update an area. +func (r ApiPartialUpdateNetworkAreaRequest) PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest { + r.partialUpdateNetworkAreaPayload = &partialUpdateNetworkAreaPayload + return r +} + +func (r ApiPartialUpdateNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.PartialUpdateNetworkAreaExecute(r) +} + +/* +PartialUpdateNetworkArea Update network area settings. + +Update the settings of a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiPartialUpdateNetworkAreaRequest + +Deprecated +*/ +func (a *DefaultAPIService) PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest { + return ApiPartialUpdateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return NetworkArea +// +// Deprecated +func (a *DefaultAPIService) PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.partialUpdateNetworkAreaPayload == nil { + return localVarReturnValue, reportError("partialUpdateNetworkAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateNetworkAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiRebootServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + action *string +} + +// Defines if it is a soft or a hard reboot. +func (r ApiRebootServerRequest) Action(action string) ApiRebootServerRequest { + r.action = &action + return r +} + +func (r ApiRebootServerRequest) Execute() error { + return r.ApiService.RebootServerExecute(r) +} + +/* +RebootServer Reboot the server. + +Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRebootServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest { + return ApiRebootServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) RebootServerExecute(r ApiRebootServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RebootServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/reboot" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "form", "") + } else { + var defaultValue string = "soft" + parameterAddToHeaderOrQuery(localVarQueryParams, "action", defaultValue, "form", "") + r.action = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveNetworkFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + networkId string +} + +func (r ApiRemoveNetworkFromServerRequest) Execute() error { + return r.ApiService.RemoveNetworkFromServerExecute(r) +} + +/* +RemoveNetworkFromServer Detach and delete all network interfaces associated with the specified network. + +Detach and delete all network interfaces associated with the specified network from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiRemoveNetworkFromServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) RemoveNetworkFromServer(ctx context.Context, projectId string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { + return ApiRemoveNetworkFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + networkId: networkId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveNetworkFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveNicFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + nicId string +} + +func (r ApiRemoveNicFromServerRequest) Execute() error { + return r.ApiService.RemoveNicFromServerExecute(r) +} + +/* +RemoveNicFromServer Detach a network interface. + +Detach a network interface from a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiRemoveNicFromServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) RemoveNicFromServer(ctx context.Context, projectId string, serverId string, nicId string) ApiRemoveNicFromServerRequest { + return ApiRemoveNicFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + nicId: nicId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveNicFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemovePublicIpFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + publicIpId string +} + +func (r ApiRemovePublicIpFromServerRequest) Execute() error { + return r.ApiService.RemovePublicIpFromServerExecute(r) +} + +/* +RemovePublicIpFromServer Dissociate a public IP from a server. + +Dissociate a public IP on an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiRemovePublicIpFromServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) RemovePublicIpFromServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { + return ApiRemovePublicIpFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemovePublicIpFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveSecurityGroupFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + securityGroupId string +} + +func (r ApiRemoveSecurityGroupFromServerRequest) Execute() error { + return r.ApiService.RemoveSecurityGroupFromServerExecute(r) +} + +/* +RemoveSecurityGroupFromServer Remove a server from a security group. + +Remove a server from a attached security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiRemoveSecurityGroupFromServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { + return ApiRemoveSecurityGroupFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveSecurityGroupFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveServiceAccountFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + serviceAccountMail string +} + +func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.RemoveServiceAccountFromServerExecute(r) +} + +/* +RemoveServiceAccountFromServer Detach a service account from a server. + +Detach an additional service account from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiRemoveServiceAccountFromServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) RemoveServiceAccountFromServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { + return ApiRemoveServiceAccountFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +// +// Deprecated +func (a *DefaultAPIService) RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveServiceAccountFromServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service-accounts/{serviceAccountMail}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(parameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, reportError("serviceAccountMail must have less than 255 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiRemoveVolumeFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + volumeId string +} + +func (r ApiRemoveVolumeFromServerRequest) Execute() error { + return r.ApiService.RemoveVolumeFromServerExecute(r) +} + +/* +RemoveVolumeFromServer Detach a volume from a server. + +Detach an existing volume from an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiRemoveVolumeFromServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) RemoveVolumeFromServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { + return ApiRemoveVolumeFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveVolumeFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRescueServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + rescueServerPayload *RescueServerPayload +} + +// Request a server rescue. +func (r ApiRescueServerRequest) RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest { + r.rescueServerPayload = &rescueServerPayload + return r +} + +func (r ApiRescueServerRequest) Execute() error { + return r.ApiService.RescueServerExecute(r) +} + +/* +RescueServer Rescue an existing server. + +Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRescueServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest { + return ApiRescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) RescueServerExecute(r ApiRescueServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RescueServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/rescue" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if r.rescueServerPayload == nil { + return reportError("rescueServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rescueServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiResizeServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + resizeServerPayload *ResizeServerPayload +} + +// Request a resize of a server. +func (r ApiResizeServerRequest) ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest { + r.resizeServerPayload = &resizeServerPayload + return r +} + +func (r ApiResizeServerRequest) Execute() error { + return r.ApiService.ResizeServerExecute(r) +} + +/* +ResizeServer Resize a server. + +Resize the server to the given machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiResizeServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest { + return ApiResizeServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) ResizeServerExecute(r ApiResizeServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResizeServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/resize" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if r.resizeServerPayload == nil { + return reportError("resizeServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.resizeServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiResizeVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + volumeId string + resizeVolumePayload *ResizeVolumePayload +} + +// Request a volume resize. +func (r ApiResizeVolumeRequest) ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest { + r.resizeVolumePayload = &resizeVolumePayload + return r +} + +func (r ApiResizeVolumeRequest) Execute() error { + return r.ApiService.ResizeVolumeExecute(r) +} + +/* +ResizeVolume Update the size of a volume. + +Update the size of a block device volume. The new volume size must be larger than the current size. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiResizeVolumeRequest + +Deprecated +*/ +func (a *DefaultAPIService) ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest { + return ApiResizeVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) ResizeVolumeExecute(r ApiResizeVolumeRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResizeVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/volumes/{volumeId}/resize" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.resizeVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRestoreBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + backupId string +} + +func (r ApiRestoreBackupRequest) Execute() error { + return r.ApiService.RestoreBackupExecute(r) +} + +/* +RestoreBackup Restore Backup to the referenced source Volume. + +Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiRestoreBackupRequest + +Deprecated +*/ +func (a *DefaultAPIService) RestoreBackup(ctx context.Context, projectId string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return reportError("backupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiSetImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string + setImageSharePayload *SetImageSharePayload +} + +// Settings for an Image Share. +func (r ApiSetImageShareRequest) SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest { + r.setImageSharePayload = &setImageSharePayload + return r +} + +func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.SetImageShareExecute(r) +} + +/* +SetImageShare Set image share. + +Set share of an Image. New Options will replace existing settings. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiSetImageShareRequest + +Deprecated +*/ +func (a *DefaultAPIService) SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest { + return ApiSetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +// +// Deprecated +func (a *DefaultAPIService) SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.SetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.setImageSharePayload == nil { + return localVarReturnValue, reportError("setImageSharePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setImageSharePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiStartServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiStartServerRequest) Execute() error { + return r.ApiService.StartServerExecute(r) +} + +/* +StartServer Boot up a server. + +Start an existing server or allocates the server if deallocated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStartServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest { + return ApiStartServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) StartServerExecute(r ApiStartServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.StartServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/start" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiStopServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiStopServerRequest) Execute() error { + return r.ApiService.StopServerExecute(r) +} + +/* +StopServer Stop an existing server. + +Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStopServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest { + return ApiStopServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) StopServerExecute(r ApiStopServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.StopServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/stop" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiUnrescueServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiUnrescueServerRequest) Execute() error { + return r.ApiService.UnrescueServerExecute(r) +} + +/* +UnrescueServer Unrescue an existing server. + +Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUnrescueServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest { + return ApiUnrescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) UnrescueServerExecute(r ApiUnrescueServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UnrescueServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/unrescue" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiUpdateAttachedVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + volumeId string + updateAttachedVolumePayload *UpdateAttachedVolumePayload +} + +// Request a volume attachment update. +func (r ApiUpdateAttachedVolumeRequest) UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest { + r.updateAttachedVolumePayload = &updateAttachedVolumePayload + return r +} + +func (r ApiUpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.UpdateAttachedVolumeExecute(r) +} + +/* +UpdateAttachedVolume Update Volume Attachment Parameters. + +Update the properties of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateAttachedVolumeRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { + return ApiUpdateAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +// +// Deprecated +func (a *DefaultAPIService) UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + if r.updateAttachedVolumePayload == nil { + return localVarReturnValue, reportError("updateAttachedVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateAttachedVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + backupId string + updateBackupPayload *UpdateBackupPayload +} + +// Request an update of a backup. +func (r ApiUpdateBackupRequest) UpdateBackupPayload(updateBackupPayload UpdateBackupPayload) ApiUpdateBackupRequest { + r.updateBackupPayload = &updateBackupPayload + return r +} + +func (r ApiUpdateBackupRequest) Execute() (*Backup, error) { + return r.ApiService.UpdateBackupExecute(r) +} + +/* +UpdateBackup Update information of a backup. + +Update name or labels of the backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiUpdateBackupRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateBackup(ctx context.Context, projectId string, backupId string) ApiUpdateBackupRequest { + return ApiUpdateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return Backup +// +// Deprecated +func (a *DefaultAPIService) UpdateBackupExecute(r ApiUpdateBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return localVarReturnValue, reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return localVarReturnValue, reportError("backupId must have less than 36 elements") + } + if r.updateBackupPayload == nil { + return localVarReturnValue, reportError("updateBackupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string + updateImagePayload *UpdateImagePayload +} + +// Request an update of an Image. +func (r ApiUpdateImageRequest) UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest { + r.updateImagePayload = &updateImagePayload + return r +} + +func (r ApiUpdateImageRequest) Execute() (*Image, error) { + return r.ApiService.UpdateImageExecute(r) +} + +/* +UpdateImage Update Image Parameters. + +Update the properties of an existing Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateImage(ctx context.Context, projectId string, imageId string) ApiUpdateImageRequest { + return ApiUpdateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return Image +// +// Deprecated +func (a *DefaultAPIService) UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.updateImagePayload == nil { + return localVarReturnValue, reportError("updateImagePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateImagePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateImageScopeLocalRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string +} + +func (r ApiUpdateImageScopeLocalRequest) Execute() (*Image, error) { + return r.ApiService.UpdateImageScopeLocalExecute(r) +} + +/* +UpdateImageScopeLocal Update Image Scope to Local. + +Update the scope property of an existing Image inside a project to local. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageScopeLocalRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateImageScopeLocal(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopeLocalRequest { + return ApiUpdateImageScopeLocalRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return Image +// +// Deprecated +func (a *DefaultAPIService) UpdateImageScopeLocalExecute(r ApiUpdateImageScopeLocalRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateImageScopeLocal") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/publish" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateImageScopePublicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string +} + +func (r ApiUpdateImageScopePublicRequest) Execute() (*Image, error) { + return r.ApiService.UpdateImageScopePublicExecute(r) +} + +/* +UpdateImageScopePublic Update Image Scope to Public. + +Update the scope property of an existing Image inside a project to public. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageScopePublicRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateImageScopePublic(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopePublicRequest { + return ApiUpdateImageScopePublicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return Image +// +// Deprecated +func (a *DefaultAPIService) UpdateImageScopePublicExecute(r ApiUpdateImageScopePublicRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateImageScopePublic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/publish" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + imageId string + updateImageSharePayload *UpdateImageSharePayload +} + +// Update an Image Share. +func (r ApiUpdateImageShareRequest) UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest { + r.updateImageSharePayload = &updateImageSharePayload + return r +} + +func (r ApiUpdateImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.UpdateImageShareExecute(r) +} + +/* +UpdateImageShare Update image share. + +Update share of an Image. Projects will be appended to existing list. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageShareRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateImageShare(ctx context.Context, projectId string, imageId string) ApiUpdateImageShareRequest { + return ApiUpdateImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +// +// Deprecated +func (a *DefaultAPIService) UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.updateImageSharePayload == nil { + return localVarReturnValue, reportError("updateImageSharePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateImageSharePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string + updateKeyPairPayload *UpdateKeyPairPayload +} + +// Request an update of an SSH keypair. +func (r ApiUpdateKeyPairRequest) UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest { + r.updateKeyPairPayload = &updateKeyPairPayload + return r +} + +func (r ApiUpdateKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.UpdateKeyPairExecute(r) +} + +/* +UpdateKeyPair Update information of an SSH keypair. + +Update labels of the SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiUpdateKeyPairRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { + return ApiUpdateKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +// +// @return Keypair +// +// Deprecated +func (a *DefaultAPIService) UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return localVarReturnValue, reportError("keypairName must have less than 127 elements") + } + if r.updateKeyPairPayload == nil { + return localVarReturnValue, reportError("updateKeyPairPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateKeyPairPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + routeId string + updateNetworkAreaRoutePayload *UpdateNetworkAreaRoutePayload +} + +// Request an update of a network route. +func (r ApiUpdateNetworkAreaRouteRequest) UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload UpdateNetworkAreaRoutePayload) ApiUpdateNetworkAreaRouteRequest { + r.updateNetworkAreaRoutePayload = &updateNetworkAreaRoutePayload + return r +} + +func (r ApiUpdateNetworkAreaRouteRequest) Execute() (*Route, error) { + return r.ApiService.UpdateNetworkAreaRouteExecute(r) +} + +/* +UpdateNetworkAreaRoute Update a network route. + +Update a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateNetworkAreaRouteRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiUpdateNetworkAreaRouteRequest { + return ApiUpdateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +// +// Deprecated +func (a *DefaultAPIService) UpdateNetworkAreaRouteExecute(r ApiUpdateNetworkAreaRouteRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/organizations/{organizationId}/network-areas/{areaId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + if r.updateNetworkAreaRoutePayload == nil { + return localVarReturnValue, reportError("updateNetworkAreaRoutePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateNetworkAreaRoutePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + networkId string + nicId string + updateNicPayload *UpdateNicPayload +} + +// Request an update of a network interface. +func (r ApiUpdateNicRequest) UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest { + r.updateNicPayload = &updateNicPayload + return r +} + +func (r ApiUpdateNicRequest) Execute() (*NIC, error) { + return r.ApiService.UpdateNicExecute(r) +} + +/* +UpdateNic Update a network interface. + +Update the properties of an existing network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiUpdateNicRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateNic(ctx context.Context, projectId string, networkId string, nicId string) ApiUpdateNicRequest { + return ApiUpdateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +// +// Deprecated +func (a *DefaultAPIService) UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + if r.updateNicPayload == nil { + return localVarReturnValue, reportError("updateNicPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateNicPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdatePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + publicIpId string + updatePublicIPPayload *UpdatePublicIPPayload +} + +// Request an update of a public IP. +func (r ApiUpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { + r.updatePublicIPPayload = &updatePublicIPPayload + return r +} + +func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.UpdatePublicIPExecute(r) +} + +/* +UpdatePublicIP Update a public IP. + +Update the properties of an existing public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiUpdatePublicIPRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdatePublicIP(ctx context.Context, projectId string, publicIpId string) ApiUpdatePublicIPRequest { + return ApiUpdatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// +// @return PublicIp +// +// Deprecated +func (a *DefaultAPIService) UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdatePublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, reportError("publicIpId must have less than 36 elements") + } + if r.updatePublicIPPayload == nil { + return localVarReturnValue, reportError("updatePublicIPPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updatePublicIPPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + securityGroupId string + updateSecurityGroupPayload *UpdateSecurityGroupPayload +} + +// Request an update of a security group. +func (r ApiUpdateSecurityGroupRequest) UpdateSecurityGroupPayload(updateSecurityGroupPayload UpdateSecurityGroupPayload) ApiUpdateSecurityGroupRequest { + r.updateSecurityGroupPayload = &updateSecurityGroupPayload + return r +} + +func (r ApiUpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.UpdateSecurityGroupExecute(r) +} + +/* +UpdateSecurityGroup Update information of a security group. + +Update labels of the security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiUpdateSecurityGroupRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest { + return ApiUpdateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroup +// +// Deprecated +func (a *DefaultAPIService) UpdateSecurityGroupExecute(r ApiUpdateSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if r.updateSecurityGroupPayload == nil { + return localVarReturnValue, reportError("updateSecurityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateSecurityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + updateServerPayload *UpdateServerPayload +} + +// Request an update of a server. +func (r ApiUpdateServerRequest) UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest { + r.updateServerPayload = &updateServerPayload + return r +} + +func (r ApiUpdateServerRequest) Execute() (*Server, error) { + return r.ApiService.UpdateServerExecute(r) +} + +/* +UpdateServer Update information of a server. + +Update name or labels of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUpdateServerRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest { + return ApiUpdateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return Server +// +// Deprecated +func (a *DefaultAPIService) UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if r.updateServerPayload == nil { + return localVarReturnValue, reportError("updateServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + snapshotId string + updateSnapshotPayload *UpdateSnapshotPayload +} + +// Request an update of a snapshot. +func (r ApiUpdateSnapshotRequest) UpdateSnapshotPayload(updateSnapshotPayload UpdateSnapshotPayload) ApiUpdateSnapshotRequest { + r.updateSnapshotPayload = &updateSnapshotPayload + return r +} + +func (r ApiUpdateSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.UpdateSnapshotExecute(r) +} + +/* +UpdateSnapshot Update information of the snapshot. + +Update information like name or labels of the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiUpdateSnapshotRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateSnapshot(ctx context.Context, projectId string, snapshotId string) ApiUpdateSnapshotRequest { + return ApiUpdateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, + } +} + +// Execute executes the request +// +// @return Snapshot +// +// Deprecated +func (a *DefaultAPIService) UpdateSnapshotExecute(r ApiUpdateSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return localVarReturnValue, reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return localVarReturnValue, reportError("snapshotId must have less than 36 elements") + } + if r.updateSnapshotPayload == nil { + return localVarReturnValue, reportError("updateSnapshotPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateSnapshotPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + volumeId string + updateVolumePayload *UpdateVolumePayload +} + +// Request an update of a volume. +func (r ApiUpdateVolumeRequest) UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest { + r.updateVolumePayload = &updateVolumePayload + return r +} + +func (r ApiUpdateVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.UpdateVolumeExecute(r) +} + +/* +UpdateVolume Update information of a volume. + +Update name, description or labels of the volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateVolumeRequest + +Deprecated +*/ +func (a *DefaultAPIService) UpdateVolume(ctx context.Context, projectId string, volumeId string) ApiUpdateVolumeRequest { + return ApiUpdateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return Volume +// +// Deprecated +func (a *DefaultAPIService) UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + if r.updateVolumePayload == nil { + return localVarReturnValue, reportError("updateVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/iaas/v1api/api_default_mock.go b/services/iaas/v1api/api_default_mock.go new file mode 100644 index 000000000..12c2dda59 --- /dev/null +++ b/services/iaas/v1api/api_default_mock.go @@ -0,0 +1,2640 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // Deprecated: AddNetworkToServerExecuteMock can be populated to implement the behavior of the AddNetworkToServerExecute function of this mock + AddNetworkToServerExecuteMock *func(r ApiAddNetworkToServerRequest) error + // Deprecated: AddNicToServerExecuteMock can be populated to implement the behavior of the AddNicToServerExecute function of this mock + AddNicToServerExecuteMock *func(r ApiAddNicToServerRequest) error + // Deprecated: AddPublicIpToServerExecuteMock can be populated to implement the behavior of the AddPublicIpToServerExecute function of this mock + AddPublicIpToServerExecuteMock *func(r ApiAddPublicIpToServerRequest) error + // Deprecated: AddSecurityGroupToServerExecuteMock can be populated to implement the behavior of the AddSecurityGroupToServerExecute function of this mock + AddSecurityGroupToServerExecuteMock *func(r ApiAddSecurityGroupToServerRequest) error + // Deprecated: AddServiceAccountToServerExecuteMock can be populated to implement the behavior of the AddServiceAccountToServerExecute function of this mock + AddServiceAccountToServerExecuteMock *func(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) + // Deprecated: AddVolumeToServerExecuteMock can be populated to implement the behavior of the AddVolumeToServerExecute function of this mock + AddVolumeToServerExecuteMock *func(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) + // Deprecated: CreateAffinityGroupExecuteMock can be populated to implement the behavior of the CreateAffinityGroupExecute function of this mock + CreateAffinityGroupExecuteMock *func(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) + // Deprecated: CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) (*Backup, error) + // Deprecated: CreateImageExecuteMock can be populated to implement the behavior of the CreateImageExecute function of this mock + CreateImageExecuteMock *func(r ApiCreateImageRequest) (*ImageCreateResponse, error) + // Deprecated: CreateKeyPairExecuteMock can be populated to implement the behavior of the CreateKeyPairExecute function of this mock + CreateKeyPairExecuteMock *func(r ApiCreateKeyPairRequest) (*Keypair, error) + // Deprecated: CreateNetworkExecuteMock can be populated to implement the behavior of the CreateNetworkExecute function of this mock + CreateNetworkExecuteMock *func(r ApiCreateNetworkRequest) (*Network, error) + // Deprecated: CreateNetworkAreaExecuteMock can be populated to implement the behavior of the CreateNetworkAreaExecute function of this mock + CreateNetworkAreaExecuteMock *func(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) + // Deprecated: CreateNetworkAreaRangeExecuteMock can be populated to implement the behavior of the CreateNetworkAreaRangeExecute function of this mock + CreateNetworkAreaRangeExecuteMock *func(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) + // Deprecated: CreateNetworkAreaRouteExecuteMock can be populated to implement the behavior of the CreateNetworkAreaRouteExecute function of this mock + CreateNetworkAreaRouteExecuteMock *func(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) + // Deprecated: CreateNicExecuteMock can be populated to implement the behavior of the CreateNicExecute function of this mock + CreateNicExecuteMock *func(r ApiCreateNicRequest) (*NIC, error) + // Deprecated: CreatePublicIPExecuteMock can be populated to implement the behavior of the CreatePublicIPExecute function of this mock + CreatePublicIPExecuteMock *func(r ApiCreatePublicIPRequest) (*PublicIp, error) + // Deprecated: CreateSecurityGroupExecuteMock can be populated to implement the behavior of the CreateSecurityGroupExecute function of this mock + CreateSecurityGroupExecuteMock *func(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) + // Deprecated: CreateSecurityGroupRuleExecuteMock can be populated to implement the behavior of the CreateSecurityGroupRuleExecute function of this mock + CreateSecurityGroupRuleExecuteMock *func(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) + // Deprecated: CreateServerExecuteMock can be populated to implement the behavior of the CreateServerExecute function of this mock + CreateServerExecuteMock *func(r ApiCreateServerRequest) (*Server, error) + // Deprecated: CreateSnapshotExecuteMock can be populated to implement the behavior of the CreateSnapshotExecute function of this mock + CreateSnapshotExecuteMock *func(r ApiCreateSnapshotRequest) (*Snapshot, error) + // Deprecated: CreateVolumeExecuteMock can be populated to implement the behavior of the CreateVolumeExecute function of this mock + CreateVolumeExecuteMock *func(r ApiCreateVolumeRequest) (*Volume, error) + // Deprecated: DeallocateServerExecuteMock can be populated to implement the behavior of the DeallocateServerExecute function of this mock + DeallocateServerExecuteMock *func(r ApiDeallocateServerRequest) error + // Deprecated: DeleteAffinityGroupExecuteMock can be populated to implement the behavior of the DeleteAffinityGroupExecute function of this mock + DeleteAffinityGroupExecuteMock *func(r ApiDeleteAffinityGroupRequest) error + // Deprecated: DeleteBackupExecuteMock can be populated to implement the behavior of the DeleteBackupExecute function of this mock + DeleteBackupExecuteMock *func(r ApiDeleteBackupRequest) error + // Deprecated: DeleteImageExecuteMock can be populated to implement the behavior of the DeleteImageExecute function of this mock + DeleteImageExecuteMock *func(r ApiDeleteImageRequest) error + // Deprecated: DeleteImageShareExecuteMock can be populated to implement the behavior of the DeleteImageShareExecute function of this mock + DeleteImageShareExecuteMock *func(r ApiDeleteImageShareRequest) error + // Deprecated: DeleteImageShareConsumerExecuteMock can be populated to implement the behavior of the DeleteImageShareConsumerExecute function of this mock + DeleteImageShareConsumerExecuteMock *func(r ApiDeleteImageShareConsumerRequest) error + // Deprecated: DeleteKeyPairExecuteMock can be populated to implement the behavior of the DeleteKeyPairExecute function of this mock + DeleteKeyPairExecuteMock *func(r ApiDeleteKeyPairRequest) error + // Deprecated: DeleteNetworkExecuteMock can be populated to implement the behavior of the DeleteNetworkExecute function of this mock + DeleteNetworkExecuteMock *func(r ApiDeleteNetworkRequest) error + // Deprecated: DeleteNetworkAreaExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaExecute function of this mock + DeleteNetworkAreaExecuteMock *func(r ApiDeleteNetworkAreaRequest) error + // Deprecated: DeleteNetworkAreaRangeExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaRangeExecute function of this mock + DeleteNetworkAreaRangeExecuteMock *func(r ApiDeleteNetworkAreaRangeRequest) error + // Deprecated: DeleteNetworkAreaRouteExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaRouteExecute function of this mock + DeleteNetworkAreaRouteExecuteMock *func(r ApiDeleteNetworkAreaRouteRequest) error + // Deprecated: DeleteNicExecuteMock can be populated to implement the behavior of the DeleteNicExecute function of this mock + DeleteNicExecuteMock *func(r ApiDeleteNicRequest) error + // Deprecated: DeletePublicIPExecuteMock can be populated to implement the behavior of the DeletePublicIPExecute function of this mock + DeletePublicIPExecuteMock *func(r ApiDeletePublicIPRequest) error + // Deprecated: DeleteSecurityGroupExecuteMock can be populated to implement the behavior of the DeleteSecurityGroupExecute function of this mock + DeleteSecurityGroupExecuteMock *func(r ApiDeleteSecurityGroupRequest) error + // Deprecated: DeleteSecurityGroupRuleExecuteMock can be populated to implement the behavior of the DeleteSecurityGroupRuleExecute function of this mock + DeleteSecurityGroupRuleExecuteMock *func(r ApiDeleteSecurityGroupRuleRequest) error + // Deprecated: DeleteServerExecuteMock can be populated to implement the behavior of the DeleteServerExecute function of this mock + DeleteServerExecuteMock *func(r ApiDeleteServerRequest) error + // Deprecated: DeleteSnapshotExecuteMock can be populated to implement the behavior of the DeleteSnapshotExecute function of this mock + DeleteSnapshotExecuteMock *func(r ApiDeleteSnapshotRequest) error + // Deprecated: DeleteVolumeExecuteMock can be populated to implement the behavior of the DeleteVolumeExecute function of this mock + DeleteVolumeExecuteMock *func(r ApiDeleteVolumeRequest) error + // Deprecated: GetAffinityGroupExecuteMock can be populated to implement the behavior of the GetAffinityGroupExecute function of this mock + GetAffinityGroupExecuteMock *func(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) + // Deprecated: GetAttachedVolumeExecuteMock can be populated to implement the behavior of the GetAttachedVolumeExecute function of this mock + GetAttachedVolumeExecuteMock *func(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) + // Deprecated: GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*Backup, error) + // Deprecated: GetImageExecuteMock can be populated to implement the behavior of the GetImageExecute function of this mock + GetImageExecuteMock *func(r ApiGetImageRequest) (*Image, error) + // Deprecated: GetImageShareExecuteMock can be populated to implement the behavior of the GetImageShareExecute function of this mock + GetImageShareExecuteMock *func(r ApiGetImageShareRequest) (*ImageShare, error) + // Deprecated: GetImageShareConsumerExecuteMock can be populated to implement the behavior of the GetImageShareConsumerExecute function of this mock + GetImageShareConsumerExecuteMock *func(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) + // Deprecated: GetKeyPairExecuteMock can be populated to implement the behavior of the GetKeyPairExecute function of this mock + GetKeyPairExecuteMock *func(r ApiGetKeyPairRequest) (*Keypair, error) + // Deprecated: GetMachineTypeExecuteMock can be populated to implement the behavior of the GetMachineTypeExecute function of this mock + GetMachineTypeExecuteMock *func(r ApiGetMachineTypeRequest) (*MachineType, error) + // Deprecated: GetNetworkExecuteMock can be populated to implement the behavior of the GetNetworkExecute function of this mock + GetNetworkExecuteMock *func(r ApiGetNetworkRequest) (*Network, error) + // Deprecated: GetNetworkAreaExecuteMock can be populated to implement the behavior of the GetNetworkAreaExecute function of this mock + GetNetworkAreaExecuteMock *func(r ApiGetNetworkAreaRequest) (*NetworkArea, error) + // Deprecated: GetNetworkAreaRangeExecuteMock can be populated to implement the behavior of the GetNetworkAreaRangeExecute function of this mock + GetNetworkAreaRangeExecuteMock *func(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) + // Deprecated: GetNetworkAreaRouteExecuteMock can be populated to implement the behavior of the GetNetworkAreaRouteExecute function of this mock + GetNetworkAreaRouteExecuteMock *func(r ApiGetNetworkAreaRouteRequest) (*Route, error) + // Deprecated: GetNicExecuteMock can be populated to implement the behavior of the GetNicExecute function of this mock + GetNicExecuteMock *func(r ApiGetNicRequest) (*NIC, error) + // Deprecated: GetOrganizationRequestExecuteMock can be populated to implement the behavior of the GetOrganizationRequestExecute function of this mock + GetOrganizationRequestExecuteMock *func(r ApiGetOrganizationRequestRequest) (*Request, error) + // Deprecated: GetProjectDetailsExecuteMock can be populated to implement the behavior of the GetProjectDetailsExecute function of this mock + GetProjectDetailsExecuteMock *func(r ApiGetProjectDetailsRequest) (*Project, error) + // Deprecated: GetProjectNICExecuteMock can be populated to implement the behavior of the GetProjectNICExecute function of this mock + GetProjectNICExecuteMock *func(r ApiGetProjectNICRequest) (*NIC, error) + // Deprecated: GetProjectRequestExecuteMock can be populated to implement the behavior of the GetProjectRequestExecute function of this mock + GetProjectRequestExecuteMock *func(r ApiGetProjectRequestRequest) (*Request, error) + // Deprecated: GetPublicIPExecuteMock can be populated to implement the behavior of the GetPublicIPExecute function of this mock + GetPublicIPExecuteMock *func(r ApiGetPublicIPRequest) (*PublicIp, error) + // Deprecated: GetSecurityGroupExecuteMock can be populated to implement the behavior of the GetSecurityGroupExecute function of this mock + GetSecurityGroupExecuteMock *func(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) + // Deprecated: GetSecurityGroupRuleExecuteMock can be populated to implement the behavior of the GetSecurityGroupRuleExecute function of this mock + GetSecurityGroupRuleExecuteMock *func(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) + // Deprecated: GetServerExecuteMock can be populated to implement the behavior of the GetServerExecute function of this mock + GetServerExecuteMock *func(r ApiGetServerRequest) (*Server, error) + // Deprecated: GetServerConsoleExecuteMock can be populated to implement the behavior of the GetServerConsoleExecute function of this mock + GetServerConsoleExecuteMock *func(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) + // Deprecated: GetServerLogExecuteMock can be populated to implement the behavior of the GetServerLogExecute function of this mock + GetServerLogExecuteMock *func(r ApiGetServerLogRequest) (*GetServerLog200Response, error) + // Deprecated: GetSnapshotExecuteMock can be populated to implement the behavior of the GetSnapshotExecute function of this mock + GetSnapshotExecuteMock *func(r ApiGetSnapshotRequest) (*Snapshot, error) + // Deprecated: GetVolumeExecuteMock can be populated to implement the behavior of the GetVolumeExecute function of this mock + GetVolumeExecuteMock *func(r ApiGetVolumeRequest) (*Volume, error) + // Deprecated: GetVolumePerformanceClassExecuteMock can be populated to implement the behavior of the GetVolumePerformanceClassExecute function of this mock + GetVolumePerformanceClassExecuteMock *func(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) + // Deprecated: ListAffinityGroupsExecuteMock can be populated to implement the behavior of the ListAffinityGroupsExecute function of this mock + ListAffinityGroupsExecuteMock *func(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) + // Deprecated: ListAttachedVolumesExecuteMock can be populated to implement the behavior of the ListAttachedVolumesExecute function of this mock + ListAttachedVolumesExecuteMock *func(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) + // Deprecated: ListAvailabilityZonesExecuteMock can be populated to implement the behavior of the ListAvailabilityZonesExecute function of this mock + ListAvailabilityZonesExecuteMock *func(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) + // Deprecated: ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*BackupListResponse, error) + // Deprecated: ListImagesExecuteMock can be populated to implement the behavior of the ListImagesExecute function of this mock + ListImagesExecuteMock *func(r ApiListImagesRequest) (*ImageListResponse, error) + // Deprecated: ListKeyPairsExecuteMock can be populated to implement the behavior of the ListKeyPairsExecute function of this mock + ListKeyPairsExecuteMock *func(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) + // Deprecated: ListMachineTypesExecuteMock can be populated to implement the behavior of the ListMachineTypesExecute function of this mock + ListMachineTypesExecuteMock *func(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) + // Deprecated: ListNetworkAreaProjectsExecuteMock can be populated to implement the behavior of the ListNetworkAreaProjectsExecute function of this mock + ListNetworkAreaProjectsExecuteMock *func(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) + // Deprecated: ListNetworkAreaRangesExecuteMock can be populated to implement the behavior of the ListNetworkAreaRangesExecute function of this mock + ListNetworkAreaRangesExecuteMock *func(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) + // Deprecated: ListNetworkAreaRoutesExecuteMock can be populated to implement the behavior of the ListNetworkAreaRoutesExecute function of this mock + ListNetworkAreaRoutesExecuteMock *func(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) + // Deprecated: ListNetworkAreasExecuteMock can be populated to implement the behavior of the ListNetworkAreasExecute function of this mock + ListNetworkAreasExecuteMock *func(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) + // Deprecated: ListNetworksExecuteMock can be populated to implement the behavior of the ListNetworksExecute function of this mock + ListNetworksExecuteMock *func(r ApiListNetworksRequest) (*NetworkListResponse, error) + // Deprecated: ListNicsExecuteMock can be populated to implement the behavior of the ListNicsExecute function of this mock + ListNicsExecuteMock *func(r ApiListNicsRequest) (*NICListResponse, error) + // Deprecated: ListProjectNICsExecuteMock can be populated to implement the behavior of the ListProjectNICsExecute function of this mock + ListProjectNICsExecuteMock *func(r ApiListProjectNICsRequest) (*NICListResponse, error) + // Deprecated: ListPublicIPRangesExecuteMock can be populated to implement the behavior of the ListPublicIPRangesExecute function of this mock + ListPublicIPRangesExecuteMock *func(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) + // Deprecated: ListPublicIPsExecuteMock can be populated to implement the behavior of the ListPublicIPsExecute function of this mock + ListPublicIPsExecuteMock *func(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) + // Deprecated: ListQuotasExecuteMock can be populated to implement the behavior of the ListQuotasExecute function of this mock + ListQuotasExecuteMock *func(r ApiListQuotasRequest) (*QuotaListResponse, error) + // Deprecated: ListSecurityGroupRulesExecuteMock can be populated to implement the behavior of the ListSecurityGroupRulesExecute function of this mock + ListSecurityGroupRulesExecuteMock *func(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) + // Deprecated: ListSecurityGroupsExecuteMock can be populated to implement the behavior of the ListSecurityGroupsExecute function of this mock + ListSecurityGroupsExecuteMock *func(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) + // Deprecated: ListServerNicsExecuteMock can be populated to implement the behavior of the ListServerNicsExecute function of this mock + ListServerNicsExecuteMock *func(r ApiListServerNicsRequest) (*NICListResponse, error) + // Deprecated: ListServerServiceAccountsExecuteMock can be populated to implement the behavior of the ListServerServiceAccountsExecute function of this mock + ListServerServiceAccountsExecuteMock *func(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) + // Deprecated: ListServersExecuteMock can be populated to implement the behavior of the ListServersExecute function of this mock + ListServersExecuteMock *func(r ApiListServersRequest) (*ServerListResponse, error) + // Deprecated: ListSnapshotsExecuteMock can be populated to implement the behavior of the ListSnapshotsExecute function of this mock + ListSnapshotsExecuteMock *func(r ApiListSnapshotsRequest) (*SnapshotListResponse, error) + // Deprecated: ListVolumePerformanceClassesExecuteMock can be populated to implement the behavior of the ListVolumePerformanceClassesExecute function of this mock + ListVolumePerformanceClassesExecuteMock *func(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) + // Deprecated: ListVolumesExecuteMock can be populated to implement the behavior of the ListVolumesExecute function of this mock + ListVolumesExecuteMock *func(r ApiListVolumesRequest) (*VolumeListResponse, error) + // Deprecated: PartialUpdateNetworkExecuteMock can be populated to implement the behavior of the PartialUpdateNetworkExecute function of this mock + PartialUpdateNetworkExecuteMock *func(r ApiPartialUpdateNetworkRequest) error + // Deprecated: PartialUpdateNetworkAreaExecuteMock can be populated to implement the behavior of the PartialUpdateNetworkAreaExecute function of this mock + PartialUpdateNetworkAreaExecuteMock *func(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) + // Deprecated: RebootServerExecuteMock can be populated to implement the behavior of the RebootServerExecute function of this mock + RebootServerExecuteMock *func(r ApiRebootServerRequest) error + // Deprecated: RemoveNetworkFromServerExecuteMock can be populated to implement the behavior of the RemoveNetworkFromServerExecute function of this mock + RemoveNetworkFromServerExecuteMock *func(r ApiRemoveNetworkFromServerRequest) error + // Deprecated: RemoveNicFromServerExecuteMock can be populated to implement the behavior of the RemoveNicFromServerExecute function of this mock + RemoveNicFromServerExecuteMock *func(r ApiRemoveNicFromServerRequest) error + // Deprecated: RemovePublicIpFromServerExecuteMock can be populated to implement the behavior of the RemovePublicIpFromServerExecute function of this mock + RemovePublicIpFromServerExecuteMock *func(r ApiRemovePublicIpFromServerRequest) error + // Deprecated: RemoveSecurityGroupFromServerExecuteMock can be populated to implement the behavior of the RemoveSecurityGroupFromServerExecute function of this mock + RemoveSecurityGroupFromServerExecuteMock *func(r ApiRemoveSecurityGroupFromServerRequest) error + // Deprecated: RemoveServiceAccountFromServerExecuteMock can be populated to implement the behavior of the RemoveServiceAccountFromServerExecute function of this mock + RemoveServiceAccountFromServerExecuteMock *func(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) + // Deprecated: RemoveVolumeFromServerExecuteMock can be populated to implement the behavior of the RemoveVolumeFromServerExecute function of this mock + RemoveVolumeFromServerExecuteMock *func(r ApiRemoveVolumeFromServerRequest) error + // Deprecated: RescueServerExecuteMock can be populated to implement the behavior of the RescueServerExecute function of this mock + RescueServerExecuteMock *func(r ApiRescueServerRequest) error + // Deprecated: ResizeServerExecuteMock can be populated to implement the behavior of the ResizeServerExecute function of this mock + ResizeServerExecuteMock *func(r ApiResizeServerRequest) error + // Deprecated: ResizeVolumeExecuteMock can be populated to implement the behavior of the ResizeVolumeExecute function of this mock + ResizeVolumeExecuteMock *func(r ApiResizeVolumeRequest) error + // Deprecated: RestoreBackupExecuteMock can be populated to implement the behavior of the RestoreBackupExecute function of this mock + RestoreBackupExecuteMock *func(r ApiRestoreBackupRequest) error + // Deprecated: SetImageShareExecuteMock can be populated to implement the behavior of the SetImageShareExecute function of this mock + SetImageShareExecuteMock *func(r ApiSetImageShareRequest) (*ImageShare, error) + // Deprecated: StartServerExecuteMock can be populated to implement the behavior of the StartServerExecute function of this mock + StartServerExecuteMock *func(r ApiStartServerRequest) error + // Deprecated: StopServerExecuteMock can be populated to implement the behavior of the StopServerExecute function of this mock + StopServerExecuteMock *func(r ApiStopServerRequest) error + // Deprecated: UnrescueServerExecuteMock can be populated to implement the behavior of the UnrescueServerExecute function of this mock + UnrescueServerExecuteMock *func(r ApiUnrescueServerRequest) error + // Deprecated: UpdateAttachedVolumeExecuteMock can be populated to implement the behavior of the UpdateAttachedVolumeExecute function of this mock + UpdateAttachedVolumeExecuteMock *func(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) + // Deprecated: UpdateBackupExecuteMock can be populated to implement the behavior of the UpdateBackupExecute function of this mock + UpdateBackupExecuteMock *func(r ApiUpdateBackupRequest) (*Backup, error) + // Deprecated: UpdateImageExecuteMock can be populated to implement the behavior of the UpdateImageExecute function of this mock + UpdateImageExecuteMock *func(r ApiUpdateImageRequest) (*Image, error) + // Deprecated: UpdateImageScopeLocalExecuteMock can be populated to implement the behavior of the UpdateImageScopeLocalExecute function of this mock + UpdateImageScopeLocalExecuteMock *func(r ApiUpdateImageScopeLocalRequest) (*Image, error) + // Deprecated: UpdateImageScopePublicExecuteMock can be populated to implement the behavior of the UpdateImageScopePublicExecute function of this mock + UpdateImageScopePublicExecuteMock *func(r ApiUpdateImageScopePublicRequest) (*Image, error) + // Deprecated: UpdateImageShareExecuteMock can be populated to implement the behavior of the UpdateImageShareExecute function of this mock + UpdateImageShareExecuteMock *func(r ApiUpdateImageShareRequest) (*ImageShare, error) + // Deprecated: UpdateKeyPairExecuteMock can be populated to implement the behavior of the UpdateKeyPairExecute function of this mock + UpdateKeyPairExecuteMock *func(r ApiUpdateKeyPairRequest) (*Keypair, error) + // Deprecated: UpdateNetworkAreaRouteExecuteMock can be populated to implement the behavior of the UpdateNetworkAreaRouteExecute function of this mock + UpdateNetworkAreaRouteExecuteMock *func(r ApiUpdateNetworkAreaRouteRequest) (*Route, error) + // Deprecated: UpdateNicExecuteMock can be populated to implement the behavior of the UpdateNicExecute function of this mock + UpdateNicExecuteMock *func(r ApiUpdateNicRequest) (*NIC, error) + // Deprecated: UpdatePublicIPExecuteMock can be populated to implement the behavior of the UpdatePublicIPExecute function of this mock + UpdatePublicIPExecuteMock *func(r ApiUpdatePublicIPRequest) (*PublicIp, error) + // Deprecated: UpdateSecurityGroupExecuteMock can be populated to implement the behavior of the UpdateSecurityGroupExecute function of this mock + UpdateSecurityGroupExecuteMock *func(r ApiUpdateSecurityGroupRequest) (*SecurityGroup, error) + // Deprecated: UpdateServerExecuteMock can be populated to implement the behavior of the UpdateServerExecute function of this mock + UpdateServerExecuteMock *func(r ApiUpdateServerRequest) (*Server, error) + // Deprecated: UpdateSnapshotExecuteMock can be populated to implement the behavior of the UpdateSnapshotExecute function of this mock + UpdateSnapshotExecuteMock *func(r ApiUpdateSnapshotRequest) (*Snapshot, error) + // Deprecated: UpdateVolumeExecuteMock can be populated to implement the behavior of the UpdateVolumeExecute function of this mock + UpdateVolumeExecuteMock *func(r ApiUpdateVolumeRequest) (*Volume, error) +} + +// Deprecated +func (a DefaultAPIServiceMock) AddNetworkToServer(ctx context.Context, projectId string, serverId string, networkId string) ApiAddNetworkToServerRequest { + return ApiAddNetworkToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + networkId: networkId, + } +} + +// Deprecated: AddNetworkToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddNetworkToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error { + if a.AddNetworkToServerExecuteMock == nil { + return nil + } + + return (*a.AddNetworkToServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) AddNicToServer(ctx context.Context, projectId string, serverId string, nicId string) ApiAddNicToServerRequest { + return ApiAddNicToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + nicId: nicId, + } +} + +// Deprecated: AddNicToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddNicToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddNicToServerExecute(r ApiAddNicToServerRequest) error { + if a.AddNicToServerExecuteMock == nil { + return nil + } + + return (*a.AddNicToServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) AddPublicIpToServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest { + return ApiAddPublicIpToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// Deprecated: AddPublicIpToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddPublicIpToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error { + if a.AddPublicIpToServerExecuteMock == nil { + return nil + } + + return (*a.AddPublicIpToServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) AddSecurityGroupToServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest { + return ApiAddSecurityGroupToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// Deprecated: AddSecurityGroupToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddSecurityGroupToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error { + if a.AddSecurityGroupToServerExecuteMock == nil { + return nil + } + + return (*a.AddSecurityGroupToServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) AddServiceAccountToServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest { + return ApiAddServiceAccountToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// Deprecated: AddServiceAccountToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddServiceAccountToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) { + if a.AddServiceAccountToServerExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.AddServiceAccountToServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) AddVolumeToServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiAddVolumeToServerRequest { + return ApiAddVolumeToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +// Deprecated: AddVolumeToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddVolumeToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) { + if a.AddVolumeToServerExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.AddVolumeToServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateAffinityGroup(ctx context.Context, projectId string) ApiCreateAffinityGroupRequest { + return ApiCreateAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreateAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) { + if a.CreateAffinityGroupExecuteMock == nil { + var localVarReturnValue *AffinityGroup + return localVarReturnValue, nil + } + + return (*a.CreateAffinityGroupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateImage(ctx context.Context, projectId string) ApiCreateImageRequest { + return ApiCreateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreateImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) { + if a.CreateImageExecuteMock == nil { + var localVarReturnValue *ImageCreateResponse + return localVarReturnValue, nil + } + + return (*a.CreateImageExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return ApiCreateKeyPairRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Deprecated: CreateKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) { + if a.CreateKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.CreateKeyPairExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateNetwork(ctx context.Context, projectId string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { + if a.CreateNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.CreateNetworkExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { + return ApiCreateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Deprecated: CreateNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) { + if a.CreateNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRangeRequest { + return ApiCreateNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Deprecated: CreateNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) { + if a.CreateNetworkAreaRangeExecuteMock == nil { + var localVarReturnValue *NetworkRangeListResponse + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaRangeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string) ApiCreateNetworkAreaRouteRequest { + return ApiCreateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Deprecated: CreateNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) { + if a.CreateNetworkAreaRouteExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaRouteExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateNic(ctx context.Context, projectId string, networkId string) ApiCreateNicRequest { + return ApiCreateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Deprecated: CreateNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) { + if a.CreateNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.CreateNicExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreatePublicIP(ctx context.Context, projectId string) ApiCreatePublicIPRequest { + return ApiCreatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreatePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreatePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) { + if a.CreatePublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.CreatePublicIPExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateSecurityGroup(ctx context.Context, projectId string) ApiCreateSecurityGroupRequest { + return ApiCreateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreateSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) { + if a.CreateSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.CreateSecurityGroupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { + return ApiCreateSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Deprecated: CreateSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + if a.CreateSecurityGroupRuleExecuteMock == nil { + var localVarReturnValue *SecurityGroupRule + return localVarReturnValue, nil + } + + return (*a.CreateSecurityGroupRuleExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateServer(ctx context.Context, projectId string) ApiCreateServerRequest { + return ApiCreateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateServerExecute(r ApiCreateServerRequest) (*Server, error) { + if a.CreateServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.CreateServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateSnapshot(ctx context.Context, projectId string) ApiCreateSnapshotRequest { + return ApiCreateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreateSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateSnapshotExecute(r ApiCreateSnapshotRequest) (*Snapshot, error) { + if a.CreateSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.CreateSnapshotExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) CreateVolume(ctx context.Context, projectId string) ApiCreateVolumeRequest { + return ApiCreateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: CreateVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) { + if a.CreateVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.CreateVolumeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeallocateServer(ctx context.Context, projectId string, serverId string) ApiDeallocateServerRequest { + return ApiDeallocateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: DeallocateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeallocateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeallocateServerExecute(r ApiDeallocateServerRequest) error { + if a.DeallocateServerExecuteMock == nil { + return nil + } + + return (*a.DeallocateServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiDeleteAffinityGroupRequest { + return ApiDeleteAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + affinityGroupId: affinityGroupId, + } +} + +// Deprecated: DeleteAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error { + if a.DeleteAffinityGroupExecuteMock == nil { + return nil + } + + return (*a.DeleteAffinityGroupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteBackup(ctx context.Context, projectId string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +// Deprecated: DeleteBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + if a.DeleteBackupExecuteMock == nil { + return nil + } + + return (*a.DeleteBackupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteImage(ctx context.Context, projectId string, imageId string) ApiDeleteImageRequest { + return ApiDeleteImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: DeleteImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageExecute(r ApiDeleteImageRequest) error { + if a.DeleteImageExecuteMock == nil { + return nil + } + + return (*a.DeleteImageExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteImageShare(ctx context.Context, projectId string, imageId string) ApiDeleteImageShareRequest { + return ApiDeleteImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: DeleteImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageShareExecute(r ApiDeleteImageShareRequest) error { + if a.DeleteImageShareExecuteMock == nil { + return nil + } + + return (*a.DeleteImageShareExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { + return ApiDeleteImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// Deprecated: DeleteImageShareConsumerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageShareConsumerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error { + if a.DeleteImageShareConsumerExecuteMock == nil { + return nil + } + + return (*a.DeleteImageShareConsumerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Deprecated: DeleteKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error { + if a.DeleteKeyPairExecuteMock == nil { + return nil + } + + return (*a.DeleteKeyPairExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteNetwork(ctx context.Context, projectId string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Deprecated: DeleteNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { + if a.DeleteNetworkExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { + return ApiDeleteNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Deprecated: DeleteNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error { + if a.DeleteNetworkAreaExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { + return ApiDeleteNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + networkRangeId: networkRangeId, + } +} + +// Deprecated: DeleteNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error { + if a.DeleteNetworkAreaRangeExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaRangeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiDeleteNetworkAreaRouteRequest { + return ApiDeleteNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +// Deprecated: DeleteNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error { + if a.DeleteNetworkAreaRouteExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaRouteExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteNic(ctx context.Context, projectId string, networkId string, nicId string) ApiDeleteNicRequest { + return ApiDeleteNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } +} + +// Deprecated: DeleteNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNicExecute(r ApiDeleteNicRequest) error { + if a.DeleteNicExecuteMock == nil { + return nil + } + + return (*a.DeleteNicExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeletePublicIP(ctx context.Context, projectId string, publicIpId string) ApiDeletePublicIPRequest { + return ApiDeletePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, + } +} + +// Deprecated: DeletePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeletePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeletePublicIPExecute(r ApiDeletePublicIPRequest) error { + if a.DeletePublicIPExecuteMock == nil { + return nil + } + + return (*a.DeletePublicIPExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return ApiDeleteSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Deprecated: DeleteSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error { + if a.DeleteSecurityGroupExecuteMock == nil { + return nil + } + + return (*a.DeleteSecurityGroupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return ApiDeleteSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// Deprecated: DeleteSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error { + if a.DeleteSecurityGroupRuleExecuteMock == nil { + return nil + } + + return (*a.DeleteSecurityGroupRuleExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteServer(ctx context.Context, projectId string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: DeleteServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteServerExecute(r ApiDeleteServerRequest) error { + if a.DeleteServerExecuteMock == nil { + return nil + } + + return (*a.DeleteServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteSnapshot(ctx context.Context, projectId string, snapshotId string) ApiDeleteSnapshotRequest { + return ApiDeleteSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, + } +} + +// Deprecated: DeleteSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) error { + if a.DeleteSnapshotExecuteMock == nil { + return nil + } + + return (*a.DeleteSnapshotExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DeleteVolume(ctx context.Context, projectId string, volumeId string) ApiDeleteVolumeRequest { + return ApiDeleteVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +// Deprecated: DeleteVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteVolumeExecute(r ApiDeleteVolumeRequest) error { + if a.DeleteVolumeExecuteMock == nil { + return nil + } + + return (*a.DeleteVolumeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetAffinityGroup(ctx context.Context, projectId string, affinityGroupId string) ApiGetAffinityGroupRequest { + return ApiGetAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + affinityGroupId: affinityGroupId, + } +} + +// Deprecated: GetAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) { + if a.GetAffinityGroupExecuteMock == nil { + var localVarReturnValue *AffinityGroup + return localVarReturnValue, nil + } + + return (*a.GetAffinityGroupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return ApiGetAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +// Deprecated: GetAttachedVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetAttachedVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) { + if a.GetAttachedVolumeExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.GetAttachedVolumeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +// Deprecated: GetBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetImage(ctx context.Context, projectId string, imageId string) ApiGetImageRequest { + return ApiGetImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: GetImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageExecute(r ApiGetImageRequest) (*Image, error) { + if a.GetImageExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.GetImageExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetImageShare(ctx context.Context, projectId string, imageId string) ApiGetImageShareRequest { + return ApiGetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: GetImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) { + if a.GetImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.GetImageShareExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetImageShareConsumer(ctx context.Context, projectId string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { + return ApiGetImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// Deprecated: GetImageShareConsumerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageShareConsumerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) { + if a.GetImageShareConsumerExecuteMock == nil { + var localVarReturnValue *ImageShareConsumer + return localVarReturnValue, nil + } + + return (*a.GetImageShareConsumerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return ApiGetKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Deprecated: GetKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) { + if a.GetKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.GetKeyPairExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetMachineType(ctx context.Context, projectId string, machineType string) ApiGetMachineTypeRequest { + return ApiGetMachineTypeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + machineType: machineType, + } +} + +// Deprecated: GetMachineTypeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMachineTypeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) { + if a.GetMachineTypeExecuteMock == nil { + var localVarReturnValue *MachineType + return localVarReturnValue, nil + } + + return (*a.GetMachineTypeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetNetwork(ctx context.Context, projectId string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Deprecated: GetNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { + if a.GetNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.GetNetworkExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return ApiGetNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Deprecated: GetNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) { + if a.GetNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, networkRangeId string) ApiGetNetworkAreaRangeRequest { + return ApiGetNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + networkRangeId: networkRangeId, + } +} + +// Deprecated: GetNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) { + if a.GetNetworkAreaRangeExecuteMock == nil { + var localVarReturnValue *NetworkRange + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaRangeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiGetNetworkAreaRouteRequest { + return ApiGetNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +// Deprecated: GetNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) { + if a.GetNetworkAreaRouteExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaRouteExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetNic(ctx context.Context, projectId string, networkId string, nicId string) ApiGetNicRequest { + return ApiGetNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } +} + +// Deprecated: GetNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNicExecute(r ApiGetNicRequest) (*NIC, error) { + if a.GetNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.GetNicExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return ApiGetOrganizationRequestRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, + } +} + +// Deprecated: GetOrganizationRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetOrganizationRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) { + if a.GetOrganizationRequestExecuteMock == nil { + var localVarReturnValue *Request + return localVarReturnValue, nil + } + + return (*a.GetOrganizationRequestExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return ApiGetProjectDetailsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: GetProjectDetailsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectDetailsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) { + if a.GetProjectDetailsExecuteMock == nil { + var localVarReturnValue *Project + return localVarReturnValue, nil + } + + return (*a.GetProjectDetailsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetProjectNIC(ctx context.Context, projectId string, nicId string) ApiGetProjectNICRequest { + return ApiGetProjectNICRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + nicId: nicId, + } +} + +// Deprecated: GetProjectNICExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectNICExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) { + if a.GetProjectNICExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.GetProjectNICExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetProjectRequest(ctx context.Context, projectId string, requestId string) ApiGetProjectRequestRequest { + return ApiGetProjectRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + requestId: requestId, + } +} + +// Deprecated: GetProjectRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) { + if a.GetProjectRequestExecuteMock == nil { + var localVarReturnValue *Request + return localVarReturnValue, nil + } + + return (*a.GetProjectRequestExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetPublicIP(ctx context.Context, projectId string, publicIpId string) ApiGetPublicIPRequest { + return ApiGetPublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, + } +} + +// Deprecated: GetPublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetPublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) { + if a.GetPublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.GetPublicIPExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiGetSecurityGroupRequest { + return ApiGetSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Deprecated: GetSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) { + if a.GetSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.GetSecurityGroupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetSecurityGroupRule(ctx context.Context, projectId string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return ApiGetSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// Deprecated: GetSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + if a.GetSecurityGroupRuleExecuteMock == nil { + var localVarReturnValue *SecurityGroupRule + return localVarReturnValue, nil + } + + return (*a.GetSecurityGroupRuleExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetServer(ctx context.Context, projectId string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: GetServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerExecute(r ApiGetServerRequest) (*Server, error) { + if a.GetServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.GetServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetServerConsole(ctx context.Context, projectId string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: GetServerConsoleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerConsoleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) { + if a.GetServerConsoleExecuteMock == nil { + var localVarReturnValue *ServerConsoleUrl + return localVarReturnValue, nil + } + + return (*a.GetServerConsoleExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetServerLog(ctx context.Context, projectId string, serverId string) ApiGetServerLogRequest { + return ApiGetServerLogRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: GetServerLogExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerLogExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) { + if a.GetServerLogExecuteMock == nil { + var localVarReturnValue *GetServerLog200Response + return localVarReturnValue, nil + } + + return (*a.GetServerLogExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetSnapshot(ctx context.Context, projectId string, snapshotId string) ApiGetSnapshotRequest { + return ApiGetSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, + } +} + +// Deprecated: GetSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Snapshot, error) { + if a.GetSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.GetSnapshotExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetVolume(ctx context.Context, projectId string, volumeId string) ApiGetVolumeRequest { + return ApiGetVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +// Deprecated: GetVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) { + if a.GetVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.GetVolumeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) GetVolumePerformanceClass(ctx context.Context, projectId string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return ApiGetVolumePerformanceClassRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumePerformanceClass: volumePerformanceClass, + } +} + +// Deprecated: GetVolumePerformanceClassExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVolumePerformanceClassExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) { + if a.GetVolumePerformanceClassExecuteMock == nil { + var localVarReturnValue *VolumePerformanceClass + return localVarReturnValue, nil + } + + return (*a.GetVolumePerformanceClassExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListAffinityGroups(ctx context.Context, projectId string) ApiListAffinityGroupsRequest { + return ApiListAffinityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListAffinityGroupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAffinityGroupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) { + if a.ListAffinityGroupsExecuteMock == nil { + var localVarReturnValue *AffinityGroupListResponse + return localVarReturnValue, nil + } + + return (*a.ListAffinityGroupsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListAttachedVolumes(ctx context.Context, projectId string, serverId string) ApiListAttachedVolumesRequest { + return ApiListAttachedVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: ListAttachedVolumesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAttachedVolumesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) { + if a.ListAttachedVolumesExecuteMock == nil { + var localVarReturnValue *VolumeAttachmentListResponse + return localVarReturnValue, nil + } + + return (*a.ListAttachedVolumesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListAvailabilityZones(ctx context.Context) ApiListAvailabilityZonesRequest { + return ApiListAvailabilityZonesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Deprecated: ListAvailabilityZonesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAvailabilityZonesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) { + if a.ListAvailabilityZonesExecuteMock == nil { + var localVarReturnValue *AvailabilityZoneListResponse + return localVarReturnValue, nil + } + + return (*a.ListAvailabilityZonesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *BackupListResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListImages(ctx context.Context, projectId string) ApiListImagesRequest { + return ApiListImagesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListImagesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListImagesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) { + if a.ListImagesExecuteMock == nil { + var localVarReturnValue *ImageListResponse + return localVarReturnValue, nil + } + + return (*a.ListImagesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ApiListKeyPairsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Deprecated: ListKeyPairsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListKeyPairsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) { + if a.ListKeyPairsExecuteMock == nil { + var localVarReturnValue *KeyPairListResponse + return localVarReturnValue, nil + } + + return (*a.ListKeyPairsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListMachineTypes(ctx context.Context, projectId string) ApiListMachineTypesRequest { + return ApiListMachineTypesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListMachineTypesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListMachineTypesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) { + if a.ListMachineTypesExecuteMock == nil { + var localVarReturnValue *MachineTypeListResponse + return localVarReturnValue, nil + } + + return (*a.ListMachineTypesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ApiListNetworkAreaProjectsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Deprecated: ListNetworkAreaProjectsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaProjectsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) { + if a.ListNetworkAreaProjectsExecuteMock == nil { + var localVarReturnValue *ProjectListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaProjectsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRangesRequest { + return ApiListNetworkAreaRangesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Deprecated: ListNetworkAreaRangesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaRangesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) { + if a.ListNetworkAreaRangesExecuteMock == nil { + var localVarReturnValue *NetworkRangeListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaRangesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRoutesRequest { + return ApiListNetworkAreaRoutesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Deprecated: ListNetworkAreaRoutesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaRoutesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) { + if a.ListNetworkAreaRoutesExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaRoutesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ApiListNetworkAreasRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Deprecated: ListNetworkAreasExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreasExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) { + if a.ListNetworkAreasExecuteMock == nil { + var localVarReturnValue *NetworkAreaListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreasExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListNetworks(ctx context.Context, projectId string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListNetworksExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworksExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { + if a.ListNetworksExecuteMock == nil { + var localVarReturnValue *NetworkListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworksExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListNics(ctx context.Context, projectId string, networkId string) ApiListNicsRequest { + return ApiListNicsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Deprecated: ListNicsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNicsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) { + if a.ListNicsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListNicsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListProjectNICs(ctx context.Context, projectId string) ApiListProjectNICsRequest { + return ApiListProjectNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListProjectNICsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListProjectNICsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) { + if a.ListProjectNICsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListProjectNICsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ApiListPublicIPRangesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Deprecated: ListPublicIPRangesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListPublicIPRangesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) { + if a.ListPublicIPRangesExecuteMock == nil { + var localVarReturnValue *PublicNetworkListResponse + return localVarReturnValue, nil + } + + return (*a.ListPublicIPRangesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListPublicIPs(ctx context.Context, projectId string) ApiListPublicIPsRequest { + return ApiListPublicIPsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListPublicIPsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListPublicIPsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) { + if a.ListPublicIPsExecuteMock == nil { + var localVarReturnValue *PublicIpListResponse + return localVarReturnValue, nil + } + + return (*a.ListPublicIPsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListQuotas(ctx context.Context, projectId string) ApiListQuotasRequest { + return ApiListQuotasRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListQuotasExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListQuotasExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) { + if a.ListQuotasExecuteMock == nil { + var localVarReturnValue *QuotaListResponse + return localVarReturnValue, nil + } + + return (*a.ListQuotasExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListSecurityGroupRules(ctx context.Context, projectId string, securityGroupId string) ApiListSecurityGroupRulesRequest { + return ApiListSecurityGroupRulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Deprecated: ListSecurityGroupRulesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSecurityGroupRulesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) { + if a.ListSecurityGroupRulesExecuteMock == nil { + var localVarReturnValue *SecurityGroupRuleListResponse + return localVarReturnValue, nil + } + + return (*a.ListSecurityGroupRulesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListSecurityGroups(ctx context.Context, projectId string) ApiListSecurityGroupsRequest { + return ApiListSecurityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListSecurityGroupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSecurityGroupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) { + if a.ListSecurityGroupsExecuteMock == nil { + var localVarReturnValue *SecurityGroupListResponse + return localVarReturnValue, nil + } + + return (*a.ListSecurityGroupsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListServerNics(ctx context.Context, projectId string, serverId string) ApiListServerNicsRequest { + return ApiListServerNicsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: ListServerNicsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServerNicsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServerNicsExecute(r ApiListServerNicsRequest) (*NICListResponse, error) { + if a.ListServerNicsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListServerNicsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListServerServiceAccounts(ctx context.Context, projectId string, serverId string) ApiListServerServiceAccountsRequest { + return ApiListServerServiceAccountsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: ListServerServiceAccountsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServerServiceAccountsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) { + if a.ListServerServiceAccountsExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.ListServerServiceAccountsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListServers(ctx context.Context, projectId string) ApiListServersRequest { + return ApiListServersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListServersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) { + if a.ListServersExecuteMock == nil { + var localVarReturnValue *ServerListResponse + return localVarReturnValue, nil + } + + return (*a.ListServersExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListSnapshots(ctx context.Context, projectId string) ApiListSnapshotsRequest { + return ApiListSnapshotsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListSnapshotsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSnapshotsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSnapshotsExecute(r ApiListSnapshotsRequest) (*SnapshotListResponse, error) { + if a.ListSnapshotsExecuteMock == nil { + var localVarReturnValue *SnapshotListResponse + return localVarReturnValue, nil + } + + return (*a.ListSnapshotsExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListVolumePerformanceClasses(ctx context.Context, projectId string) ApiListVolumePerformanceClassesRequest { + return ApiListVolumePerformanceClassesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListVolumePerformanceClassesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVolumePerformanceClassesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) { + if a.ListVolumePerformanceClassesExecuteMock == nil { + var localVarReturnValue *VolumePerformanceClassListResponse + return localVarReturnValue, nil + } + + return (*a.ListVolumePerformanceClassesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ListVolumes(ctx context.Context, projectId string) ApiListVolumesRequest { + return ApiListVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: ListVolumesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVolumesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) { + if a.ListVolumesExecuteMock == nil { + var localVarReturnValue *VolumeListResponse + return localVarReturnValue, nil + } + + return (*a.ListVolumesExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) PartialUpdateNetwork(ctx context.Context, projectId string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + } +} + +// Deprecated: PartialUpdateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { + if a.PartialUpdateNetworkExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateNetworkExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest { + return ApiPartialUpdateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Deprecated: PartialUpdateNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) { + if a.PartialUpdateNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.PartialUpdateNetworkAreaExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RebootServer(ctx context.Context, projectId string, serverId string) ApiRebootServerRequest { + return ApiRebootServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: RebootServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RebootServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RebootServerExecute(r ApiRebootServerRequest) error { + if a.RebootServerExecuteMock == nil { + return nil + } + + return (*a.RebootServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RemoveNetworkFromServer(ctx context.Context, projectId string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { + return ApiRemoveNetworkFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + networkId: networkId, + } +} + +// Deprecated: RemoveNetworkFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveNetworkFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error { + if a.RemoveNetworkFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveNetworkFromServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RemoveNicFromServer(ctx context.Context, projectId string, serverId string, nicId string) ApiRemoveNicFromServerRequest { + return ApiRemoveNicFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + nicId: nicId, + } +} + +// Deprecated: RemoveNicFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveNicFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error { + if a.RemoveNicFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveNicFromServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RemovePublicIpFromServer(ctx context.Context, projectId string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { + return ApiRemovePublicIpFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// Deprecated: RemovePublicIpFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemovePublicIpFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error { + if a.RemovePublicIpFromServerExecuteMock == nil { + return nil + } + + return (*a.RemovePublicIpFromServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { + return ApiRemoveSecurityGroupFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// Deprecated: RemoveSecurityGroupFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveSecurityGroupFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error { + if a.RemoveSecurityGroupFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveSecurityGroupFromServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RemoveServiceAccountFromServer(ctx context.Context, projectId string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { + return ApiRemoveServiceAccountFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// Deprecated: RemoveServiceAccountFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveServiceAccountFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) { + if a.RemoveServiceAccountFromServerExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.RemoveServiceAccountFromServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RemoveVolumeFromServer(ctx context.Context, projectId string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { + return ApiRemoveVolumeFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +// Deprecated: RemoveVolumeFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveVolumeFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error { + if a.RemoveVolumeFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveVolumeFromServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RescueServer(ctx context.Context, projectId string, serverId string) ApiRescueServerRequest { + return ApiRescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: RescueServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RescueServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RescueServerExecute(r ApiRescueServerRequest) error { + if a.RescueServerExecuteMock == nil { + return nil + } + + return (*a.RescueServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ResizeServer(ctx context.Context, projectId string, serverId string) ApiResizeServerRequest { + return ApiResizeServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: ResizeServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResizeServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResizeServerExecute(r ApiResizeServerRequest) error { + if a.ResizeServerExecuteMock == nil { + return nil + } + + return (*a.ResizeServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) ResizeVolume(ctx context.Context, projectId string, volumeId string) ApiResizeVolumeRequest { + return ApiResizeVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +// Deprecated: ResizeVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResizeVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResizeVolumeExecute(r ApiResizeVolumeRequest) error { + if a.ResizeVolumeExecuteMock == nil { + return nil + } + + return (*a.ResizeVolumeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) RestoreBackup(ctx context.Context, projectId string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +// Deprecated: RestoreBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + if a.RestoreBackupExecuteMock == nil { + return nil + } + + return (*a.RestoreBackupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) SetImageShare(ctx context.Context, projectId string, imageId string) ApiSetImageShareRequest { + return ApiSetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: SetImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the SetImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) { + if a.SetImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.SetImageShareExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) StartServer(ctx context.Context, projectId string, serverId string) ApiStartServerRequest { + return ApiStartServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: StartServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the StartServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) StartServerExecute(r ApiStartServerRequest) error { + if a.StartServerExecuteMock == nil { + return nil + } + + return (*a.StartServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) StopServer(ctx context.Context, projectId string, serverId string) ApiStopServerRequest { + return ApiStopServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: StopServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the StopServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) StopServerExecute(r ApiStopServerRequest) error { + if a.StopServerExecuteMock == nil { + return nil + } + + return (*a.StopServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UnrescueServer(ctx context.Context, projectId string, serverId string) ApiUnrescueServerRequest { + return ApiUnrescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: UnrescueServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UnrescueServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UnrescueServerExecute(r ApiUnrescueServerRequest) error { + if a.UnrescueServerExecuteMock == nil { + return nil + } + + return (*a.UnrescueServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateAttachedVolume(ctx context.Context, projectId string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { + return ApiUpdateAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + volumeId: volumeId, + } +} + +// Deprecated: UpdateAttachedVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateAttachedVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) { + if a.UpdateAttachedVolumeExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.UpdateAttachedVolumeExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateBackup(ctx context.Context, projectId string, backupId string) ApiUpdateBackupRequest { + return ApiUpdateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + backupId: backupId, + } +} + +// Deprecated: UpdateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupExecute(r ApiUpdateBackupRequest) (*Backup, error) { + if a.UpdateBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.UpdateBackupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateImage(ctx context.Context, projectId string, imageId string) ApiUpdateImageRequest { + return ApiUpdateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: UpdateImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) { + if a.UpdateImageExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.UpdateImageExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateImageScopeLocal(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopeLocalRequest { + return ApiUpdateImageScopeLocalRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: UpdateImageScopeLocalExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateImageScopeLocalExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateImageScopeLocalExecute(r ApiUpdateImageScopeLocalRequest) (*Image, error) { + if a.UpdateImageScopeLocalExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.UpdateImageScopeLocalExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateImageScopePublic(ctx context.Context, projectId string, imageId string) ApiUpdateImageScopePublicRequest { + return ApiUpdateImageScopePublicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: UpdateImageScopePublicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateImageScopePublicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateImageScopePublicExecute(r ApiUpdateImageScopePublicRequest) (*Image, error) { + if a.UpdateImageScopePublicExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.UpdateImageScopePublicExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateImageShare(ctx context.Context, projectId string, imageId string) ApiUpdateImageShareRequest { + return ApiUpdateImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + imageId: imageId, + } +} + +// Deprecated: UpdateImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) { + if a.UpdateImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.UpdateImageShareExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { + return ApiUpdateKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Deprecated: UpdateKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) { + if a.UpdateKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.UpdateKeyPairExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, routeId string) ApiUpdateNetworkAreaRouteRequest { + return ApiUpdateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + routeId: routeId, + } +} + +// Deprecated: UpdateNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateNetworkAreaRouteExecute(r ApiUpdateNetworkAreaRouteRequest) (*Route, error) { + if a.UpdateNetworkAreaRouteExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.UpdateNetworkAreaRouteExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateNic(ctx context.Context, projectId string, networkId string, nicId string) ApiUpdateNicRequest { + return ApiUpdateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + networkId: networkId, + nicId: nicId, + } +} + +// Deprecated: UpdateNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) { + if a.UpdateNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.UpdateNicExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdatePublicIP(ctx context.Context, projectId string, publicIpId string) ApiUpdatePublicIPRequest { + return ApiUpdatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + publicIpId: publicIpId, + } +} + +// Deprecated: UpdatePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdatePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) { + if a.UpdatePublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.UpdatePublicIPExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateSecurityGroup(ctx context.Context, projectId string, securityGroupId string) ApiUpdateSecurityGroupRequest { + return ApiUpdateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + securityGroupId: securityGroupId, + } +} + +// Deprecated: UpdateSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateSecurityGroupExecute(r ApiUpdateSecurityGroupRequest) (*SecurityGroup, error) { + if a.UpdateSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.UpdateSecurityGroupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateServer(ctx context.Context, projectId string, serverId string) ApiUpdateServerRequest { + return ApiUpdateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: UpdateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) { + if a.UpdateServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.UpdateServerExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateSnapshot(ctx context.Context, projectId string, snapshotId string) ApiUpdateSnapshotRequest { + return ApiUpdateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + snapshotId: snapshotId, + } +} + +// Deprecated: UpdateSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateSnapshotExecute(r ApiUpdateSnapshotRequest) (*Snapshot, error) { + if a.UpdateSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.UpdateSnapshotExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) UpdateVolume(ctx context.Context, projectId string, volumeId string) ApiUpdateVolumeRequest { + return ApiUpdateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + } +} + +// Deprecated: UpdateVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) { + if a.UpdateVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.UpdateVolumeExecuteMock)(r) +} diff --git a/services/iaas/v1api/client.go b/services/iaas/v1api/client.go new file mode 100644 index 000000000..3275c1901 --- /dev/null +++ b/services/iaas/v1api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT IaaS API API v1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/iaas/v1api/configuration.go b/services/iaas/v1api/configuration.go new file mode 100644 index 000000000..212ea9fbe --- /dev/null +++ b/services/iaas/v1api/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/iaas", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://iaas.api.{region}stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/iaas/v1api/model_add_volume_to_server_payload.go b/services/iaas/v1api/model_add_volume_to_server_payload.go new file mode 100644 index 000000000..36c870020 --- /dev/null +++ b/services/iaas/v1api/model_add_volume_to_server_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the AddVolumeToServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddVolumeToServerPayload{} + +// AddVolumeToServerPayload Object that represents a Volume attachment to a server. +type AddVolumeToServerPayload struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewAddVolumeToServerPayload instantiates a new AddVolumeToServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddVolumeToServerPayload() *AddVolumeToServerPayload { + this := AddVolumeToServerPayload{} + return &this +} + +// NewAddVolumeToServerPayloadWithDefaults instantiates a new AddVolumeToServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddVolumeToServerPayloadWithDefaults() *AddVolumeToServerPayload { + this := AddVolumeToServerPayload{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *AddVolumeToServerPayload) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *AddVolumeToServerPayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *AddVolumeToServerPayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o AddVolumeToServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddVolumeToServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableAddVolumeToServerPayload struct { + value *AddVolumeToServerPayload + isSet bool +} + +func (v NullableAddVolumeToServerPayload) Get() *AddVolumeToServerPayload { + return v.value +} + +func (v *NullableAddVolumeToServerPayload) Set(val *AddVolumeToServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddVolumeToServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddVolumeToServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddVolumeToServerPayload(val *AddVolumeToServerPayload) *NullableAddVolumeToServerPayload { + return &NullableAddVolumeToServerPayload{value: val, isSet: true} +} + +func (v NullableAddVolumeToServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddVolumeToServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_affinity_group.go b/services/iaas/v1api/model_affinity_group.go new file mode 100644 index 000000000..28366f390 --- /dev/null +++ b/services/iaas/v1api/model_affinity_group.go @@ -0,0 +1,261 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AffinityGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AffinityGroup{} + +// AffinityGroup Definition of an affinity group. +type AffinityGroup struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The servers that are part of the affinity group. + Members []string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. + Policy string `json:"policy"` +} + +type _AffinityGroup AffinityGroup + +// NewAffinityGroup instantiates a new AffinityGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAffinityGroup(name string, policy string) *AffinityGroup { + this := AffinityGroup{} + this.Name = name + this.Policy = policy + return &this +} + +// NewAffinityGroupWithDefaults instantiates a new AffinityGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAffinityGroupWithDefaults() *AffinityGroup { + this := AffinityGroup{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AffinityGroup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AffinityGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AffinityGroup) SetId(v string) { + o.Id = &v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *AffinityGroup) GetMembers() []string { + if o == nil || IsNil(o.Members) { + var ret []string + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetMembersOk() ([]string, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *AffinityGroup) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []string and assigns it to the Members field. +func (o *AffinityGroup) SetMembers(v []string) { + o.Members = v +} + +// GetName returns the Name field value +func (o *AffinityGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AffinityGroup) SetName(v string) { + o.Name = v +} + +// GetPolicy returns the Policy field value +func (o *AffinityGroup) GetPolicy() string { + if o == nil { + var ret string + return ret + } + + return o.Policy +} + +// GetPolicyOk returns a tuple with the Policy field value +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Policy, true +} + +// SetPolicy sets field value +func (o *AffinityGroup) SetPolicy(v string) { + o.Policy = v +} + +func (o AffinityGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AffinityGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + toSerialize["name"] = o.Name + toSerialize["policy"] = o.Policy + return toSerialize, nil +} + +func (o *AffinityGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "policy", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAffinityGroup := _AffinityGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAffinityGroup) + + if err != nil { + return err + } + + *o = AffinityGroup(varAffinityGroup) + + return err +} + +type NullableAffinityGroup struct { + value *AffinityGroup + isSet bool +} + +func (v NullableAffinityGroup) Get() *AffinityGroup { + return v.value +} + +func (v *NullableAffinityGroup) Set(val *AffinityGroup) { + v.value = val + v.isSet = true +} + +func (v NullableAffinityGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableAffinityGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAffinityGroup(val *AffinityGroup) *NullableAffinityGroup { + return &NullableAffinityGroup{value: val, isSet: true} +} + +func (v NullableAffinityGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAffinityGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_affinity_group_list_response.go b/services/iaas/v1api/model_affinity_group_list_response.go new file mode 100644 index 000000000..a03fd3d5f --- /dev/null +++ b/services/iaas/v1api/model_affinity_group_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AffinityGroupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AffinityGroupListResponse{} + +// AffinityGroupListResponse Response object for affinity group list request. +type AffinityGroupListResponse struct { + // A list of affinity groups. + Items []AffinityGroup `json:"items"` +} + +type _AffinityGroupListResponse AffinityGroupListResponse + +// NewAffinityGroupListResponse instantiates a new AffinityGroupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAffinityGroupListResponse(items []AffinityGroup) *AffinityGroupListResponse { + this := AffinityGroupListResponse{} + this.Items = items + return &this +} + +// NewAffinityGroupListResponseWithDefaults instantiates a new AffinityGroupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAffinityGroupListResponseWithDefaults() *AffinityGroupListResponse { + this := AffinityGroupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AffinityGroupListResponse) GetItems() []AffinityGroup { + if o == nil { + var ret []AffinityGroup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AffinityGroupListResponse) GetItemsOk() ([]AffinityGroup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AffinityGroupListResponse) SetItems(v []AffinityGroup) { + o.Items = v +} + +func (o AffinityGroupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AffinityGroupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AffinityGroupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAffinityGroupListResponse := _AffinityGroupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAffinityGroupListResponse) + + if err != nil { + return err + } + + *o = AffinityGroupListResponse(varAffinityGroupListResponse) + + return err +} + +type NullableAffinityGroupListResponse struct { + value *AffinityGroupListResponse + isSet bool +} + +func (v NullableAffinityGroupListResponse) Get() *AffinityGroupListResponse { + return v.value +} + +func (v *NullableAffinityGroupListResponse) Set(val *AffinityGroupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAffinityGroupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAffinityGroupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAffinityGroupListResponse(val *AffinityGroupListResponse) *NullableAffinityGroupListResponse { + return &NullableAffinityGroupListResponse{value: val, isSet: true} +} + +func (v NullableAffinityGroupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAffinityGroupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_allowed_addresses_inner.go b/services/iaas/v1api/model_allowed_addresses_inner.go new file mode 100644 index 000000000..34b51e441 --- /dev/null +++ b/services/iaas/v1api/model_allowed_addresses_inner.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// AllowedAddressesInner - struct for AllowedAddressesInner +type AllowedAddressesInner struct { + String *string +} + +// stringAsAllowedAddressesInner is a convenience function that returns string wrapped in AllowedAddressesInner +func StringAsAllowedAddressesInner(v *string) AllowedAddressesInner { + return AllowedAddressesInner{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *AllowedAddressesInner) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(AllowedAddressesInner)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(AllowedAddressesInner)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src AllowedAddressesInner) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *AllowedAddressesInner) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj AllowedAddressesInner) GetActualInstanceValue() interface{} { + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableAllowedAddressesInner struct { + value *AllowedAddressesInner + isSet bool +} + +func (v NullableAllowedAddressesInner) Get() *AllowedAddressesInner { + return v.value +} + +func (v *NullableAllowedAddressesInner) Set(val *AllowedAddressesInner) { + v.value = val + v.isSet = true +} + +func (v NullableAllowedAddressesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableAllowedAddressesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAllowedAddressesInner(val *AllowedAddressesInner) *NullableAllowedAddressesInner { + return &NullableAllowedAddressesInner{value: val, isSet: true} +} + +func (v NullableAllowedAddressesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAllowedAddressesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_area.go b/services/iaas/v1api/model_area.go new file mode 100644 index 000000000..9f4159391 --- /dev/null +++ b/services/iaas/v1api/model_area.go @@ -0,0 +1,237 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the Area type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Area{} + +// Area The basic properties of a network area. +type Area struct { + // A list containing DNS Servers/Nameservers for IPv4. + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // A list of network ranges. + NetworkRanges []NetworkRange `json:"networkRanges,omitempty"` + // A list of routes. + Routes []Route `json:"routes,omitempty"` + // Classless Inter-Domain Routing (CIDR). + TransferNetwork *string `json:"transferNetwork,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +// NewArea instantiates a new Area object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewArea() *Area { + this := Area{} + return &this +} + +// NewAreaWithDefaults instantiates a new Area object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAreaWithDefaults() *Area { + this := Area{} + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *Area) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Area) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *Area) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *Area) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetNetworkRanges returns the NetworkRanges field value if set, zero value otherwise. +func (o *Area) GetNetworkRanges() []NetworkRange { + if o == nil || IsNil(o.NetworkRanges) { + var ret []NetworkRange + return ret + } + return o.NetworkRanges +} + +// GetNetworkRangesOk returns a tuple with the NetworkRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Area) GetNetworkRangesOk() ([]NetworkRange, bool) { + if o == nil || IsNil(o.NetworkRanges) { + return nil, false + } + return o.NetworkRanges, true +} + +// HasNetworkRanges returns a boolean if a field has been set. +func (o *Area) HasNetworkRanges() bool { + if o != nil && !IsNil(o.NetworkRanges) { + return true + } + + return false +} + +// SetNetworkRanges gets a reference to the given []NetworkRange and assigns it to the NetworkRanges field. +func (o *Area) SetNetworkRanges(v []NetworkRange) { + o.NetworkRanges = v +} + +// GetRoutes returns the Routes field value if set, zero value otherwise. +func (o *Area) GetRoutes() []Route { + if o == nil || IsNil(o.Routes) { + var ret []Route + return ret + } + return o.Routes +} + +// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Area) GetRoutesOk() ([]Route, bool) { + if o == nil || IsNil(o.Routes) { + return nil, false + } + return o.Routes, true +} + +// HasRoutes returns a boolean if a field has been set. +func (o *Area) HasRoutes() bool { + if o != nil && !IsNil(o.Routes) { + return true + } + + return false +} + +// SetRoutes gets a reference to the given []Route and assigns it to the Routes field. +func (o *Area) SetRoutes(v []Route) { + o.Routes = v +} + +// GetTransferNetwork returns the TransferNetwork field value if set, zero value otherwise. +func (o *Area) GetTransferNetwork() string { + if o == nil || IsNil(o.TransferNetwork) { + var ret string + return ret + } + return *o.TransferNetwork +} + +// GetTransferNetworkOk returns a tuple with the TransferNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Area) GetTransferNetworkOk() (*string, bool) { + if o == nil || IsNil(o.TransferNetwork) { + return nil, false + } + return o.TransferNetwork, true +} + +// HasTransferNetwork returns a boolean if a field has been set. +func (o *Area) HasTransferNetwork() bool { + if o != nil && !IsNil(o.TransferNetwork) { + return true + } + + return false +} + +// SetTransferNetwork gets a reference to the given string and assigns it to the TransferNetwork field. +func (o *Area) SetTransferNetwork(v string) { + o.TransferNetwork = &v +} + +func (o Area) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Area) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + if !IsNil(o.NetworkRanges) { + toSerialize["networkRanges"] = o.NetworkRanges + } + if !IsNil(o.Routes) { + toSerialize["routes"] = o.Routes + } + if !IsNil(o.TransferNetwork) { + toSerialize["transferNetwork"] = o.TransferNetwork + } + return toSerialize, nil +} + +type NullableArea struct { + value *Area + isSet bool +} + +func (v NullableArea) Get() *Area { + return v.value +} + +func (v *NullableArea) Set(val *Area) { + v.value = val + v.isSet = true +} + +func (v NullableArea) IsSet() bool { + return v.isSet +} + +func (v *NullableArea) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableArea(val *Area) *NullableArea { + return &NullableArea{value: val, isSet: true} +} + +func (v NullableArea) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableArea) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_area_config.go b/services/iaas/v1api/model_area_config.go new file mode 100644 index 000000000..03bc9aebc --- /dev/null +++ b/services/iaas/v1api/model_area_config.go @@ -0,0 +1,260 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AreaConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AreaConfig{} + +// AreaConfig The basic network area object. +type AreaConfig struct { + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // A list of network ranges. + NetworkRanges []NetworkRange `json:"networkRanges"` + // A list of routes. + Routes []Route `json:"routes,omitempty"` + // Classless Inter-Domain Routing (CIDR). + TransferNetwork string `json:"transferNetwork" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +type _AreaConfig AreaConfig + +// NewAreaConfig instantiates a new AreaConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAreaConfig(networkRanges []NetworkRange, transferNetwork string) *AreaConfig { + this := AreaConfig{} + this.NetworkRanges = networkRanges + this.TransferNetwork = transferNetwork + return &this +} + +// NewAreaConfigWithDefaults instantiates a new AreaConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAreaConfigWithDefaults() *AreaConfig { + this := AreaConfig{} + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *AreaConfig) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AreaConfig) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *AreaConfig) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *AreaConfig) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetNetworkRanges returns the NetworkRanges field value +func (o *AreaConfig) GetNetworkRanges() []NetworkRange { + if o == nil { + var ret []NetworkRange + return ret + } + + return o.NetworkRanges +} + +// GetNetworkRangesOk returns a tuple with the NetworkRanges field value +// and a boolean to check if the value has been set. +func (o *AreaConfig) GetNetworkRangesOk() ([]NetworkRange, bool) { + if o == nil { + return nil, false + } + return o.NetworkRanges, true +} + +// SetNetworkRanges sets field value +func (o *AreaConfig) SetNetworkRanges(v []NetworkRange) { + o.NetworkRanges = v +} + +// GetRoutes returns the Routes field value if set, zero value otherwise. +func (o *AreaConfig) GetRoutes() []Route { + if o == nil || IsNil(o.Routes) { + var ret []Route + return ret + } + return o.Routes +} + +// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AreaConfig) GetRoutesOk() ([]Route, bool) { + if o == nil || IsNil(o.Routes) { + return nil, false + } + return o.Routes, true +} + +// HasRoutes returns a boolean if a field has been set. +func (o *AreaConfig) HasRoutes() bool { + if o != nil && !IsNil(o.Routes) { + return true + } + + return false +} + +// SetRoutes gets a reference to the given []Route and assigns it to the Routes field. +func (o *AreaConfig) SetRoutes(v []Route) { + o.Routes = v +} + +// GetTransferNetwork returns the TransferNetwork field value +func (o *AreaConfig) GetTransferNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.TransferNetwork +} + +// GetTransferNetworkOk returns a tuple with the TransferNetwork field value +// and a boolean to check if the value has been set. +func (o *AreaConfig) GetTransferNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransferNetwork, true +} + +// SetTransferNetwork sets field value +func (o *AreaConfig) SetTransferNetwork(v string) { + o.TransferNetwork = v +} + +func (o AreaConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AreaConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + toSerialize["networkRanges"] = o.NetworkRanges + if !IsNil(o.Routes) { + toSerialize["routes"] = o.Routes + } + toSerialize["transferNetwork"] = o.TransferNetwork + return toSerialize, nil +} + +func (o *AreaConfig) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "networkRanges", + "transferNetwork", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAreaConfig := _AreaConfig{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAreaConfig) + + if err != nil { + return err + } + + *o = AreaConfig(varAreaConfig) + + return err +} + +type NullableAreaConfig struct { + value *AreaConfig + isSet bool +} + +func (v NullableAreaConfig) Get() *AreaConfig { + return v.value +} + +func (v *NullableAreaConfig) Set(val *AreaConfig) { + v.value = val + v.isSet = true +} + +func (v NullableAreaConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableAreaConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAreaConfig(val *AreaConfig) *NullableAreaConfig { + return &NullableAreaConfig{value: val, isSet: true} +} + +func (v NullableAreaConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAreaConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_area_id.go b/services/iaas/v1api/model_area_id.go new file mode 100644 index 000000000..4c26ea620 --- /dev/null +++ b/services/iaas/v1api/model_area_id.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// AreaId - The identifier (ID) of an area. +type AreaId struct { + StaticAreaID *StaticAreaID + String *string +} + +// StaticAreaIDAsAreaId is a convenience function that returns StaticAreaID wrapped in AreaId +func StaticAreaIDAsAreaId(v *StaticAreaID) AreaId { + return AreaId{ + StaticAreaID: v, + } +} + +// stringAsAreaId is a convenience function that returns string wrapped in AreaId +func StringAsAreaId(v *string) AreaId { + return AreaId{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *AreaId) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StaticAreaID + err = json.Unmarshal(data, &dst.StaticAreaID) + if err == nil { + jsonStaticAreaID, _ := json.Marshal(dst.StaticAreaID) + if string(jsonStaticAreaID) == "{}" { // empty struct + dst.StaticAreaID = nil + } else { + match++ + } + } else { + dst.StaticAreaID = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StaticAreaID = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(AreaId)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(AreaId)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src AreaId) MarshalJSON() ([]byte, error) { + if src.StaticAreaID != nil { + return json.Marshal(&src.StaticAreaID) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *AreaId) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.StaticAreaID != nil { + return obj.StaticAreaID + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj AreaId) GetActualInstanceValue() interface{} { + if obj.StaticAreaID != nil { + return *obj.StaticAreaID + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableAreaId struct { + value *AreaId + isSet bool +} + +func (v NullableAreaId) Get() *AreaId { + return v.value +} + +func (v *NullableAreaId) Set(val *AreaId) { + v.value = val + v.isSet = true +} + +func (v NullableAreaId) IsSet() bool { + return v.isSet +} + +func (v *NullableAreaId) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAreaId(val *AreaId) *NullableAreaId { + return &NullableAreaId{value: val, isSet: true} +} + +func (v NullableAreaId) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAreaId) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_area_prefix_config_ipv4.go b/services/iaas/v1api/model_area_prefix_config_ipv4.go new file mode 100644 index 000000000..f47a0cca1 --- /dev/null +++ b/services/iaas/v1api/model_area_prefix_config_ipv4.go @@ -0,0 +1,212 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the AreaPrefixConfigIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AreaPrefixConfigIPv4{} + +// AreaPrefixConfigIPv4 The IPv4 prefix config for a network area. +type AreaPrefixConfigIPv4 struct { + // The default prefix length for networks in the network area. + DefaultPrefixLen *int32 `json:"defaultPrefixLen,omitempty"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen *int32 `json:"maxPrefixLen,omitempty"` + // The minimal prefix length for networks in the network area. + MinPrefixLen *int32 `json:"minPrefixLen,omitempty"` +} + +// NewAreaPrefixConfigIPv4 instantiates a new AreaPrefixConfigIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAreaPrefixConfigIPv4() *AreaPrefixConfigIPv4 { + this := AreaPrefixConfigIPv4{} + var defaultPrefixLen int32 = 25 + this.DefaultPrefixLen = &defaultPrefixLen + var maxPrefixLen int32 = 29 + this.MaxPrefixLen = &maxPrefixLen + var minPrefixLen int32 = 24 + this.MinPrefixLen = &minPrefixLen + return &this +} + +// NewAreaPrefixConfigIPv4WithDefaults instantiates a new AreaPrefixConfigIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAreaPrefixConfigIPv4WithDefaults() *AreaPrefixConfigIPv4 { + this := AreaPrefixConfigIPv4{} + var defaultPrefixLen int32 = 25 + this.DefaultPrefixLen = &defaultPrefixLen + var maxPrefixLen int32 = 29 + this.MaxPrefixLen = &maxPrefixLen + var minPrefixLen int32 = 24 + this.MinPrefixLen = &minPrefixLen + return &this +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. +func (o *AreaPrefixConfigIPv4) GetDefaultPrefixLen() int32 { + if o == nil || IsNil(o.DefaultPrefixLen) { + var ret int32 + return ret + } + return *o.DefaultPrefixLen +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AreaPrefixConfigIPv4) GetDefaultPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.DefaultPrefixLen) { + return nil, false + } + return o.DefaultPrefixLen, true +} + +// HasDefaultPrefixLen returns a boolean if a field has been set. +func (o *AreaPrefixConfigIPv4) HasDefaultPrefixLen() bool { + if o != nil && !IsNil(o.DefaultPrefixLen) { + return true + } + + return false +} + +// SetDefaultPrefixLen gets a reference to the given int32 and assigns it to the DefaultPrefixLen field. +func (o *AreaPrefixConfigIPv4) SetDefaultPrefixLen(v int32) { + o.DefaultPrefixLen = &v +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. +func (o *AreaPrefixConfigIPv4) GetMaxPrefixLen() int32 { + if o == nil || IsNil(o.MaxPrefixLen) { + var ret int32 + return ret + } + return *o.MaxPrefixLen +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AreaPrefixConfigIPv4) GetMaxPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.MaxPrefixLen) { + return nil, false + } + return o.MaxPrefixLen, true +} + +// HasMaxPrefixLen returns a boolean if a field has been set. +func (o *AreaPrefixConfigIPv4) HasMaxPrefixLen() bool { + if o != nil && !IsNil(o.MaxPrefixLen) { + return true + } + + return false +} + +// SetMaxPrefixLen gets a reference to the given int32 and assigns it to the MaxPrefixLen field. +func (o *AreaPrefixConfigIPv4) SetMaxPrefixLen(v int32) { + o.MaxPrefixLen = &v +} + +// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. +func (o *AreaPrefixConfigIPv4) GetMinPrefixLen() int32 { + if o == nil || IsNil(o.MinPrefixLen) { + var ret int32 + return ret + } + return *o.MinPrefixLen +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AreaPrefixConfigIPv4) GetMinPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.MinPrefixLen) { + return nil, false + } + return o.MinPrefixLen, true +} + +// HasMinPrefixLen returns a boolean if a field has been set. +func (o *AreaPrefixConfigIPv4) HasMinPrefixLen() bool { + if o != nil && !IsNil(o.MinPrefixLen) { + return true + } + + return false +} + +// SetMinPrefixLen gets a reference to the given int32 and assigns it to the MinPrefixLen field. +func (o *AreaPrefixConfigIPv4) SetMinPrefixLen(v int32) { + o.MinPrefixLen = &v +} + +func (o AreaPrefixConfigIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AreaPrefixConfigIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultPrefixLen) { + toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + } + if !IsNil(o.MaxPrefixLen) { + toSerialize["maxPrefixLen"] = o.MaxPrefixLen + } + if !IsNil(o.MinPrefixLen) { + toSerialize["minPrefixLen"] = o.MinPrefixLen + } + return toSerialize, nil +} + +type NullableAreaPrefixConfigIPv4 struct { + value *AreaPrefixConfigIPv4 + isSet bool +} + +func (v NullableAreaPrefixConfigIPv4) Get() *AreaPrefixConfigIPv4 { + return v.value +} + +func (v *NullableAreaPrefixConfigIPv4) Set(val *AreaPrefixConfigIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableAreaPrefixConfigIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableAreaPrefixConfigIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAreaPrefixConfigIPv4(val *AreaPrefixConfigIPv4) *NullableAreaPrefixConfigIPv4 { + return &NullableAreaPrefixConfigIPv4{value: val, isSet: true} +} + +func (v NullableAreaPrefixConfigIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAreaPrefixConfigIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_availability_zone_list_response.go b/services/iaas/v1api/model_availability_zone_list_response.go new file mode 100644 index 000000000..2c14bff92 --- /dev/null +++ b/services/iaas/v1api/model_availability_zone_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AvailabilityZoneListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AvailabilityZoneListResponse{} + +// AvailabilityZoneListResponse Availability Zone list response. +type AvailabilityZoneListResponse struct { + // A list of availability zones. + Items []string `json:"items"` +} + +type _AvailabilityZoneListResponse AvailabilityZoneListResponse + +// NewAvailabilityZoneListResponse instantiates a new AvailabilityZoneListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAvailabilityZoneListResponse(items []string) *AvailabilityZoneListResponse { + this := AvailabilityZoneListResponse{} + this.Items = items + return &this +} + +// NewAvailabilityZoneListResponseWithDefaults instantiates a new AvailabilityZoneListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAvailabilityZoneListResponseWithDefaults() *AvailabilityZoneListResponse { + this := AvailabilityZoneListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AvailabilityZoneListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AvailabilityZoneListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AvailabilityZoneListResponse) SetItems(v []string) { + o.Items = v +} + +func (o AvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AvailabilityZoneListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AvailabilityZoneListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAvailabilityZoneListResponse := _AvailabilityZoneListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAvailabilityZoneListResponse) + + if err != nil { + return err + } + + *o = AvailabilityZoneListResponse(varAvailabilityZoneListResponse) + + return err +} + +type NullableAvailabilityZoneListResponse struct { + value *AvailabilityZoneListResponse + isSet bool +} + +func (v NullableAvailabilityZoneListResponse) Get() *AvailabilityZoneListResponse { + return v.value +} + +func (v *NullableAvailabilityZoneListResponse) Set(val *AvailabilityZoneListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAvailabilityZoneListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAvailabilityZoneListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAvailabilityZoneListResponse(val *AvailabilityZoneListResponse) *NullableAvailabilityZoneListResponse { + return &NullableAvailabilityZoneListResponse{value: val, isSet: true} +} + +func (v NullableAvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAvailabilityZoneListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_backup.go b/services/iaas/v1api/model_backup.go new file mode 100644 index 000000000..d03836634 --- /dev/null +++ b/services/iaas/v1api/model_backup.go @@ -0,0 +1,497 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "time" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup Object that represents a backup. +type Backup struct { + // Object that represents an availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // Universally Unique Identifier (UUID). + SnapshotId *string `json:"snapshotId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup() *Backup { + this := Backup{} + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *Backup) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *Backup) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *Backup) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Backup) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Backup) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Backup) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *Backup) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *Backup) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *Backup) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Backup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Backup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Backup) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Backup) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Backup) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Backup) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Backup) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Backup) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Backup) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Backup) SetSize(v int64) { + o.Size = &v +} + +// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +func (o *Backup) GetSnapshotId() string { + if o == nil || IsNil(o.SnapshotId) { + var ret string + return ret + } + return *o.SnapshotId +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSnapshotIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotId) { + return nil, false + } + return o.SnapshotId, true +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *Backup) HasSnapshotId() bool { + if o != nil && !IsNil(o.SnapshotId) { + return true + } + + return false +} + +// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +func (o *Backup) SetSnapshotId(v string) { + o.SnapshotId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Backup) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Backup) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Backup) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Backup) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Backup) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Backup) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *Backup) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *Backup) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *Backup) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SnapshotId) { + toSerialize["snapshotId"] = o.SnapshotId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_backup_list_response.go b/services/iaas/v1api/model_backup_list_response.go new file mode 100644 index 000000000..53975b327 --- /dev/null +++ b/services/iaas/v1api/model_backup_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupListResponse{} + +// BackupListResponse Backup list response. +type BackupListResponse struct { + // A list containing backup objects. + Items []Backup `json:"items"` +} + +type _BackupListResponse BackupListResponse + +// NewBackupListResponse instantiates a new BackupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupListResponse(items []Backup) *BackupListResponse { + this := BackupListResponse{} + this.Items = items + return &this +} + +// NewBackupListResponseWithDefaults instantiates a new BackupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupListResponseWithDefaults() *BackupListResponse { + this := BackupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *BackupListResponse) GetItems() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *BackupListResponse) GetItemsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *BackupListResponse) SetItems(v []Backup) { + o.Items = v +} + +func (o BackupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *BackupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupListResponse := _BackupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupListResponse) + + if err != nil { + return err + } + + *o = BackupListResponse(varBackupListResponse) + + return err +} + +type NullableBackupListResponse struct { + value *BackupListResponse + isSet bool +} + +func (v NullableBackupListResponse) Get() *BackupListResponse { + return v.value +} + +func (v *NullableBackupListResponse) Set(val *BackupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBackupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupListResponse(val *BackupListResponse) *NullableBackupListResponse { + return &NullableBackupListResponse{value: val, isSet: true} +} + +func (v NullableBackupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_backup_source.go b/services/iaas/v1api/model_backup_source.go new file mode 100644 index 000000000..e12752dc6 --- /dev/null +++ b/services/iaas/v1api/model_backup_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupSource{} + +// BackupSource The source object of a backup. +type BackupSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a backup. Possible values: `volume`, `snapshot`. + Type string `json:"type"` +} + +type _BackupSource BackupSource + +// NewBackupSource instantiates a new BackupSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupSource(id string, types string) *BackupSource { + this := BackupSource{} + this.Id = id + this.Type = types + return &this +} + +// NewBackupSourceWithDefaults instantiates a new BackupSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupSourceWithDefaults() *BackupSource { + this := BackupSource{} + return &this +} + +// GetId returns the Id field value +func (o *BackupSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BackupSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BackupSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *BackupSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BackupSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BackupSource) SetType(v string) { + o.Type = v +} + +func (o BackupSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BackupSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupSource := _BackupSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupSource) + + if err != nil { + return err + } + + *o = BackupSource(varBackupSource) + + return err +} + +type NullableBackupSource struct { + value *BackupSource + isSet bool +} + +func (v NullableBackupSource) Get() *BackupSource { + return v.value +} + +func (v *NullableBackupSource) Set(val *BackupSource) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSource) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSource(val *BackupSource) *NullableBackupSource { + return &NullableBackupSource{value: val, isSet: true} +} + +func (v NullableBackupSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_base_security_group_rule.go b/services/iaas/v1api/model_base_security_group_rule.go new file mode 100644 index 000000000..d65db5dfe --- /dev/null +++ b/services/iaas/v1api/model_base_security_group_rule.go @@ -0,0 +1,531 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the BaseSecurityGroupRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BaseSecurityGroupRule{} + +// BaseSecurityGroupRule The base schema for a security group rule. +type BaseSecurityGroupRule struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _BaseSecurityGroupRule BaseSecurityGroupRule + +// NewBaseSecurityGroupRule instantiates a new BaseSecurityGroupRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBaseSecurityGroupRule(direction string) *BaseSecurityGroupRule { + this := BaseSecurityGroupRule{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewBaseSecurityGroupRuleWithDefaults instantiates a new BaseSecurityGroupRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBaseSecurityGroupRuleWithDefaults() *BaseSecurityGroupRule { + this := BaseSecurityGroupRule{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *BaseSecurityGroupRule) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *BaseSecurityGroupRule) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *BaseSecurityGroupRule) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *BaseSecurityGroupRule) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *BaseSecurityGroupRule) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *BaseSecurityGroupRule) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BaseSecurityGroupRule) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *BaseSecurityGroupRule) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *BaseSecurityGroupRule) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *BaseSecurityGroupRule) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *BaseSecurityGroupRule) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *BaseSecurityGroupRule) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o BaseSecurityGroupRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BaseSecurityGroupRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *BaseSecurityGroupRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBaseSecurityGroupRule := _BaseSecurityGroupRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBaseSecurityGroupRule) + + if err != nil { + return err + } + + *o = BaseSecurityGroupRule(varBaseSecurityGroupRule) + + return err +} + +type NullableBaseSecurityGroupRule struct { + value *BaseSecurityGroupRule + isSet bool +} + +func (v NullableBaseSecurityGroupRule) Get() *BaseSecurityGroupRule { + return v.value +} + +func (v *NullableBaseSecurityGroupRule) Set(val *BaseSecurityGroupRule) { + v.value = val + v.isSet = true +} + +func (v NullableBaseSecurityGroupRule) IsSet() bool { + return v.isSet +} + +func (v *NullableBaseSecurityGroupRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBaseSecurityGroupRule(val *BaseSecurityGroupRule) *NullableBaseSecurityGroupRule { + return &NullableBaseSecurityGroupRule{value: val, isSet: true} +} + +func (v NullableBaseSecurityGroupRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBaseSecurityGroupRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_boot_volume.go b/services/iaas/v1api/model_boot_volume.go new file mode 100644 index 000000000..83c301b72 --- /dev/null +++ b/services/iaas/v1api/model_boot_volume.go @@ -0,0 +1,273 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the BootVolume type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BootVolume{} + +// BootVolume The boot device for the server. +type BootVolume struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *BootVolumeSource `json:"source,omitempty"` +} + +// NewBootVolume instantiates a new BootVolume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBootVolume() *BootVolume { + this := BootVolume{} + return &this +} + +// NewBootVolumeWithDefaults instantiates a new BootVolume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBootVolumeWithDefaults() *BootVolume { + this := BootVolume{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *BootVolume) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *BootVolume) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *BootVolume) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BootVolume) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BootVolume) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BootVolume) SetId(v string) { + o.Id = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *BootVolume) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *BootVolume) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *BootVolume) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *BootVolume) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *BootVolume) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *BootVolume) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *BootVolume) GetSource() BootVolumeSource { + if o == nil || IsNil(o.Source) { + var ret BootVolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetSourceOk() (*BootVolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *BootVolume) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. +func (o *BootVolume) SetSource(v BootVolumeSource) { + o.Source = &v +} + +func (o BootVolume) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BootVolume) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + return toSerialize, nil +} + +type NullableBootVolume struct { + value *BootVolume + isSet bool +} + +func (v NullableBootVolume) Get() *BootVolume { + return v.value +} + +func (v *NullableBootVolume) Set(val *BootVolume) { + v.value = val + v.isSet = true +} + +func (v NullableBootVolume) IsSet() bool { + return v.isSet +} + +func (v *NullableBootVolume) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBootVolume(val *BootVolume) *NullableBootVolume { + return &NullableBootVolume{value: val, isSet: true} +} + +func (v NullableBootVolume) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBootVolume) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_boot_volume_source.go b/services/iaas/v1api/model_boot_volume_source.go new file mode 100644 index 000000000..b45000c24 --- /dev/null +++ b/services/iaas/v1api/model_boot_volume_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BootVolumeSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BootVolumeSource{} + +// BootVolumeSource The source object of a boot volume. +type BootVolumeSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a boot volume. Possible values: `image`, `volume`. + Type string `json:"type"` +} + +type _BootVolumeSource BootVolumeSource + +// NewBootVolumeSource instantiates a new BootVolumeSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBootVolumeSource(id string, types string) *BootVolumeSource { + this := BootVolumeSource{} + this.Id = id + this.Type = types + return &this +} + +// NewBootVolumeSourceWithDefaults instantiates a new BootVolumeSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBootVolumeSourceWithDefaults() *BootVolumeSource { + this := BootVolumeSource{} + return &this +} + +// GetId returns the Id field value +func (o *BootVolumeSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BootVolumeSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BootVolumeSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *BootVolumeSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BootVolumeSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BootVolumeSource) SetType(v string) { + o.Type = v +} + +func (o BootVolumeSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BootVolumeSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BootVolumeSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBootVolumeSource := _BootVolumeSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBootVolumeSource) + + if err != nil { + return err + } + + *o = BootVolumeSource(varBootVolumeSource) + + return err +} + +type NullableBootVolumeSource struct { + value *BootVolumeSource + isSet bool +} + +func (v NullableBootVolumeSource) Get() *BootVolumeSource { + return v.value +} + +func (v *NullableBootVolumeSource) Set(val *BootVolumeSource) { + v.value = val + v.isSet = true +} + +func (v NullableBootVolumeSource) IsSet() bool { + return v.isSet +} + +func (v *NullableBootVolumeSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBootVolumeSource(val *BootVolumeSource) *NullableBootVolumeSource { + return &NullableBootVolumeSource{value: val, isSet: true} +} + +func (v NullableBootVolumeSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBootVolumeSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_affinity_group_payload.go b/services/iaas/v1api/model_create_affinity_group_payload.go new file mode 100644 index 000000000..7e3c9cdb3 --- /dev/null +++ b/services/iaas/v1api/model_create_affinity_group_payload.go @@ -0,0 +1,261 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateAffinityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAffinityGroupPayload{} + +// CreateAffinityGroupPayload Definition of an affinity group. +type CreateAffinityGroupPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The servers that are part of the affinity group. + Members []string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. + Policy string `json:"policy"` +} + +type _CreateAffinityGroupPayload CreateAffinityGroupPayload + +// NewCreateAffinityGroupPayload instantiates a new CreateAffinityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAffinityGroupPayload(name string, policy string) *CreateAffinityGroupPayload { + this := CreateAffinityGroupPayload{} + this.Name = name + this.Policy = policy + return &this +} + +// NewCreateAffinityGroupPayloadWithDefaults instantiates a new CreateAffinityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAffinityGroupPayloadWithDefaults() *CreateAffinityGroupPayload { + this := CreateAffinityGroupPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateAffinityGroupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateAffinityGroupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateAffinityGroupPayload) SetId(v string) { + o.Id = &v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *CreateAffinityGroupPayload) GetMembers() []string { + if o == nil || IsNil(o.Members) { + var ret []string + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetMembersOk() ([]string, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *CreateAffinityGroupPayload) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []string and assigns it to the Members field. +func (o *CreateAffinityGroupPayload) SetMembers(v []string) { + o.Members = v +} + +// GetName returns the Name field value +func (o *CreateAffinityGroupPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateAffinityGroupPayload) SetName(v string) { + o.Name = v +} + +// GetPolicy returns the Policy field value +func (o *CreateAffinityGroupPayload) GetPolicy() string { + if o == nil { + var ret string + return ret + } + + return o.Policy +} + +// GetPolicyOk returns a tuple with the Policy field value +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Policy, true +} + +// SetPolicy sets field value +func (o *CreateAffinityGroupPayload) SetPolicy(v string) { + o.Policy = v +} + +func (o CreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + toSerialize["name"] = o.Name + toSerialize["policy"] = o.Policy + return toSerialize, nil +} + +func (o *CreateAffinityGroupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "policy", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateAffinityGroupPayload := _CreateAffinityGroupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateAffinityGroupPayload) + + if err != nil { + return err + } + + *o = CreateAffinityGroupPayload(varCreateAffinityGroupPayload) + + return err +} + +type NullableCreateAffinityGroupPayload struct { + value *CreateAffinityGroupPayload + isSet bool +} + +func (v NullableCreateAffinityGroupPayload) Get() *CreateAffinityGroupPayload { + return v.value +} + +func (v *NullableCreateAffinityGroupPayload) Set(val *CreateAffinityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAffinityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAffinityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAffinityGroupPayload(val *CreateAffinityGroupPayload) *NullableCreateAffinityGroupPayload { + return &NullableCreateAffinityGroupPayload{value: val, isSet: true} +} + +func (v NullableCreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAffinityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_area_address_family.go b/services/iaas/v1api/model_create_area_address_family.go new file mode 100644 index 000000000..0aeaa2ee9 --- /dev/null +++ b/services/iaas/v1api/model_create_area_address_family.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateAreaAddressFamily type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAreaAddressFamily{} + +// CreateAreaAddressFamily The addressFamily object for a area create request. +type CreateAreaAddressFamily struct { + Ipv4 *CreateAreaIPv4 `json:"ipv4,omitempty"` +} + +// NewCreateAreaAddressFamily instantiates a new CreateAreaAddressFamily object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAreaAddressFamily() *CreateAreaAddressFamily { + this := CreateAreaAddressFamily{} + return &this +} + +// NewCreateAreaAddressFamilyWithDefaults instantiates a new CreateAreaAddressFamily object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAreaAddressFamilyWithDefaults() *CreateAreaAddressFamily { + this := CreateAreaAddressFamily{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateAreaAddressFamily) GetIpv4() CreateAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret CreateAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAreaAddressFamily) GetIpv4Ok() (*CreateAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateAreaAddressFamily) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given CreateAreaIPv4 and assigns it to the Ipv4 field. +func (o *CreateAreaAddressFamily) SetIpv4(v CreateAreaIPv4) { + o.Ipv4 = &v +} + +func (o CreateAreaAddressFamily) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAreaAddressFamily) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableCreateAreaAddressFamily struct { + value *CreateAreaAddressFamily + isSet bool +} + +func (v NullableCreateAreaAddressFamily) Get() *CreateAreaAddressFamily { + return v.value +} + +func (v *NullableCreateAreaAddressFamily) Set(val *CreateAreaAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAreaAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAreaAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAreaAddressFamily(val *CreateAreaAddressFamily) *NullableCreateAreaAddressFamily { + return &NullableCreateAreaAddressFamily{value: val, isSet: true} +} + +func (v NullableCreateAreaAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAreaAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_area_ipv4.go b/services/iaas/v1api/model_create_area_ipv4.go new file mode 100644 index 000000000..bbbda4b65 --- /dev/null +++ b/services/iaas/v1api/model_create_area_ipv4.go @@ -0,0 +1,383 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAreaIPv4{} + +// CreateAreaIPv4 The config object for a IPv4 network area. +type CreateAreaIPv4 struct { + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // A list of network ranges. + NetworkRanges []NetworkRange `json:"networkRanges"` + // A list of routes. + Routes []Route `json:"routes,omitempty"` + // Classless Inter-Domain Routing (CIDR). + TransferNetwork string `json:"transferNetwork" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + // The default prefix length for networks in the network area. + DefaultPrefixLen *int32 `json:"defaultPrefixLen,omitempty"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen *int32 `json:"maxPrefixLen,omitempty"` + // The minimal prefix length for networks in the network area. + MinPrefixLen *int32 `json:"minPrefixLen,omitempty"` +} + +type _CreateAreaIPv4 CreateAreaIPv4 + +// NewCreateAreaIPv4 instantiates a new CreateAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAreaIPv4(networkRanges []NetworkRange, transferNetwork string) *CreateAreaIPv4 { + this := CreateAreaIPv4{} + this.NetworkRanges = networkRanges + this.TransferNetwork = transferNetwork + var defaultPrefixLen int32 = 25 + this.DefaultPrefixLen = &defaultPrefixLen + var maxPrefixLen int32 = 29 + this.MaxPrefixLen = &maxPrefixLen + var minPrefixLen int32 = 24 + this.MinPrefixLen = &minPrefixLen + return &this +} + +// NewCreateAreaIPv4WithDefaults instantiates a new CreateAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAreaIPv4WithDefaults() *CreateAreaIPv4 { + this := CreateAreaIPv4{} + var defaultPrefixLen int32 = 25 + this.DefaultPrefixLen = &defaultPrefixLen + var maxPrefixLen int32 = 29 + this.MaxPrefixLen = &maxPrefixLen + var minPrefixLen int32 = 24 + this.MinPrefixLen = &minPrefixLen + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *CreateAreaIPv4) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAreaIPv4) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *CreateAreaIPv4) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *CreateAreaIPv4) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetNetworkRanges returns the NetworkRanges field value +func (o *CreateAreaIPv4) GetNetworkRanges() []NetworkRange { + if o == nil { + var ret []NetworkRange + return ret + } + + return o.NetworkRanges +} + +// GetNetworkRangesOk returns a tuple with the NetworkRanges field value +// and a boolean to check if the value has been set. +func (o *CreateAreaIPv4) GetNetworkRangesOk() ([]NetworkRange, bool) { + if o == nil { + return nil, false + } + return o.NetworkRanges, true +} + +// SetNetworkRanges sets field value +func (o *CreateAreaIPv4) SetNetworkRanges(v []NetworkRange) { + o.NetworkRanges = v +} + +// GetRoutes returns the Routes field value if set, zero value otherwise. +func (o *CreateAreaIPv4) GetRoutes() []Route { + if o == nil || IsNil(o.Routes) { + var ret []Route + return ret + } + return o.Routes +} + +// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAreaIPv4) GetRoutesOk() ([]Route, bool) { + if o == nil || IsNil(o.Routes) { + return nil, false + } + return o.Routes, true +} + +// HasRoutes returns a boolean if a field has been set. +func (o *CreateAreaIPv4) HasRoutes() bool { + if o != nil && !IsNil(o.Routes) { + return true + } + + return false +} + +// SetRoutes gets a reference to the given []Route and assigns it to the Routes field. +func (o *CreateAreaIPv4) SetRoutes(v []Route) { + o.Routes = v +} + +// GetTransferNetwork returns the TransferNetwork field value +func (o *CreateAreaIPv4) GetTransferNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.TransferNetwork +} + +// GetTransferNetworkOk returns a tuple with the TransferNetwork field value +// and a boolean to check if the value has been set. +func (o *CreateAreaIPv4) GetTransferNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransferNetwork, true +} + +// SetTransferNetwork sets field value +func (o *CreateAreaIPv4) SetTransferNetwork(v string) { + o.TransferNetwork = v +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. +func (o *CreateAreaIPv4) GetDefaultPrefixLen() int32 { + if o == nil || IsNil(o.DefaultPrefixLen) { + var ret int32 + return ret + } + return *o.DefaultPrefixLen +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAreaIPv4) GetDefaultPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.DefaultPrefixLen) { + return nil, false + } + return o.DefaultPrefixLen, true +} + +// HasDefaultPrefixLen returns a boolean if a field has been set. +func (o *CreateAreaIPv4) HasDefaultPrefixLen() bool { + if o != nil && !IsNil(o.DefaultPrefixLen) { + return true + } + + return false +} + +// SetDefaultPrefixLen gets a reference to the given int32 and assigns it to the DefaultPrefixLen field. +func (o *CreateAreaIPv4) SetDefaultPrefixLen(v int32) { + o.DefaultPrefixLen = &v +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. +func (o *CreateAreaIPv4) GetMaxPrefixLen() int32 { + if o == nil || IsNil(o.MaxPrefixLen) { + var ret int32 + return ret + } + return *o.MaxPrefixLen +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAreaIPv4) GetMaxPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.MaxPrefixLen) { + return nil, false + } + return o.MaxPrefixLen, true +} + +// HasMaxPrefixLen returns a boolean if a field has been set. +func (o *CreateAreaIPv4) HasMaxPrefixLen() bool { + if o != nil && !IsNil(o.MaxPrefixLen) { + return true + } + + return false +} + +// SetMaxPrefixLen gets a reference to the given int32 and assigns it to the MaxPrefixLen field. +func (o *CreateAreaIPv4) SetMaxPrefixLen(v int32) { + o.MaxPrefixLen = &v +} + +// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. +func (o *CreateAreaIPv4) GetMinPrefixLen() int32 { + if o == nil || IsNil(o.MinPrefixLen) { + var ret int32 + return ret + } + return *o.MinPrefixLen +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAreaIPv4) GetMinPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.MinPrefixLen) { + return nil, false + } + return o.MinPrefixLen, true +} + +// HasMinPrefixLen returns a boolean if a field has been set. +func (o *CreateAreaIPv4) HasMinPrefixLen() bool { + if o != nil && !IsNil(o.MinPrefixLen) { + return true + } + + return false +} + +// SetMinPrefixLen gets a reference to the given int32 and assigns it to the MinPrefixLen field. +func (o *CreateAreaIPv4) SetMinPrefixLen(v int32) { + o.MinPrefixLen = &v +} + +func (o CreateAreaIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + toSerialize["networkRanges"] = o.NetworkRanges + if !IsNil(o.Routes) { + toSerialize["routes"] = o.Routes + } + toSerialize["transferNetwork"] = o.TransferNetwork + if !IsNil(o.DefaultPrefixLen) { + toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + } + if !IsNil(o.MaxPrefixLen) { + toSerialize["maxPrefixLen"] = o.MaxPrefixLen + } + if !IsNil(o.MinPrefixLen) { + toSerialize["minPrefixLen"] = o.MinPrefixLen + } + return toSerialize, nil +} + +func (o *CreateAreaIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "networkRanges", + "transferNetwork", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateAreaIPv4 := _CreateAreaIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateAreaIPv4) + + if err != nil { + return err + } + + *o = CreateAreaIPv4(varCreateAreaIPv4) + + return err +} + +type NullableCreateAreaIPv4 struct { + value *CreateAreaIPv4 + isSet bool +} + +func (v NullableCreateAreaIPv4) Get() *CreateAreaIPv4 { + return v.value +} + +func (v *NullableCreateAreaIPv4) Set(val *CreateAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAreaIPv4(val *CreateAreaIPv4) *NullableCreateAreaIPv4 { + return &NullableCreateAreaIPv4{value: val, isSet: true} +} + +func (v NullableCreateAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_backup_payload.go b/services/iaas/v1api/model_create_backup_payload.go new file mode 100644 index 000000000..b85cf4fc0 --- /dev/null +++ b/services/iaas/v1api/model_create_backup_payload.go @@ -0,0 +1,231 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupPayload{} + +// CreateBackupPayload Object that represents a backup create request body. +type CreateBackupPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + Source BackupSource `json:"source"` +} + +type _CreateBackupPayload CreateBackupPayload + +// NewCreateBackupPayload instantiates a new CreateBackupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupPayload(source BackupSource) *CreateBackupPayload { + this := CreateBackupPayload{} + this.Source = source + return &this +} + +// NewCreateBackupPayloadWithDefaults instantiates a new CreateBackupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { + this := CreateBackupPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateBackupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateBackupPayload) SetName(v string) { + o.Name = &v +} + +// GetSource returns the Source field value +func (o *CreateBackupPayload) GetSource() BackupSource { + if o == nil { + var ret BackupSource + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetSourceOk() (*BackupSource, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *CreateBackupPayload) SetSource(v BackupSource) { + o.Source = v +} + +func (o CreateBackupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["source"] = o.Source + return toSerialize, nil +} + +func (o *CreateBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupPayload := _CreateBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateBackupPayload) + + if err != nil { + return err + } + + *o = CreateBackupPayload(varCreateBackupPayload) + + return err +} + +type NullableCreateBackupPayload struct { + value *CreateBackupPayload + isSet bool +} + +func (v NullableCreateBackupPayload) Get() *CreateBackupPayload { + return v.value +} + +func (v *NullableCreateBackupPayload) Set(val *CreateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupPayload(val *CreateBackupPayload) *NullableCreateBackupPayload { + return &NullableCreateBackupPayload{value: val, isSet: true} +} + +func (v NullableCreateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_image_payload.go b/services/iaas/v1api/model_create_image_payload.go new file mode 100644 index 000000000..0b949afb6 --- /dev/null +++ b/services/iaas/v1api/model_create_image_payload.go @@ -0,0 +1,740 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateImagePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateImagePayload{} + +// CreateImagePayload Object that represents an Image and its parameters. Used for Creating and returning (get/list). +type CreateImagePayload struct { + Agent *ImageAgent `json:"agent,omitempty"` + Checksum *ImageChecksum `json:"checksum,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat string `json:"diskFormat"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Indicates Image Import Progress in percent. + ImportProgress *int64 `json:"importProgress,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + Owner *string `json:"owner,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` + // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. + Scope *string `json:"scope,omitempty"` + // Size in bytes. + Size *int64 `json:"size,omitempty"` + // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateImagePayload CreateImagePayload + +// NewCreateImagePayload instantiates a new CreateImagePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateImagePayload(diskFormat string, name string) *CreateImagePayload { + this := CreateImagePayload{} + this.DiskFormat = diskFormat + this.Name = name + return &this +} + +// NewCreateImagePayloadWithDefaults instantiates a new CreateImagePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateImagePayloadWithDefaults() *CreateImagePayload { + this := CreateImagePayload{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *CreateImagePayload) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *CreateImagePayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *CreateImagePayload) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *CreateImagePayload) GetChecksum() ImageChecksum { + if o == nil || IsNil(o.Checksum) { + var ret ImageChecksum + return ret + } + return *o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetChecksumOk() (*ImageChecksum, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *CreateImagePayload) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +func (o *CreateImagePayload) SetChecksum(v ImageChecksum) { + o.Checksum = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *CreateImagePayload) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *CreateImagePayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *CreateImagePayload) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateImagePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateImagePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateImagePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDiskFormat returns the DiskFormat field value +func (o *CreateImagePayload) GetDiskFormat() string { + if o == nil { + var ret string + return ret + } + + return o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetDiskFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DiskFormat, true +} + +// SetDiskFormat sets field value +func (o *CreateImagePayload) SetDiskFormat(v string) { + o.DiskFormat = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateImagePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateImagePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateImagePayload) SetId(v string) { + o.Id = &v +} + +// GetImportProgress returns the ImportProgress field value if set, zero value otherwise. +func (o *CreateImagePayload) GetImportProgress() int64 { + if o == nil || IsNil(o.ImportProgress) { + var ret int64 + return ret + } + return *o.ImportProgress +} + +// GetImportProgressOk returns a tuple with the ImportProgress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetImportProgressOk() (*int64, bool) { + if o == nil || IsNil(o.ImportProgress) { + return nil, false + } + return o.ImportProgress, true +} + +// HasImportProgress returns a boolean if a field has been set. +func (o *CreateImagePayload) HasImportProgress() bool { + if o != nil && !IsNil(o.ImportProgress) { + return true + } + + return false +} + +// SetImportProgress gets a reference to the given int64 and assigns it to the ImportProgress field. +func (o *CreateImagePayload) SetImportProgress(v int64) { + o.ImportProgress = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateImagePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateImagePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateImagePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *CreateImagePayload) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *CreateImagePayload) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *CreateImagePayload) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *CreateImagePayload) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *CreateImagePayload) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *CreateImagePayload) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value +func (o *CreateImagePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateImagePayload) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *CreateImagePayload) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *CreateImagePayload) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *CreateImagePayload) SetOwner(v string) { + o.Owner = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *CreateImagePayload) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *CreateImagePayload) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *CreateImagePayload) SetProtected(v bool) { + o.Protected = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *CreateImagePayload) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *CreateImagePayload) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *CreateImagePayload) SetScope(v string) { + o.Scope = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateImagePayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateImagePayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateImagePayload) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateImagePayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateImagePayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateImagePayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateImagePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateImagePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateImagePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateImagePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["diskFormat"] = o.DiskFormat + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImportProgress) { + toSerialize["importProgress"] = o.ImportProgress + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateImagePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "diskFormat", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateImagePayload := _CreateImagePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateImagePayload) + + if err != nil { + return err + } + + *o = CreateImagePayload(varCreateImagePayload) + + return err +} + +type NullableCreateImagePayload struct { + value *CreateImagePayload + isSet bool +} + +func (v NullableCreateImagePayload) Get() *CreateImagePayload { + return v.value +} + +func (v *NullableCreateImagePayload) Set(val *CreateImagePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateImagePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateImagePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateImagePayload(val *CreateImagePayload) *NullableCreateImagePayload { + return &NullableCreateImagePayload{value: val, isSet: true} +} + +func (v NullableCreateImagePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateImagePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_key_pair_payload.go b/services/iaas/v1api/model_create_key_pair_payload.go new file mode 100644 index 000000000..1964520d0 --- /dev/null +++ b/services/iaas/v1api/model_create_key_pair_payload.go @@ -0,0 +1,344 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateKeyPairPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateKeyPairPayload{} + +// CreateKeyPairPayload Object that represents the public key of an SSH keypair and its name. +type CreateKeyPairPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents an SSH keypair MD5 fingerprint. + Fingerprint *string `json:"fingerprint,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // Object that represents a public SSH key. + PublicKey string `json:"publicKey" validate:"regexp=^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\\\\s+[A-Za-z0-9+\\/]+[=]{0,3}(\\\\s+.+)?\\\\s*$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateKeyPairPayload CreateKeyPairPayload + +// NewCreateKeyPairPayload instantiates a new CreateKeyPairPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateKeyPairPayload(publicKey string) *CreateKeyPairPayload { + this := CreateKeyPairPayload{} + this.PublicKey = publicKey + return &this +} + +// NewCreateKeyPairPayloadWithDefaults instantiates a new CreateKeyPairPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateKeyPairPayloadWithDefaults() *CreateKeyPairPayload { + this := CreateKeyPairPayload{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateKeyPairPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetFingerprint() string { + if o == nil || IsNil(o.Fingerprint) { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetFingerprintOk() (*string, bool) { + if o == nil || IsNil(o.Fingerprint) { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasFingerprint() bool { + if o != nil && !IsNil(o.Fingerprint) { + return true + } + + return false +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *CreateKeyPairPayload) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateKeyPairPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateKeyPairPayload) SetName(v string) { + o.Name = &v +} + +// GetPublicKey returns the PublicKey field value +func (o *CreateKeyPairPayload) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *CreateKeyPairPayload) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateKeyPairPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateKeyPairPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateKeyPairPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Fingerprint) { + toSerialize["fingerprint"] = o.Fingerprint + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["publicKey"] = o.PublicKey + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateKeyPairPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "publicKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateKeyPairPayload := _CreateKeyPairPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateKeyPairPayload) + + if err != nil { + return err + } + + *o = CreateKeyPairPayload(varCreateKeyPairPayload) + + return err +} + +type NullableCreateKeyPairPayload struct { + value *CreateKeyPairPayload + isSet bool +} + +func (v NullableCreateKeyPairPayload) Get() *CreateKeyPairPayload { + return v.value +} + +func (v *NullableCreateKeyPairPayload) Set(val *CreateKeyPairPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateKeyPairPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateKeyPairPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateKeyPairPayload(val *CreateKeyPairPayload) *NullableCreateKeyPairPayload { + return &NullableCreateKeyPairPayload{value: val, isSet: true} +} + +func (v NullableCreateKeyPairPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateKeyPairPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_network_address_family.go b/services/iaas/v1api/model_create_network_address_family.go new file mode 100644 index 000000000..04e558a03 --- /dev/null +++ b/services/iaas/v1api/model_create_network_address_family.go @@ -0,0 +1,161 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateNetworkAddressFamily type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAddressFamily{} + +// CreateNetworkAddressFamily The addressFamily object for a network create request. +type CreateNetworkAddressFamily struct { + Ipv4 *CreateNetworkIPv4Body `json:"ipv4,omitempty"` + Ipv6 *CreateNetworkIPv6Body `json:"ipv6,omitempty"` +} + +// NewCreateNetworkAddressFamily instantiates a new CreateNetworkAddressFamily object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAddressFamily() *CreateNetworkAddressFamily { + this := CreateNetworkAddressFamily{} + return &this +} + +// NewCreateNetworkAddressFamilyWithDefaults instantiates a new CreateNetworkAddressFamily object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAddressFamilyWithDefaults() *CreateNetworkAddressFamily { + this := CreateNetworkAddressFamily{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAddressFamily) GetIpv4() CreateNetworkIPv4Body { + if o == nil || IsNil(o.Ipv4) { + var ret CreateNetworkIPv4Body + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAddressFamily) GetIpv4Ok() (*CreateNetworkIPv4Body, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAddressFamily) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given CreateNetworkIPv4Body and assigns it to the Ipv4 field. +func (o *CreateNetworkAddressFamily) SetIpv4(v CreateNetworkIPv4Body) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNetworkAddressFamily) GetIpv6() CreateNetworkIPv6Body { + if o == nil || IsNil(o.Ipv6) { + var ret CreateNetworkIPv6Body + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAddressFamily) GetIpv6Ok() (*CreateNetworkIPv6Body, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNetworkAddressFamily) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given CreateNetworkIPv6Body and assigns it to the Ipv6 field. +func (o *CreateNetworkAddressFamily) SetIpv6(v CreateNetworkIPv6Body) { + o.Ipv6 = &v +} + +func (o CreateNetworkAddressFamily) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAddressFamily) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + return toSerialize, nil +} + +type NullableCreateNetworkAddressFamily struct { + value *CreateNetworkAddressFamily + isSet bool +} + +func (v NullableCreateNetworkAddressFamily) Get() *CreateNetworkAddressFamily { + return v.value +} + +func (v *NullableCreateNetworkAddressFamily) Set(val *CreateNetworkAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAddressFamily(val *CreateNetworkAddressFamily) *NullableCreateNetworkAddressFamily { + return &NullableCreateNetworkAddressFamily{value: val, isSet: true} +} + +func (v NullableCreateNetworkAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_network_area_payload.go b/services/iaas/v1api/model_create_network_area_payload.go new file mode 100644 index 000000000..cf5b3237a --- /dev/null +++ b/services/iaas/v1api/model_create_network_area_payload.go @@ -0,0 +1,223 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaPayload{} + +// CreateNetworkAreaPayload struct for CreateNetworkAreaPayload +type CreateNetworkAreaPayload struct { + AddressFamily CreateAreaAddressFamily `json:"addressFamily"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +type _CreateNetworkAreaPayload CreateNetworkAreaPayload + +// NewCreateNetworkAreaPayload instantiates a new CreateNetworkAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaPayload(addressFamily CreateAreaAddressFamily, name string) *CreateNetworkAreaPayload { + this := CreateNetworkAreaPayload{} + this.AddressFamily = addressFamily + this.Name = name + return &this +} + +// NewCreateNetworkAreaPayloadWithDefaults instantiates a new CreateNetworkAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaPayloadWithDefaults() *CreateNetworkAreaPayload { + this := CreateNetworkAreaPayload{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value +func (o *CreateNetworkAreaPayload) GetAddressFamily() CreateAreaAddressFamily { + if o == nil { + var ret CreateAreaAddressFamily + return ret + } + + return o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetAddressFamilyOk() (*CreateAreaAddressFamily, bool) { + if o == nil { + return nil, false + } + return &o.AddressFamily, true +} + +// SetAddressFamily sets field value +func (o *CreateNetworkAreaPayload) SetAddressFamily(v CreateAreaAddressFamily) { + o.AddressFamily = v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkAreaPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkAreaPayload) SetName(v string) { + o.Name = v +} + +func (o CreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["addressFamily"] = o.AddressFamily + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *CreateNetworkAreaPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "addressFamily", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkAreaPayload := _CreateNetworkAreaPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkAreaPayload) + + if err != nil { + return err + } + + *o = CreateNetworkAreaPayload(varCreateNetworkAreaPayload) + + return err +} + +type NullableCreateNetworkAreaPayload struct { + value *CreateNetworkAreaPayload + isSet bool +} + +func (v NullableCreateNetworkAreaPayload) Get() *CreateNetworkAreaPayload { + return v.value +} + +func (v *NullableCreateNetworkAreaPayload) Set(val *CreateNetworkAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaPayload(val *CreateNetworkAreaPayload) *NullableCreateNetworkAreaPayload { + return &NullableCreateNetworkAreaPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_network_area_range_payload.go b/services/iaas/v1api/model_create_network_area_range_payload.go new file mode 100644 index 000000000..fb19df10b --- /dev/null +++ b/services/iaas/v1api/model_create_network_area_range_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateNetworkAreaRangePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRangePayload{} + +// CreateNetworkAreaRangePayload struct for CreateNetworkAreaRangePayload +type CreateNetworkAreaRangePayload struct { + // A list of network ranges. + Ipv4 []NetworkRange `json:"ipv4,omitempty"` +} + +// NewCreateNetworkAreaRangePayload instantiates a new CreateNetworkAreaRangePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaRangePayload() *CreateNetworkAreaRangePayload { + this := CreateNetworkAreaRangePayload{} + return &this +} + +// NewCreateNetworkAreaRangePayloadWithDefaults instantiates a new CreateNetworkAreaRangePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaRangePayloadWithDefaults() *CreateNetworkAreaRangePayload { + this := CreateNetworkAreaRangePayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAreaRangePayload) GetIpv4() []NetworkRange { + if o == nil || IsNil(o.Ipv4) { + var ret []NetworkRange + return ret + } + return o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRangePayload) GetIpv4Ok() ([]NetworkRange, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAreaRangePayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given []NetworkRange and assigns it to the Ipv4 field. +func (o *CreateNetworkAreaRangePayload) SetIpv4(v []NetworkRange) { + o.Ipv4 = v +} + +func (o CreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaRangePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableCreateNetworkAreaRangePayload struct { + value *CreateNetworkAreaRangePayload + isSet bool +} + +func (v NullableCreateNetworkAreaRangePayload) Get() *CreateNetworkAreaRangePayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRangePayload) Set(val *CreateNetworkAreaRangePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRangePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRangePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRangePayload(val *CreateNetworkAreaRangePayload) *NullableCreateNetworkAreaRangePayload { + return &NullableCreateNetworkAreaRangePayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRangePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_network_area_route_payload.go b/services/iaas/v1api/model_create_network_area_route_payload.go new file mode 100644 index 000000000..6ede9d1ea --- /dev/null +++ b/services/iaas/v1api/model_create_network_area_route_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRoutePayload{} + +// CreateNetworkAreaRoutePayload struct for CreateNetworkAreaRoutePayload +type CreateNetworkAreaRoutePayload struct { + // A list of routes. + Ipv4 []Route `json:"ipv4,omitempty"` +} + +// NewCreateNetworkAreaRoutePayload instantiates a new CreateNetworkAreaRoutePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaRoutePayload() *CreateNetworkAreaRoutePayload { + this := CreateNetworkAreaRoutePayload{} + return &this +} + +// NewCreateNetworkAreaRoutePayloadWithDefaults instantiates a new CreateNetworkAreaRoutePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaRoutePayloadWithDefaults() *CreateNetworkAreaRoutePayload { + this := CreateNetworkAreaRoutePayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAreaRoutePayload) GetIpv4() []Route { + if o == nil || IsNil(o.Ipv4) { + var ret []Route + return ret + } + return o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRoutePayload) GetIpv4Ok() ([]Route, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAreaRoutePayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given []Route and assigns it to the Ipv4 field. +func (o *CreateNetworkAreaRoutePayload) SetIpv4(v []Route) { + o.Ipv4 = v +} + +func (o CreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableCreateNetworkAreaRoutePayload struct { + value *CreateNetworkAreaRoutePayload + isSet bool +} + +func (v NullableCreateNetworkAreaRoutePayload) Get() *CreateNetworkAreaRoutePayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRoutePayload) Set(val *CreateNetworkAreaRoutePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRoutePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRoutePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRoutePayload(val *CreateNetworkAreaRoutePayload) *NullableCreateNetworkAreaRoutePayload { + return &NullableCreateNetworkAreaRoutePayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_network_ipv4_body.go b/services/iaas/v1api/model_create_network_ipv4_body.go new file mode 100644 index 000000000..658625392 --- /dev/null +++ b/services/iaas/v1api/model_create_network_ipv4_body.go @@ -0,0 +1,247 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateNetworkIPv4Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4Body{} + +// CreateNetworkIPv4Body The config object for an IPv4 network. +type CreateNetworkIPv4Body struct { + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + // Classless Inter-Domain Routing (CIDR). + Prefix *string `json:"prefix,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PrefixLength *int32 `json:"prefixLength,omitempty"` +} + +// NewCreateNetworkIPv4Body instantiates a new CreateNetworkIPv4Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4Body() *CreateNetworkIPv4Body { + this := CreateNetworkIPv4Body{} + return &this +} + +// NewCreateNetworkIPv4BodyWithDefaults instantiates a new CreateNetworkIPv4Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4BodyWithDefaults() *CreateNetworkIPv4Body { + this := CreateNetworkIPv4Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv4Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv4Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv4Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *CreateNetworkIPv4Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv4Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv4Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4Body) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *CreateNetworkIPv4Body) GetPrefix() string { + if o == nil || IsNil(o.Prefix) { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4Body) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *CreateNetworkIPv4Body) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *CreateNetworkIPv4Body) SetPrefix(v string) { + o.Prefix = &v +} + +// GetPrefixLength returns the PrefixLength field value if set, zero value otherwise. +func (o *CreateNetworkIPv4Body) GetPrefixLength() int32 { + if o == nil || IsNil(o.PrefixLength) { + var ret int32 + return ret + } + return *o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4Body) GetPrefixLengthOk() (*int32, bool) { + if o == nil || IsNil(o.PrefixLength) { + return nil, false + } + return o.PrefixLength, true +} + +// HasPrefixLength returns a boolean if a field has been set. +func (o *CreateNetworkIPv4Body) HasPrefixLength() bool { + if o != nil && !IsNil(o.PrefixLength) { + return true + } + + return false +} + +// SetPrefixLength gets a reference to the given int32 and assigns it to the PrefixLength field. +func (o *CreateNetworkIPv4Body) SetPrefixLength(v int32) { + o.PrefixLength = &v +} + +func (o CreateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if !IsNil(o.PrefixLength) { + toSerialize["prefixLength"] = o.PrefixLength + } + return toSerialize, nil +} + +type NullableCreateNetworkIPv4Body struct { + value *CreateNetworkIPv4Body + isSet bool +} + +func (v NullableCreateNetworkIPv4Body) Get() *CreateNetworkIPv4Body { + return v.value +} + +func (v *NullableCreateNetworkIPv4Body) Set(val *CreateNetworkIPv4Body) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4Body) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4Body(val *CreateNetworkIPv4Body) *NullableCreateNetworkIPv4Body { + return &NullableCreateNetworkIPv4Body{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_network_ipv6_body.go b/services/iaas/v1api/model_create_network_ipv6_body.go new file mode 100644 index 000000000..b52f630bd --- /dev/null +++ b/services/iaas/v1api/model_create_network_ipv6_body.go @@ -0,0 +1,247 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateNetworkIPv6Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6Body{} + +// CreateNetworkIPv6Body The config object for an IPv6 network. +type CreateNetworkIPv6Body struct { + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + // Classless Inter-Domain Routing (CIDR) for IPv6. + Prefix *string `json:"prefix,omitempty" validate:"regexp=^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PrefixLength *int32 `json:"prefixLength,omitempty"` +} + +// NewCreateNetworkIPv6Body instantiates a new CreateNetworkIPv6Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6Body() *CreateNetworkIPv6Body { + this := CreateNetworkIPv6Body{} + return &this +} + +// NewCreateNetworkIPv6BodyWithDefaults instantiates a new CreateNetworkIPv6Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6BodyWithDefaults() *CreateNetworkIPv6Body { + this := CreateNetworkIPv6Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv6Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv6Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv6Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *CreateNetworkIPv6Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv6Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv6Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6Body) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *CreateNetworkIPv6Body) GetPrefix() string { + if o == nil || IsNil(o.Prefix) { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6Body) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *CreateNetworkIPv6Body) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *CreateNetworkIPv6Body) SetPrefix(v string) { + o.Prefix = &v +} + +// GetPrefixLength returns the PrefixLength field value if set, zero value otherwise. +func (o *CreateNetworkIPv6Body) GetPrefixLength() int32 { + if o == nil || IsNil(o.PrefixLength) { + var ret int32 + return ret + } + return *o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6Body) GetPrefixLengthOk() (*int32, bool) { + if o == nil || IsNil(o.PrefixLength) { + return nil, false + } + return o.PrefixLength, true +} + +// HasPrefixLength returns a boolean if a field has been set. +func (o *CreateNetworkIPv6Body) HasPrefixLength() bool { + if o != nil && !IsNil(o.PrefixLength) { + return true + } + + return false +} + +// SetPrefixLength gets a reference to the given int32 and assigns it to the PrefixLength field. +func (o *CreateNetworkIPv6Body) SetPrefixLength(v int32) { + o.PrefixLength = &v +} + +func (o CreateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if !IsNil(o.PrefixLength) { + toSerialize["prefixLength"] = o.PrefixLength + } + return toSerialize, nil +} + +type NullableCreateNetworkIPv6Body struct { + value *CreateNetworkIPv6Body + isSet bool +} + +func (v NullableCreateNetworkIPv6Body) Get() *CreateNetworkIPv6Body { + return v.value +} + +func (v *NullableCreateNetworkIPv6Body) Set(val *CreateNetworkIPv6Body) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6Body) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6Body(val *CreateNetworkIPv6Body) *NullableCreateNetworkIPv6Body { + return &NullableCreateNetworkIPv6Body{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_network_payload.go b/services/iaas/v1api/model_create_network_payload.go new file mode 100644 index 000000000..700c47e30 --- /dev/null +++ b/services/iaas/v1api/model_create_network_payload.go @@ -0,0 +1,309 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkPayload{} + +// CreateNetworkPayload Object that represents the request body for a network create. +type CreateNetworkPayload struct { + AddressFamily *CreateNetworkAddressFamily `json:"addressFamily,omitempty"` + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` +} + +type _CreateNetworkPayload CreateNetworkPayload + +// NewCreateNetworkPayload instantiates a new CreateNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkPayload(name string) *CreateNetworkPayload { + this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + this.Name = name + return &this +} + +// NewCreateNetworkPayloadWithDefaults instantiates a new CreateNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { + this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetAddressFamily() CreateNetworkAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret CreateNetworkAddressFamily + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetAddressFamilyOk() (*CreateNetworkAddressFamily, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given CreateNetworkAddressFamily and assigns it to the AddressFamily field. +func (o *CreateNetworkPayload) SetAddressFamily(v CreateNetworkAddressFamily) { + o.AddressFamily = &v +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *CreateNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkPayload) SetName(v string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *CreateNetworkPayload) SetRouted(v bool) { + o.Routed = &v +} + +func (o CreateNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["addressFamily"] = o.AddressFamily + } + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + return toSerialize, nil +} + +func (o *CreateNetworkPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkPayload := _CreateNetworkPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkPayload) + + if err != nil { + return err + } + + *o = CreateNetworkPayload(varCreateNetworkPayload) + + return err +} + +type NullableCreateNetworkPayload struct { + value *CreateNetworkPayload + isSet bool +} + +func (v NullableCreateNetworkPayload) Get() *CreateNetworkPayload { + return v.value +} + +func (v *NullableCreateNetworkPayload) Set(val *CreateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkPayload(val *CreateNetworkPayload) *NullableCreateNetworkPayload { + return &NullableCreateNetworkPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_nic_payload.go b/services/iaas/v1api/model_create_nic_payload.go new file mode 100644 index 000000000..23d16dfcc --- /dev/null +++ b/services/iaas/v1api/model_create_nic_payload.go @@ -0,0 +1,611 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateNicPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNicPayload{} + +// CreateNicPayload Object that represents a network interface. +type CreateNicPayload struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Device *string `json:"device,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents an MAC address. + Mac *string `json:"mac,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` + // Possible values: `ACTIVE`, `DOWN`. + Status *string `json:"status,omitempty"` + // Possible values: `server`, `metadata`, `gateway`, `none`. + Type *string `json:"type,omitempty"` +} + +// NewCreateNicPayload instantiates a new CreateNicPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNicPayload() *CreateNicPayload { + this := CreateNicPayload{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// NewCreateNicPayloadWithDefaults instantiates a new CreateNicPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNicPayloadWithDefaults() *CreateNicPayload { + this := CreateNicPayload{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *CreateNicPayload) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *CreateNicPayload) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *CreateNicPayload) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateNicPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateNicPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateNicPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *CreateNicPayload) GetDevice() string { + if o == nil || IsNil(o.Device) { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetDeviceOk() (*string, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *CreateNicPayload) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *CreateNicPayload) SetDevice(v string) { + o.Device = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateNicPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateNicPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateNicPayload) SetId(v string) { + o.Id = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNicPayload) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNicPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *CreateNicPayload) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNicPayload) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNicPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *CreateNicPayload) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNicPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNicPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNicPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMac returns the Mac field value if set, zero value otherwise. +func (o *CreateNicPayload) GetMac() string { + if o == nil || IsNil(o.Mac) { + var ret string + return ret + } + return *o.Mac +} + +// GetMacOk returns a tuple with the Mac field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetMacOk() (*string, bool) { + if o == nil || IsNil(o.Mac) { + return nil, false + } + return o.Mac, true +} + +// HasMac returns a boolean if a field has been set. +func (o *CreateNicPayload) HasMac() bool { + if o != nil && !IsNil(o.Mac) { + return true + } + + return false +} + +// SetMac gets a reference to the given string and assigns it to the Mac field. +func (o *CreateNicPayload) SetMac(v string) { + o.Mac = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateNicPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateNicPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateNicPayload) SetName(v string) { + o.Name = &v +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *CreateNicPayload) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *CreateNicPayload) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *CreateNicPayload) SetNetworkId(v string) { + o.NetworkId = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *CreateNicPayload) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *CreateNicPayload) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *CreateNicPayload) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *CreateNicPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *CreateNicPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *CreateNicPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateNicPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateNicPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateNicPayload) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreateNicPayload) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CreateNicPayload) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CreateNicPayload) SetType(v string) { + o.Type = &v +} + +func (o CreateNicPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNicPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Mac) { + toSerialize["mac"] = o.Mac + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableCreateNicPayload struct { + value *CreateNicPayload + isSet bool +} + +func (v NullableCreateNicPayload) Get() *CreateNicPayload { + return v.value +} + +func (v *NullableCreateNicPayload) Set(val *CreateNicPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNicPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNicPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNicPayload(val *CreateNicPayload) *NullableCreateNicPayload { + return &NullableCreateNicPayload{value: val, isSet: true} +} + +func (v NullableCreateNicPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNicPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_protocol.go b/services/iaas/v1api/model_create_protocol.go new file mode 100644 index 000000000..556127128 --- /dev/null +++ b/services/iaas/v1api/model_create_protocol.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CreateProtocol - The schema for a protocol when creating a security group rule. +type CreateProtocol struct { + Int64 *int64 + String *string +} + +// int64AsCreateProtocol is a convenience function that returns int64 wrapped in CreateProtocol +func Int64AsCreateProtocol(v *int64) CreateProtocol { + return CreateProtocol{ + Int64: v, + } +} + +// stringAsCreateProtocol is a convenience function that returns string wrapped in CreateProtocol +func StringAsCreateProtocol(v *string) CreateProtocol { + return CreateProtocol{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Int64 + err = json.Unmarshal(data, &dst.Int64) + if err == nil { + jsonInt64, _ := json.Marshal(dst.Int64) + if string(jsonInt64) == "{}" { // empty struct + dst.Int64 = nil + } else { + match++ + } + } else { + dst.Int64 = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Int64 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateProtocol)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateProtocol)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateProtocol) MarshalJSON() ([]byte, error) { + if src.Int64 != nil { + return json.Marshal(&src.Int64) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateProtocol) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.Int64 != nil { + return obj.Int64 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateProtocol) GetActualInstanceValue() interface{} { + if obj.Int64 != nil { + return *obj.Int64 + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableCreateProtocol struct { + value *CreateProtocol + isSet bool +} + +func (v NullableCreateProtocol) Get() *CreateProtocol { + return v.value +} + +func (v *NullableCreateProtocol) Set(val *CreateProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableCreateProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateProtocol(val *CreateProtocol) *NullableCreateProtocol { + return &NullableCreateProtocol{value: val, isSet: true} +} + +func (v NullableCreateProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_public_ip_payload.go b/services/iaas/v1api/model_create_public_ip_payload.go new file mode 100644 index 000000000..94f903512 --- /dev/null +++ b/services/iaas/v1api/model_create_public_ip_payload.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreatePublicIPPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreatePublicIPPayload{} + +// CreatePublicIPPayload Object that represents a public IP. +type CreatePublicIPPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ip *string `json:"ip,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewCreatePublicIPPayload instantiates a new CreatePublicIPPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreatePublicIPPayload() *CreatePublicIPPayload { + this := CreatePublicIPPayload{} + return &this +} + +// NewCreatePublicIPPayloadWithDefaults instantiates a new CreatePublicIPPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreatePublicIPPayloadWithDefaults() *CreatePublicIPPayload { + this := CreatePublicIPPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreatePublicIPPayload) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *CreatePublicIPPayload) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreatePublicIPPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreatePublicIPPayload) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *CreatePublicIPPayload) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *CreatePublicIPPayload) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *CreatePublicIPPayload) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o CreatePublicIPPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreatePublicIPPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullableCreatePublicIPPayload struct { + value *CreatePublicIPPayload + isSet bool +} + +func (v NullableCreatePublicIPPayload) Get() *CreatePublicIPPayload { + return v.value +} + +func (v *NullableCreatePublicIPPayload) Set(val *CreatePublicIPPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreatePublicIPPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreatePublicIPPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreatePublicIPPayload(val *CreatePublicIPPayload) *NullableCreatePublicIPPayload { + return &NullableCreatePublicIPPayload{value: val, isSet: true} +} + +func (v NullableCreatePublicIPPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreatePublicIPPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_security_group_payload.go b/services/iaas/v1api/model_create_security_group_payload.go new file mode 100644 index 000000000..52cb21f28 --- /dev/null +++ b/services/iaas/v1api/model_create_security_group_payload.go @@ -0,0 +1,422 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateSecurityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupPayload{} + +// CreateSecurityGroupPayload Object that represents a security group. +type CreateSecurityGroupPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A list containing security group rule objects. + Rules []SecurityGroupRule `json:"rules,omitempty"` + // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. + Stateful *bool `json:"stateful,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateSecurityGroupPayload CreateSecurityGroupPayload + +// NewCreateSecurityGroupPayload instantiates a new CreateSecurityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupPayload(name string) *CreateSecurityGroupPayload { + this := CreateSecurityGroupPayload{} + this.Name = name + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// NewCreateSecurityGroupPayloadWithDefaults instantiates a new CreateSecurityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupPayloadWithDefaults() *CreateSecurityGroupPayload { + this := CreateSecurityGroupPayload{} + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateSecurityGroupPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateSecurityGroupPayload) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSecurityGroupPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateSecurityGroupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateSecurityGroupPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateSecurityGroupPayload) SetName(v string) { + o.Name = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetRules() []SecurityGroupRule { + if o == nil || IsNil(o.Rules) { + var ret []SecurityGroupRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetRulesOk() ([]SecurityGroupRule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. +func (o *CreateSecurityGroupPayload) SetRules(v []SecurityGroupRule) { + o.Rules = v +} + +// GetStateful returns the Stateful field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetStateful() bool { + if o == nil || IsNil(o.Stateful) { + var ret bool + return ret + } + return *o.Stateful +} + +// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetStatefulOk() (*bool, bool) { + if o == nil || IsNil(o.Stateful) { + return nil, false + } + return o.Stateful, true +} + +// HasStateful returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasStateful() bool { + if o != nil && !IsNil(o.Stateful) { + return true + } + + return false +} + +// SetStateful gets a reference to the given bool and assigns it to the Stateful field. +func (o *CreateSecurityGroupPayload) SetStateful(v bool) { + o.Stateful = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateSecurityGroupPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + if !IsNil(o.Stateful) { + toSerialize["stateful"] = o.Stateful + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateSecurityGroupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateSecurityGroupPayload := _CreateSecurityGroupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateSecurityGroupPayload) + + if err != nil { + return err + } + + *o = CreateSecurityGroupPayload(varCreateSecurityGroupPayload) + + return err +} + +type NullableCreateSecurityGroupPayload struct { + value *CreateSecurityGroupPayload + isSet bool +} + +func (v NullableCreateSecurityGroupPayload) Get() *CreateSecurityGroupPayload { + return v.value +} + +func (v *NullableCreateSecurityGroupPayload) Set(val *CreateSecurityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupPayload(val *CreateSecurityGroupPayload) *NullableCreateSecurityGroupPayload { + return &NullableCreateSecurityGroupPayload{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_security_group_rule_payload.go b/services/iaas/v1api/model_create_security_group_rule_payload.go new file mode 100644 index 000000000..4612c59f5 --- /dev/null +++ b/services/iaas/v1api/model_create_security_group_rule_payload.go @@ -0,0 +1,567 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateSecurityGroupRulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupRulePayload{} + +// CreateSecurityGroupRulePayload Object that represents a request body for security group rule creation. +type CreateSecurityGroupRulePayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Protocol *CreateProtocol `json:"protocol,omitempty"` +} + +type _CreateSecurityGroupRulePayload CreateSecurityGroupRulePayload + +// NewCreateSecurityGroupRulePayload instantiates a new CreateSecurityGroupRulePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupRulePayload(direction string) *CreateSecurityGroupRulePayload { + this := CreateSecurityGroupRulePayload{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewCreateSecurityGroupRulePayloadWithDefaults instantiates a new CreateSecurityGroupRulePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupRulePayloadWithDefaults() *CreateSecurityGroupRulePayload { + this := CreateSecurityGroupRulePayload{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateSecurityGroupRulePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateSecurityGroupRulePayload) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *CreateSecurityGroupRulePayload) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *CreateSecurityGroupRulePayload) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *CreateSecurityGroupRulePayload) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *CreateSecurityGroupRulePayload) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSecurityGroupRulePayload) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *CreateSecurityGroupRulePayload) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *CreateSecurityGroupRulePayload) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *CreateSecurityGroupRulePayload) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *CreateSecurityGroupRulePayload) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateSecurityGroupRulePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetProtocol() CreateProtocol { + if o == nil || IsNil(o.Protocol) { + var ret CreateProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (*CreateProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +func (o *CreateSecurityGroupRulePayload) SetProtocol(v CreateProtocol) { + o.Protocol = &v +} + +func (o CreateSecurityGroupRulePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +func (o *CreateSecurityGroupRulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateSecurityGroupRulePayload := _CreateSecurityGroupRulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateSecurityGroupRulePayload) + + if err != nil { + return err + } + + *o = CreateSecurityGroupRulePayload(varCreateSecurityGroupRulePayload) + + return err +} + +type NullableCreateSecurityGroupRulePayload struct { + value *CreateSecurityGroupRulePayload + isSet bool +} + +func (v NullableCreateSecurityGroupRulePayload) Get() *CreateSecurityGroupRulePayload { + return v.value +} + +func (v *NullableCreateSecurityGroupRulePayload) Set(val *CreateSecurityGroupRulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupRulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupRulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupRulePayload(val *CreateSecurityGroupRulePayload) *NullableCreateSecurityGroupRulePayload { + return &NullableCreateSecurityGroupRulePayload{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupRulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupRulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_security_group_rule_protocol.go b/services/iaas/v1api/model_create_security_group_rule_protocol.go new file mode 100644 index 000000000..03794a759 --- /dev/null +++ b/services/iaas/v1api/model_create_security_group_rule_protocol.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateSecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupRuleProtocol{} + +// CreateSecurityGroupRuleProtocol The internet protocol which the rule should match. +type CreateSecurityGroupRuleProtocol struct { + Protocol *CreateProtocol `json:"protocol,omitempty"` +} + +// NewCreateSecurityGroupRuleProtocol instantiates a new CreateSecurityGroupRuleProtocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupRuleProtocol() *CreateSecurityGroupRuleProtocol { + this := CreateSecurityGroupRuleProtocol{} + return &this +} + +// NewCreateSecurityGroupRuleProtocolWithDefaults instantiates a new CreateSecurityGroupRuleProtocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupRuleProtocolWithDefaults() *CreateSecurityGroupRuleProtocol { + this := CreateSecurityGroupRuleProtocol{} + return &this +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *CreateSecurityGroupRuleProtocol) GetProtocol() CreateProtocol { + if o == nil || IsNil(o.Protocol) { + var ret CreateProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (*CreateProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *CreateSecurityGroupRuleProtocol) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +func (o *CreateSecurityGroupRuleProtocol) SetProtocol(v CreateProtocol) { + o.Protocol = &v +} + +func (o CreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +type NullableCreateSecurityGroupRuleProtocol struct { + value *CreateSecurityGroupRuleProtocol + isSet bool +} + +func (v NullableCreateSecurityGroupRuleProtocol) Get() *CreateSecurityGroupRuleProtocol { + return v.value +} + +func (v *NullableCreateSecurityGroupRuleProtocol) Set(val *CreateSecurityGroupRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupRuleProtocol(val *CreateSecurityGroupRuleProtocol) *NullableCreateSecurityGroupRuleProtocol { + return &NullableCreateSecurityGroupRuleProtocol{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_server_networking.go b/services/iaas/v1api/model_create_server_networking.go new file mode 100644 index 000000000..aa3634c06 --- /dev/null +++ b/services/iaas/v1api/model_create_server_networking.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateServerNetworking type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerNetworking{} + +// CreateServerNetworking The initial networking setup for the server creation with a network. +type CreateServerNetworking struct { + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewCreateServerNetworking instantiates a new CreateServerNetworking object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerNetworking() *CreateServerNetworking { + this := CreateServerNetworking{} + return &this +} + +// NewCreateServerNetworkingWithDefaults instantiates a new CreateServerNetworking object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerNetworkingWithDefaults() *CreateServerNetworking { + this := CreateServerNetworking{} + return &this +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *CreateServerNetworking) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerNetworking) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *CreateServerNetworking) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *CreateServerNetworking) SetNetworkId(v string) { + o.NetworkId = &v +} + +func (o CreateServerNetworking) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerNetworking) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + return toSerialize, nil +} + +type NullableCreateServerNetworking struct { + value *CreateServerNetworking + isSet bool +} + +func (v NullableCreateServerNetworking) Get() *CreateServerNetworking { + return v.value +} + +func (v *NullableCreateServerNetworking) Set(val *CreateServerNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerNetworking(val *CreateServerNetworking) *NullableCreateServerNetworking { + return &NullableCreateServerNetworking{value: val, isSet: true} +} + +func (v NullableCreateServerNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_server_networking_with_nics.go b/services/iaas/v1api/model_create_server_networking_with_nics.go new file mode 100644 index 000000000..ff550f2e7 --- /dev/null +++ b/services/iaas/v1api/model_create_server_networking_with_nics.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateServerNetworkingWithNics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerNetworkingWithNics{} + +// CreateServerNetworkingWithNics The initial networking setup for the server creation with a network interface. +type CreateServerNetworkingWithNics struct { + // A list of UUIDs. + NicIds []string `json:"nicIds,omitempty"` +} + +// NewCreateServerNetworkingWithNics instantiates a new CreateServerNetworkingWithNics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerNetworkingWithNics() *CreateServerNetworkingWithNics { + this := CreateServerNetworkingWithNics{} + return &this +} + +// NewCreateServerNetworkingWithNicsWithDefaults instantiates a new CreateServerNetworkingWithNics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerNetworkingWithNicsWithDefaults() *CreateServerNetworkingWithNics { + this := CreateServerNetworkingWithNics{} + return &this +} + +// GetNicIds returns the NicIds field value if set, zero value otherwise. +func (o *CreateServerNetworkingWithNics) GetNicIds() []string { + if o == nil || IsNil(o.NicIds) { + var ret []string + return ret + } + return o.NicIds +} + +// GetNicIdsOk returns a tuple with the NicIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerNetworkingWithNics) GetNicIdsOk() ([]string, bool) { + if o == nil || IsNil(o.NicIds) { + return nil, false + } + return o.NicIds, true +} + +// HasNicIds returns a boolean if a field has been set. +func (o *CreateServerNetworkingWithNics) HasNicIds() bool { + if o != nil && !IsNil(o.NicIds) { + return true + } + + return false +} + +// SetNicIds gets a reference to the given []string and assigns it to the NicIds field. +func (o *CreateServerNetworkingWithNics) SetNicIds(v []string) { + o.NicIds = v +} + +func (o CreateServerNetworkingWithNics) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerNetworkingWithNics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NicIds) { + toSerialize["nicIds"] = o.NicIds + } + return toSerialize, nil +} + +type NullableCreateServerNetworkingWithNics struct { + value *CreateServerNetworkingWithNics + isSet bool +} + +func (v NullableCreateServerNetworkingWithNics) Get() *CreateServerNetworkingWithNics { + return v.value +} + +func (v *NullableCreateServerNetworkingWithNics) Set(val *CreateServerNetworkingWithNics) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerNetworkingWithNics) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerNetworkingWithNics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerNetworkingWithNics(val *CreateServerNetworkingWithNics) *NullableCreateServerNetworkingWithNics { + return &NullableCreateServerNetworkingWithNics{value: val, isSet: true} +} + +func (v NullableCreateServerNetworkingWithNics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerNetworkingWithNics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_server_payload.go b/services/iaas/v1api/model_create_server_payload.go new file mode 100644 index 000000000..40d284a85 --- /dev/null +++ b/services/iaas/v1api/model_create_server_payload.go @@ -0,0 +1,998 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerPayload{} + +// CreateServerPayload Representation of a single server object. +type CreateServerPayload struct { + // The affinity group the server is assigned to. + AffinityGroup *string `json:"affinityGroup,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Agent *ServerAgent `json:"agent,omitempty"` + // This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + BootVolume *BootVolume `json:"bootVolume,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // An error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The SSH keypair used during the server creation. + KeypairName *string `json:"keypairName,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Date-time when resource was launched. + LaunchedAt *time.Time `json:"launchedAt,omitempty"` + // Name of the machine type the server shall belong to. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + MaintenanceWindow *ServerMaintenance `json:"maintenanceWindow,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name string `json:"name" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` + Networking *CreateServerPayloadNetworking `json:"networking,omitempty"` + // The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested. + Nics []ServerNetwork `json:"nics,omitempty"` + // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. + PowerStatus *string `json:"powerStatus,omitempty"` + // The initial security groups for the server creation. + SecurityGroups []string `json:"securityGroups,omitempty"` + // A list of service account mails. Only shown when detailed information is requested. + ServiceAccountMails []string `json:"serviceAccountMails,omitempty"` + // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. + UserData *string `json:"userData,omitempty"` + // The list of volumes attached to the server. + Volumes []string `json:"volumes,omitempty"` +} + +type _CreateServerPayload CreateServerPayload + +// NewCreateServerPayload instantiates a new CreateServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerPayload(machineType string, name string) *CreateServerPayload { + this := CreateServerPayload{} + this.MachineType = machineType + this.Name = name + return &this +} + +// NewCreateServerPayloadWithDefaults instantiates a new CreateServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerPayloadWithDefaults() *CreateServerPayload { + this := CreateServerPayload{} + return &this +} + +// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAffinityGroup() string { + if o == nil || IsNil(o.AffinityGroup) { + var ret string + return ret + } + return *o.AffinityGroup +} + +// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAffinityGroupOk() (*string, bool) { + if o == nil || IsNil(o.AffinityGroup) { + return nil, false + } + return o.AffinityGroup, true +} + +// HasAffinityGroup returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAffinityGroup() bool { + if o != nil && !IsNil(o.AffinityGroup) { + return true + } + + return false +} + +// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +func (o *CreateServerPayload) SetAffinityGroup(v string) { + o.AffinityGroup = &v +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAgent() ServerAgent { + if o == nil || IsNil(o.Agent) { + var ret ServerAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAgentOk() (*ServerAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ServerAgent and assigns it to the Agent field. +func (o *CreateServerPayload) SetAgent(v ServerAgent) { + o.Agent = &v +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *CreateServerPayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetBootVolume returns the BootVolume field value if set, zero value otherwise. +func (o *CreateServerPayload) GetBootVolume() BootVolume { + if o == nil || IsNil(o.BootVolume) { + var ret BootVolume + return ret + } + return *o.BootVolume +} + +// GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetBootVolumeOk() (*BootVolume, bool) { + if o == nil || IsNil(o.BootVolume) { + return nil, false + } + return o.BootVolume, true +} + +// HasBootVolume returns a boolean if a field has been set. +func (o *CreateServerPayload) HasBootVolume() bool { + if o != nil && !IsNil(o.BootVolume) { + return true + } + + return false +} + +// SetBootVolume gets a reference to the given BootVolume and assigns it to the BootVolume field. +func (o *CreateServerPayload) SetBootVolume(v BootVolume) { + o.BootVolume = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateServerPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *CreateServerPayload) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *CreateServerPayload) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *CreateServerPayload) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateServerPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateServerPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateServerPayload) SetId(v string) { + o.Id = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *CreateServerPayload) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *CreateServerPayload) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *CreateServerPayload) SetImageId(v string) { + o.ImageId = &v +} + +// GetKeypairName returns the KeypairName field value if set, zero value otherwise. +func (o *CreateServerPayload) GetKeypairName() string { + if o == nil || IsNil(o.KeypairName) { + var ret string + return ret + } + return *o.KeypairName +} + +// GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetKeypairNameOk() (*string, bool) { + if o == nil || IsNil(o.KeypairName) { + return nil, false + } + return o.KeypairName, true +} + +// HasKeypairName returns a boolean if a field has been set. +func (o *CreateServerPayload) HasKeypairName() bool { + if o != nil && !IsNil(o.KeypairName) { + return true + } + + return false +} + +// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. +func (o *CreateServerPayload) SetKeypairName(v string) { + o.KeypairName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateServerPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateServerPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateServerPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetLaunchedAt() time.Time { + if o == nil || IsNil(o.LaunchedAt) { + var ret time.Time + return ret + } + return *o.LaunchedAt +} + +// GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetLaunchedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LaunchedAt) { + return nil, false + } + return o.LaunchedAt, true +} + +// HasLaunchedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasLaunchedAt() bool { + if o != nil && !IsNil(o.LaunchedAt) { + return true + } + + return false +} + +// SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. +func (o *CreateServerPayload) SetLaunchedAt(v time.Time) { + o.LaunchedAt = &v +} + +// GetMachineType returns the MachineType field value +func (o *CreateServerPayload) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *CreateServerPayload) SetMachineType(v string) { + o.MachineType = v +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *CreateServerPayload) GetMaintenanceWindow() ServerMaintenance { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret ServerMaintenance + return ret + } + return *o.MaintenanceWindow +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { + if o == nil || IsNil(o.MaintenanceWindow) { + return nil, false + } + return o.MaintenanceWindow, true +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *CreateServerPayload) HasMaintenanceWindow() bool { + if o != nil && !IsNil(o.MaintenanceWindow) { + return true + } + + return false +} + +// SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. +func (o *CreateServerPayload) SetMaintenanceWindow(v ServerMaintenance) { + o.MaintenanceWindow = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CreateServerPayload) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CreateServerPayload) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CreateServerPayload) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value +func (o *CreateServerPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateServerPayload) SetName(v string) { + o.Name = v +} + +// GetNetworking returns the Networking field value if set, zero value otherwise. +func (o *CreateServerPayload) GetNetworking() CreateServerPayloadNetworking { + if o == nil || IsNil(o.Networking) { + var ret CreateServerPayloadNetworking + return ret + } + return *o.Networking +} + +// GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNetworkingOk() (*CreateServerPayloadNetworking, bool) { + if o == nil || IsNil(o.Networking) { + return nil, false + } + return o.Networking, true +} + +// HasNetworking returns a boolean if a field has been set. +func (o *CreateServerPayload) HasNetworking() bool { + if o != nil && !IsNil(o.Networking) { + return true + } + + return false +} + +// SetNetworking gets a reference to the given CreateServerPayloadNetworking and assigns it to the Networking field. +func (o *CreateServerPayload) SetNetworking(v CreateServerPayloadNetworking) { + o.Networking = &v +} + +// GetNics returns the Nics field value if set, zero value otherwise. +func (o *CreateServerPayload) GetNics() []ServerNetwork { + if o == nil || IsNil(o.Nics) { + var ret []ServerNetwork + return ret + } + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNicsOk() ([]ServerNetwork, bool) { + if o == nil || IsNil(o.Nics) { + return nil, false + } + return o.Nics, true +} + +// HasNics returns a boolean if a field has been set. +func (o *CreateServerPayload) HasNics() bool { + if o != nil && !IsNil(o.Nics) { + return true + } + + return false +} + +// SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. +func (o *CreateServerPayload) SetNics(v []ServerNetwork) { + o.Nics = v +} + +// GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. +func (o *CreateServerPayload) GetPowerStatus() string { + if o == nil || IsNil(o.PowerStatus) { + var ret string + return ret + } + return *o.PowerStatus +} + +// GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetPowerStatusOk() (*string, bool) { + if o == nil || IsNil(o.PowerStatus) { + return nil, false + } + return o.PowerStatus, true +} + +// HasPowerStatus returns a boolean if a field has been set. +func (o *CreateServerPayload) HasPowerStatus() bool { + if o != nil && !IsNil(o.PowerStatus) { + return true + } + + return false +} + +// SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. +func (o *CreateServerPayload) SetPowerStatus(v string) { + o.PowerStatus = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *CreateServerPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *CreateServerPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *CreateServerPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. +func (o *CreateServerPayload) GetServiceAccountMails() []string { + if o == nil || IsNil(o.ServiceAccountMails) { + var ret []string + return ret + } + return o.ServiceAccountMails +} + +// GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetServiceAccountMailsOk() ([]string, bool) { + if o == nil || IsNil(o.ServiceAccountMails) { + return nil, false + } + return o.ServiceAccountMails, true +} + +// HasServiceAccountMails returns a boolean if a field has been set. +func (o *CreateServerPayload) HasServiceAccountMails() bool { + if o != nil && !IsNil(o.ServiceAccountMails) { + return true + } + + return false +} + +// SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. +func (o *CreateServerPayload) SetServiceAccountMails(v []string) { + o.ServiceAccountMails = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateServerPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateServerPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateServerPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateServerPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *CreateServerPayload) GetUserData() string { + if o == nil || IsNil(o.UserData) { + var ret string + return ret + } + return *o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetUserDataOk() (*string, bool) { + if o == nil || IsNil(o.UserData) { + return nil, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *CreateServerPayload) HasUserData() bool { + if o != nil && !IsNil(o.UserData) { + return true + } + + return false +} + +// SetUserData gets a reference to the given string and assigns it to the UserData field. +func (o *CreateServerPayload) SetUserData(v string) { + o.UserData = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *CreateServerPayload) GetVolumes() []string { + if o == nil || IsNil(o.Volumes) { + var ret []string + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetVolumesOk() ([]string, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *CreateServerPayload) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +func (o *CreateServerPayload) SetVolumes(v []string) { + o.Volumes = v +} + +func (o CreateServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AffinityGroup) { + toSerialize["affinityGroup"] = o.AffinityGroup + } + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.BootVolume) { + toSerialize["bootVolume"] = o.BootVolume + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.KeypairName) { + toSerialize["keypairName"] = o.KeypairName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.LaunchedAt) { + toSerialize["launchedAt"] = o.LaunchedAt + } + toSerialize["machineType"] = o.MachineType + if !IsNil(o.MaintenanceWindow) { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + toSerialize["name"] = o.Name + if !IsNil(o.Networking) { + toSerialize["networking"] = o.Networking + } + if !IsNil(o.Nics) { + toSerialize["nics"] = o.Nics + } + if !IsNil(o.PowerStatus) { + toSerialize["powerStatus"] = o.PowerStatus + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.ServiceAccountMails) { + toSerialize["serviceAccountMails"] = o.ServiceAccountMails + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.UserData) { + toSerialize["userData"] = o.UserData + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + return toSerialize, nil +} + +func (o *CreateServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateServerPayload := _CreateServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateServerPayload) + + if err != nil { + return err + } + + *o = CreateServerPayload(varCreateServerPayload) + + return err +} + +type NullableCreateServerPayload struct { + value *CreateServerPayload + isSet bool +} + +func (v NullableCreateServerPayload) Get() *CreateServerPayload { + return v.value +} + +func (v *NullableCreateServerPayload) Set(val *CreateServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerPayload(val *CreateServerPayload) *NullableCreateServerPayload { + return &NullableCreateServerPayload{value: val, isSet: true} +} + +func (v NullableCreateServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_server_payload_networking.go b/services/iaas/v1api/model_create_server_payload_networking.go new file mode 100644 index 000000000..aaa9ac5b7 --- /dev/null +++ b/services/iaas/v1api/model_create_server_payload_networking.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// CreateServerPayloadNetworking - The initial networking setup for the server creation. A network, a nic or nothing can be given. +type CreateServerPayloadNetworking struct { + CreateServerNetworking *CreateServerNetworking + CreateServerNetworkingWithNics *CreateServerNetworkingWithNics +} + +// CreateServerNetworkingAsCreateServerPayloadNetworking is a convenience function that returns CreateServerNetworking wrapped in CreateServerPayloadNetworking +func CreateServerNetworkingAsCreateServerPayloadNetworking(v *CreateServerNetworking) CreateServerPayloadNetworking { + return CreateServerPayloadNetworking{ + CreateServerNetworking: v, + } +} + +// CreateServerNetworkingWithNicsAsCreateServerPayloadNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in CreateServerPayloadNetworking +func CreateServerNetworkingWithNicsAsCreateServerPayloadNetworking(v *CreateServerNetworkingWithNics) CreateServerPayloadNetworking { + return CreateServerPayloadNetworking{ + CreateServerNetworkingWithNics: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateServerPayloadNetworking) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateServerNetworking + err = json.Unmarshal(data, &dst.CreateServerNetworking) + if err == nil { + jsonCreateServerNetworking, _ := json.Marshal(dst.CreateServerNetworking) + if string(jsonCreateServerNetworking) == "{}" { // empty struct + dst.CreateServerNetworking = nil + } else { + match++ + } + } else { + dst.CreateServerNetworking = nil + } + + // try to unmarshal data into CreateServerNetworkingWithNics + err = json.Unmarshal(data, &dst.CreateServerNetworkingWithNics) + if err == nil { + jsonCreateServerNetworkingWithNics, _ := json.Marshal(dst.CreateServerNetworkingWithNics) + if string(jsonCreateServerNetworkingWithNics) == "{}" { // empty struct + dst.CreateServerNetworkingWithNics = nil + } else { + match++ + } + } else { + dst.CreateServerNetworkingWithNics = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateServerNetworking = nil + dst.CreateServerNetworkingWithNics = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateServerPayloadNetworking)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateServerPayloadNetworking)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateServerPayloadNetworking) MarshalJSON() ([]byte, error) { + if src.CreateServerNetworking != nil { + return json.Marshal(&src.CreateServerNetworking) + } + + if src.CreateServerNetworkingWithNics != nil { + return json.Marshal(&src.CreateServerNetworkingWithNics) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateServerPayloadNetworking) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateServerNetworking != nil { + return obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateServerPayloadNetworking) GetActualInstanceValue() interface{} { + if obj.CreateServerNetworking != nil { + return *obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return *obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +type NullableCreateServerPayloadNetworking struct { + value *CreateServerPayloadNetworking + isSet bool +} + +func (v NullableCreateServerPayloadNetworking) Get() *CreateServerPayloadNetworking { + return v.value +} + +func (v *NullableCreateServerPayloadNetworking) Set(val *CreateServerPayloadNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerPayloadNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerPayloadNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerPayloadNetworking(val *CreateServerPayloadNetworking) *NullableCreateServerPayloadNetworking { + return &NullableCreateServerPayloadNetworking{value: val, isSet: true} +} + +func (v NullableCreateServerPayloadNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerPayloadNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_snapshot_payload.go b/services/iaas/v1api/model_create_snapshot_payload.go new file mode 100644 index 000000000..ed80b8e95 --- /dev/null +++ b/services/iaas/v1api/model_create_snapshot_payload.go @@ -0,0 +1,418 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSnapshotPayload{} + +// CreateSnapshotPayload Object that represents a snapshot. +type CreateSnapshotPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId string `json:"volumeId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _CreateSnapshotPayload CreateSnapshotPayload + +// NewCreateSnapshotPayload instantiates a new CreateSnapshotPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSnapshotPayload(volumeId string) *CreateSnapshotPayload { + this := CreateSnapshotPayload{} + this.VolumeId = volumeId + return &this +} + +// NewCreateSnapshotPayloadWithDefaults instantiates a new CreateSnapshotPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSnapshotPayloadWithDefaults() *CreateSnapshotPayload { + this := CreateSnapshotPayload{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateSnapshotPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSnapshotPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateSnapshotPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateSnapshotPayload) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateSnapshotPayload) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateSnapshotPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateSnapshotPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value +func (o *CreateSnapshotPayload) GetVolumeId() string { + if o == nil { + var ret string + return ret + } + + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VolumeId, true +} + +// SetVolumeId sets field value +func (o *CreateSnapshotPayload) SetVolumeId(v string) { + o.VolumeId = v +} + +func (o CreateSnapshotPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + toSerialize["volumeId"] = o.VolumeId + return toSerialize, nil +} + +func (o *CreateSnapshotPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "volumeId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateSnapshotPayload := _CreateSnapshotPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateSnapshotPayload) + + if err != nil { + return err + } + + *o = CreateSnapshotPayload(varCreateSnapshotPayload) + + return err +} + +type NullableCreateSnapshotPayload struct { + value *CreateSnapshotPayload + isSet bool +} + +func (v NullableCreateSnapshotPayload) Get() *CreateSnapshotPayload { + return v.value +} + +func (v *NullableCreateSnapshotPayload) Set(val *CreateSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSnapshotPayload(val *CreateSnapshotPayload) *NullableCreateSnapshotPayload { + return &NullableCreateSnapshotPayload{value: val, isSet: true} +} + +func (v NullableCreateSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_create_volume_payload.go b/services/iaas/v1api/model_create_volume_payload.go new file mode 100644 index 000000000..ba96d0b35 --- /dev/null +++ b/services/iaas/v1api/model_create_volume_payload.go @@ -0,0 +1,711 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateVolumePayload{} + +// CreateVolumePayload Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. +type CreateVolumePayload struct { + // Object that represents an availability zone. + AvailabilityZone string `json:"availabilityZone"` + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionParameters *VolumeEncryptionParameter `json:"encryptionParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *VolumeSource `json:"source,omitempty"` + // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateVolumePayload CreateVolumePayload + +// NewCreateVolumePayload instantiates a new CreateVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateVolumePayload(availabilityZone string) *CreateVolumePayload { + this := CreateVolumePayload{} + this.AvailabilityZone = availabilityZone + return &this +} + +// NewCreateVolumePayloadWithDefaults instantiates a new CreateVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateVolumePayloadWithDefaults() *CreateVolumePayload { + this := CreateVolumePayload{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value +func (o *CreateVolumePayload) GetAvailabilityZone() string { + if o == nil { + var ret string + return ret + } + + return o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailabilityZone, true +} + +// SetAvailabilityZone sets field value +func (o *CreateVolumePayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = v +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *CreateVolumePayload) SetBootable(v bool) { + o.Bootable = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateVolumePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateVolumePayload) SetDescription(v string) { + o.Description = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *CreateVolumePayload) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetEncryptionParameters returns the EncryptionParameters field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetEncryptionParameters() VolumeEncryptionParameter { + if o == nil || IsNil(o.EncryptionParameters) { + var ret VolumeEncryptionParameter + return ret + } + return *o.EncryptionParameters +} + +// GetEncryptionParametersOk returns a tuple with the EncryptionParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetEncryptionParametersOk() (*VolumeEncryptionParameter, bool) { + if o == nil || IsNil(o.EncryptionParameters) { + return nil, false + } + return o.EncryptionParameters, true +} + +// HasEncryptionParameters returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasEncryptionParameters() bool { + if o != nil && !IsNil(o.EncryptionParameters) { + return true + } + + return false +} + +// SetEncryptionParameters gets a reference to the given VolumeEncryptionParameter and assigns it to the EncryptionParameters field. +func (o *CreateVolumePayload) SetEncryptionParameters(v VolumeEncryptionParameter) { + o.EncryptionParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateVolumePayload) SetId(v string) { + o.Id = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *CreateVolumePayload) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateVolumePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateVolumePayload) SetName(v string) { + o.Name = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *CreateVolumePayload) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *CreateVolumePayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateVolumePayload) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetSource() VolumeSource { + if o == nil || IsNil(o.Source) { + var ret VolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetSourceOk() (*VolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given VolumeSource and assigns it to the Source field. +func (o *CreateVolumePayload) SetSource(v VolumeSource) { + o.Source = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateVolumePayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateVolumePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["availabilityZone"] = o.AvailabilityZone + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.EncryptionParameters) { + toSerialize["encryptionParameters"] = o.EncryptionParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateVolumePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "availabilityZone", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateVolumePayload := _CreateVolumePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateVolumePayload) + + if err != nil { + return err + } + + *o = CreateVolumePayload(varCreateVolumePayload) + + return err +} + +type NullableCreateVolumePayload struct { + value *CreateVolumePayload + isSet bool +} + +func (v NullableCreateVolumePayload) Get() *CreateVolumePayload { + return v.value +} + +func (v *NullableCreateVolumePayload) Set(val *CreateVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateVolumePayload(val *CreateVolumePayload) *NullableCreateVolumePayload { + return &NullableCreateVolumePayload{value: val, isSet: true} +} + +func (v NullableCreateVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_error.go b/services/iaas/v1api/model_error.go new file mode 100644 index 000000000..d570ef9d8 --- /dev/null +++ b/services/iaas/v1api/model_error.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error Error with HTTP error code and an error message. +type Error struct { + Code int64 `json:"code"` + // An error message. + Msg string `json:"msg"` +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(code int64, msg string) *Error { + this := Error{} + this.Code = code + this.Msg = msg + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetCode returns the Code field value +func (o *Error) GetCode() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *Error) GetCodeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *Error) SetCode(v int64) { + o.Code = v +} + +// GetMsg returns the Msg field value +func (o *Error) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *Error) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *Error) SetMsg(v string) { + o.Msg = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "msg", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varError) + + if err != nil { + return err + } + + *o = Error(varError) + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_get_server_log_200_response.go b/services/iaas/v1api/model_get_server_log_200_response.go new file mode 100644 index 000000000..e375e29ae --- /dev/null +++ b/services/iaas/v1api/model_get_server_log_200_response.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetServerLog200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetServerLog200Response{} + +// GetServerLog200Response struct for GetServerLog200Response +type GetServerLog200Response struct { + Output *string `json:"output,omitempty"` +} + +// NewGetServerLog200Response instantiates a new GetServerLog200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetServerLog200Response() *GetServerLog200Response { + this := GetServerLog200Response{} + return &this +} + +// NewGetServerLog200ResponseWithDefaults instantiates a new GetServerLog200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetServerLog200ResponseWithDefaults() *GetServerLog200Response { + this := GetServerLog200Response{} + return &this +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *GetServerLog200Response) GetOutput() string { + if o == nil || IsNil(o.Output) { + var ret string + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServerLog200Response) GetOutputOk() (*string, bool) { + if o == nil || IsNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *GetServerLog200Response) HasOutput() bool { + if o != nil && !IsNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given string and assigns it to the Output field. +func (o *GetServerLog200Response) SetOutput(v string) { + o.Output = &v +} + +func (o GetServerLog200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetServerLog200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Output) { + toSerialize["output"] = o.Output + } + return toSerialize, nil +} + +type NullableGetServerLog200Response struct { + value *GetServerLog200Response + isSet bool +} + +func (v NullableGetServerLog200Response) Get() *GetServerLog200Response { + return v.value +} + +func (v *NullableGetServerLog200Response) Set(val *GetServerLog200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetServerLog200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServerLog200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServerLog200Response(val *GetServerLog200Response) *NullableGetServerLog200Response { + return &NullableGetServerLog200Response{value: val, isSet: true} +} + +func (v NullableGetServerLog200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServerLog200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_icmp_parameters.go b/services/iaas/v1api/model_icmp_parameters.go new file mode 100644 index 000000000..4457a15d0 --- /dev/null +++ b/services/iaas/v1api/model_icmp_parameters.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ICMPParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ICMPParameters{} + +// ICMPParameters Object that represents ICMP parameters. +type ICMPParameters struct { + // ICMP code. Can be set if the protocol is ICMP. + Code int64 `json:"code"` + // ICMP type. Can be set if the protocol is ICMP. + Type int64 `json:"type"` +} + +type _ICMPParameters ICMPParameters + +// NewICMPParameters instantiates a new ICMPParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewICMPParameters(code int64, types int64) *ICMPParameters { + this := ICMPParameters{} + this.Code = code + this.Type = types + return &this +} + +// NewICMPParametersWithDefaults instantiates a new ICMPParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewICMPParametersWithDefaults() *ICMPParameters { + this := ICMPParameters{} + return &this +} + +// GetCode returns the Code field value +func (o *ICMPParameters) GetCode() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *ICMPParameters) GetCodeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *ICMPParameters) SetCode(v int64) { + o.Code = v +} + +// GetType returns the Type field value +func (o *ICMPParameters) GetType() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ICMPParameters) GetTypeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ICMPParameters) SetType(v int64) { + o.Type = v +} + +func (o ICMPParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ICMPParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *ICMPParameters) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varICMPParameters := _ICMPParameters{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varICMPParameters) + + if err != nil { + return err + } + + *o = ICMPParameters(varICMPParameters) + + return err +} + +type NullableICMPParameters struct { + value *ICMPParameters + isSet bool +} + +func (v NullableICMPParameters) Get() *ICMPParameters { + return v.value +} + +func (v *NullableICMPParameters) Set(val *ICMPParameters) { + v.value = val + v.isSet = true +} + +func (v NullableICMPParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableICMPParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableICMPParameters(val *ICMPParameters) *NullableICMPParameters { + return &NullableICMPParameters{value: val, isSet: true} +} + +func (v NullableICMPParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableICMPParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_image.go b/services/iaas/v1api/model_image.go new file mode 100644 index 000000000..600bf02a7 --- /dev/null +++ b/services/iaas/v1api/model_image.go @@ -0,0 +1,740 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Image type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Image{} + +// Image Object that represents an Image and its parameters. Used for Creating and returning (get/list). +type Image struct { + Agent *ImageAgent `json:"agent,omitempty"` + Checksum *ImageChecksum `json:"checksum,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat string `json:"diskFormat"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Indicates Image Import Progress in percent. + ImportProgress *int64 `json:"importProgress,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + Owner *string `json:"owner,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` + // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. + Scope *string `json:"scope,omitempty"` + // Size in bytes. + Size *int64 `json:"size,omitempty"` + // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Image Image + +// NewImage instantiates a new Image object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImage(diskFormat string, name string) *Image { + this := Image{} + this.DiskFormat = diskFormat + this.Name = name + return &this +} + +// NewImageWithDefaults instantiates a new Image object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageWithDefaults() *Image { + this := Image{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *Image) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *Image) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *Image) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *Image) GetChecksum() ImageChecksum { + if o == nil || IsNil(o.Checksum) { + var ret ImageChecksum + return ret + } + return *o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetChecksumOk() (*ImageChecksum, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *Image) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +func (o *Image) SetChecksum(v ImageChecksum) { + o.Checksum = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *Image) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *Image) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *Image) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Image) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Image) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Image) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDiskFormat returns the DiskFormat field value +func (o *Image) GetDiskFormat() string { + if o == nil { + var ret string + return ret + } + + return o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value +// and a boolean to check if the value has been set. +func (o *Image) GetDiskFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DiskFormat, true +} + +// SetDiskFormat sets field value +func (o *Image) SetDiskFormat(v string) { + o.DiskFormat = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Image) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Image) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Image) SetId(v string) { + o.Id = &v +} + +// GetImportProgress returns the ImportProgress field value if set, zero value otherwise. +func (o *Image) GetImportProgress() int64 { + if o == nil || IsNil(o.ImportProgress) { + var ret int64 + return ret + } + return *o.ImportProgress +} + +// GetImportProgressOk returns a tuple with the ImportProgress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetImportProgressOk() (*int64, bool) { + if o == nil || IsNil(o.ImportProgress) { + return nil, false + } + return o.ImportProgress, true +} + +// HasImportProgress returns a boolean if a field has been set. +func (o *Image) HasImportProgress() bool { + if o != nil && !IsNil(o.ImportProgress) { + return true + } + + return false +} + +// SetImportProgress gets a reference to the given int64 and assigns it to the ImportProgress field. +func (o *Image) SetImportProgress(v int64) { + o.ImportProgress = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Image) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Image) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Image) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *Image) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *Image) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *Image) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *Image) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *Image) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *Image) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value +func (o *Image) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Image) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Image) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *Image) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *Image) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *Image) SetOwner(v string) { + o.Owner = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *Image) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *Image) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *Image) SetProtected(v bool) { + o.Protected = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *Image) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *Image) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *Image) SetScope(v string) { + o.Scope = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Image) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Image) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Image) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Image) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Image) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Image) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Image) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Image) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Image) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Image) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Image) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["diskFormat"] = o.DiskFormat + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImportProgress) { + toSerialize["importProgress"] = o.ImportProgress + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Image) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "diskFormat", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImage := _Image{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImage) + + if err != nil { + return err + } + + *o = Image(varImage) + + return err +} + +type NullableImage struct { + value *Image + isSet bool +} + +func (v NullableImage) Get() *Image { + return v.value +} + +func (v *NullableImage) Set(val *Image) { + v.value = val + v.isSet = true +} + +func (v NullableImage) IsSet() bool { + return v.isSet +} + +func (v *NullableImage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImage(val *Image) *NullableImage { + return &NullableImage{value: val, isSet: true} +} + +func (v NullableImage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_image_agent.go b/services/iaas/v1api/model_image_agent.go new file mode 100644 index 000000000..06642cdfc --- /dev/null +++ b/services/iaas/v1api/model_image_agent.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ImageAgent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageAgent{} + +// ImageAgent Support status and default provioning setting for the STACKIT server agent. +type ImageAgent struct { + // Default provioning of the STACKIT server agent for new servers. The default for new images is false. Can only be enabled when supported is also true. + ProvisionByDefault *bool `json:"provisionByDefault,omitempty"` + // Indicates the STACKIT server agent for the image. The default for new images is false. + Supported *bool `json:"supported,omitempty"` +} + +// NewImageAgent instantiates a new ImageAgent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageAgent() *ImageAgent { + this := ImageAgent{} + return &this +} + +// NewImageAgentWithDefaults instantiates a new ImageAgent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageAgentWithDefaults() *ImageAgent { + this := ImageAgent{} + return &this +} + +// GetProvisionByDefault returns the ProvisionByDefault field value if set, zero value otherwise. +func (o *ImageAgent) GetProvisionByDefault() bool { + if o == nil || IsNil(o.ProvisionByDefault) { + var ret bool + return ret + } + return *o.ProvisionByDefault +} + +// GetProvisionByDefaultOk returns a tuple with the ProvisionByDefault field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAgent) GetProvisionByDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.ProvisionByDefault) { + return nil, false + } + return o.ProvisionByDefault, true +} + +// HasProvisionByDefault returns a boolean if a field has been set. +func (o *ImageAgent) HasProvisionByDefault() bool { + if o != nil && !IsNil(o.ProvisionByDefault) { + return true + } + + return false +} + +// SetProvisionByDefault gets a reference to the given bool and assigns it to the ProvisionByDefault field. +func (o *ImageAgent) SetProvisionByDefault(v bool) { + o.ProvisionByDefault = &v +} + +// GetSupported returns the Supported field value if set, zero value otherwise. +func (o *ImageAgent) GetSupported() bool { + if o == nil || IsNil(o.Supported) { + var ret bool + return ret + } + return *o.Supported +} + +// GetSupportedOk returns a tuple with the Supported field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAgent) GetSupportedOk() (*bool, bool) { + if o == nil || IsNil(o.Supported) { + return nil, false + } + return o.Supported, true +} + +// HasSupported returns a boolean if a field has been set. +func (o *ImageAgent) HasSupported() bool { + if o != nil && !IsNil(o.Supported) { + return true + } + + return false +} + +// SetSupported gets a reference to the given bool and assigns it to the Supported field. +func (o *ImageAgent) SetSupported(v bool) { + o.Supported = &v +} + +func (o ImageAgent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageAgent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ProvisionByDefault) { + toSerialize["provisionByDefault"] = o.ProvisionByDefault + } + if !IsNil(o.Supported) { + toSerialize["supported"] = o.Supported + } + return toSerialize, nil +} + +type NullableImageAgent struct { + value *ImageAgent + isSet bool +} + +func (v NullableImageAgent) Get() *ImageAgent { + return v.value +} + +func (v *NullableImageAgent) Set(val *ImageAgent) { + v.value = val + v.isSet = true +} + +func (v NullableImageAgent) IsSet() bool { + return v.isSet +} + +func (v *NullableImageAgent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageAgent(val *ImageAgent) *NullableImageAgent { + return &NullableImageAgent{value: val, isSet: true} +} + +func (v NullableImageAgent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageAgent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_image_checksum.go b/services/iaas/v1api/model_image_checksum.go new file mode 100644 index 000000000..648232271 --- /dev/null +++ b/services/iaas/v1api/model_image_checksum.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageChecksum type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageChecksum{} + +// ImageChecksum Representation of an image checksum. +type ImageChecksum struct { + // Algorithm for the checksum of the image data. Possible values: `md5`, `sha512`. + Algorithm string `json:"algorithm"` + // Hexdigest of the checksum of the image data. + Digest string `json:"digest" validate:"regexp=^[0-9a-f]+$"` +} + +type _ImageChecksum ImageChecksum + +// NewImageChecksum instantiates a new ImageChecksum object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageChecksum(algorithm string, digest string) *ImageChecksum { + this := ImageChecksum{} + this.Algorithm = algorithm + this.Digest = digest + return &this +} + +// NewImageChecksumWithDefaults instantiates a new ImageChecksum object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageChecksumWithDefaults() *ImageChecksum { + this := ImageChecksum{} + return &this +} + +// GetAlgorithm returns the Algorithm field value +func (o *ImageChecksum) GetAlgorithm() string { + if o == nil { + var ret string + return ret + } + + return o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value +// and a boolean to check if the value has been set. +func (o *ImageChecksum) GetAlgorithmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Algorithm, true +} + +// SetAlgorithm sets field value +func (o *ImageChecksum) SetAlgorithm(v string) { + o.Algorithm = v +} + +// GetDigest returns the Digest field value +func (o *ImageChecksum) GetDigest() string { + if o == nil { + var ret string + return ret + } + + return o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value +// and a boolean to check if the value has been set. +func (o *ImageChecksum) GetDigestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Digest, true +} + +// SetDigest sets field value +func (o *ImageChecksum) SetDigest(v string) { + o.Digest = v +} + +func (o ImageChecksum) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageChecksum) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["algorithm"] = o.Algorithm + toSerialize["digest"] = o.Digest + return toSerialize, nil +} + +func (o *ImageChecksum) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "algorithm", + "digest", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageChecksum := _ImageChecksum{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageChecksum) + + if err != nil { + return err + } + + *o = ImageChecksum(varImageChecksum) + + return err +} + +type NullableImageChecksum struct { + value *ImageChecksum + isSet bool +} + +func (v NullableImageChecksum) Get() *ImageChecksum { + return v.value +} + +func (v *NullableImageChecksum) Set(val *ImageChecksum) { + v.value = val + v.isSet = true +} + +func (v NullableImageChecksum) IsSet() bool { + return v.isSet +} + +func (v *NullableImageChecksum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageChecksum(val *ImageChecksum) *NullableImageChecksum { + return &NullableImageChecksum{value: val, isSet: true} +} + +func (v NullableImageChecksum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageChecksum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_image_config.go b/services/iaas/v1api/model_image_config.go new file mode 100644 index 000000000..4a2256d45 --- /dev/null +++ b/services/iaas/v1api/model_image_config.go @@ -0,0 +1,695 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ImageConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageConfig{} + +// ImageConfig Properties to set hardware and scheduling settings for an Image. +type ImageConfig struct { + // Represents CPU architecture. The default for new images is x86. Possible values: `arm64`, `x86`. + Architecture *string `json:"architecture,omitempty"` + // Enables the BIOS bootmenu. The default for new images is disabled. + BootMenu *bool `json:"bootMenu,omitempty"` + // Sets CDROM bus controller type. Possible values: `scsi`, `virtio`, `ide`, `usb`. + CdromBus NullableString `json:"cdromBus,omitempty"` + // Sets Disk bus controller type. Possible values: `scsi`, `virtio`, `ide`, `usb`. + DiskBus NullableString `json:"diskBus,omitempty"` + // Sets virtual nic model. Possible values: `e1000`, `e1000e`, `ne2k_pci`, `pcnet`, `rtl8139`, `virtio`, `vmxnet3`. + NicModel NullableString `json:"nicModel,omitempty"` + // Enables OS specific optimizations. Possible values: `windows`, `linux`. + OperatingSystem *string `json:"operatingSystem,omitempty"` + // Operating System Distribution. + OperatingSystemDistro NullableString `json:"operatingSystemDistro,omitempty"` + // Version of the OS. + OperatingSystemVersion NullableString `json:"operatingSystemVersion,omitempty"` + // Sets the device bus when the image is used as a rescue image. Possible values: `sata`, `scsi`, `virtio`, `usb`. + RescueBus NullableString `json:"rescueBus,omitempty"` + // Sets the device when the image is used as a rescue image. Possible values: `cdrom`, `disk`. + RescueDevice NullableString `json:"rescueDevice,omitempty"` + // Enables Secure Boot. The default for new images is disabled. + SecureBoot *bool `json:"secureBoot,omitempty"` + // Configure UEFI boot. The default for new images is enabled. + Uefi *bool `json:"uefi,omitempty"` + // Sets Graphic device model. Possible values: `vga`, `cirrus`, `vmvga`, `qxl`, `virtio`, `none`. + VideoModel NullableString `json:"videoModel,omitempty"` + // Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO Block. + VirtioScsi *bool `json:"virtioScsi,omitempty"` +} + +// NewImageConfig instantiates a new ImageConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageConfig() *ImageConfig { + this := ImageConfig{} + return &this +} + +// NewImageConfigWithDefaults instantiates a new ImageConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageConfigWithDefaults() *ImageConfig { + this := ImageConfig{} + return &this +} + +// GetArchitecture returns the Architecture field value if set, zero value otherwise. +func (o *ImageConfig) GetArchitecture() string { + if o == nil || IsNil(o.Architecture) { + var ret string + return ret + } + return *o.Architecture +} + +// GetArchitectureOk returns a tuple with the Architecture field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetArchitectureOk() (*string, bool) { + if o == nil || IsNil(o.Architecture) { + return nil, false + } + return o.Architecture, true +} + +// HasArchitecture returns a boolean if a field has been set. +func (o *ImageConfig) HasArchitecture() bool { + if o != nil && !IsNil(o.Architecture) { + return true + } + + return false +} + +// SetArchitecture gets a reference to the given string and assigns it to the Architecture field. +func (o *ImageConfig) SetArchitecture(v string) { + o.Architecture = &v +} + +// GetBootMenu returns the BootMenu field value if set, zero value otherwise. +func (o *ImageConfig) GetBootMenu() bool { + if o == nil || IsNil(o.BootMenu) { + var ret bool + return ret + } + return *o.BootMenu +} + +// GetBootMenuOk returns a tuple with the BootMenu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetBootMenuOk() (*bool, bool) { + if o == nil || IsNil(o.BootMenu) { + return nil, false + } + return o.BootMenu, true +} + +// HasBootMenu returns a boolean if a field has been set. +func (o *ImageConfig) HasBootMenu() bool { + if o != nil && !IsNil(o.BootMenu) { + return true + } + + return false +} + +// SetBootMenu gets a reference to the given bool and assigns it to the BootMenu field. +func (o *ImageConfig) SetBootMenu(v bool) { + o.BootMenu = &v +} + +// GetCdromBus returns the CdromBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetCdromBus() string { + if o == nil || IsNil(o.CdromBus.Get()) { + var ret string + return ret + } + return *o.CdromBus.Get() +} + +// GetCdromBusOk returns a tuple with the CdromBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetCdromBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CdromBus.Get(), o.CdromBus.IsSet() +} + +// HasCdromBus returns a boolean if a field has been set. +func (o *ImageConfig) HasCdromBus() bool { + if o != nil && o.CdromBus.IsSet() { + return true + } + + return false +} + +// SetCdromBus gets a reference to the given NullableString and assigns it to the CdromBus field. +func (o *ImageConfig) SetCdromBus(v string) { + o.CdromBus.Set(&v) +} + +// SetCdromBusNil sets the value for CdromBus to be an explicit nil +func (o *ImageConfig) SetCdromBusNil() { + o.CdromBus.Set(nil) +} + +// UnsetCdromBus ensures that no value is present for CdromBus, not even an explicit nil +func (o *ImageConfig) UnsetCdromBus() { + o.CdromBus.Unset() +} + +// GetDiskBus returns the DiskBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetDiskBus() string { + if o == nil || IsNil(o.DiskBus.Get()) { + var ret string + return ret + } + return *o.DiskBus.Get() +} + +// GetDiskBusOk returns a tuple with the DiskBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetDiskBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DiskBus.Get(), o.DiskBus.IsSet() +} + +// HasDiskBus returns a boolean if a field has been set. +func (o *ImageConfig) HasDiskBus() bool { + if o != nil && o.DiskBus.IsSet() { + return true + } + + return false +} + +// SetDiskBus gets a reference to the given NullableString and assigns it to the DiskBus field. +func (o *ImageConfig) SetDiskBus(v string) { + o.DiskBus.Set(&v) +} + +// SetDiskBusNil sets the value for DiskBus to be an explicit nil +func (o *ImageConfig) SetDiskBusNil() { + o.DiskBus.Set(nil) +} + +// UnsetDiskBus ensures that no value is present for DiskBus, not even an explicit nil +func (o *ImageConfig) UnsetDiskBus() { + o.DiskBus.Unset() +} + +// GetNicModel returns the NicModel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetNicModel() string { + if o == nil || IsNil(o.NicModel.Get()) { + var ret string + return ret + } + return *o.NicModel.Get() +} + +// GetNicModelOk returns a tuple with the NicModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetNicModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NicModel.Get(), o.NicModel.IsSet() +} + +// HasNicModel returns a boolean if a field has been set. +func (o *ImageConfig) HasNicModel() bool { + if o != nil && o.NicModel.IsSet() { + return true + } + + return false +} + +// SetNicModel gets a reference to the given NullableString and assigns it to the NicModel field. +func (o *ImageConfig) SetNicModel(v string) { + o.NicModel.Set(&v) +} + +// SetNicModelNil sets the value for NicModel to be an explicit nil +func (o *ImageConfig) SetNicModelNil() { + o.NicModel.Set(nil) +} + +// UnsetNicModel ensures that no value is present for NicModel, not even an explicit nil +func (o *ImageConfig) UnsetNicModel() { + o.NicModel.Unset() +} + +// GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. +func (o *ImageConfig) GetOperatingSystem() string { + if o == nil || IsNil(o.OperatingSystem) { + var ret string + return ret + } + return *o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetOperatingSystemOk() (*string, bool) { + if o == nil || IsNil(o.OperatingSystem) { + return nil, false + } + return o.OperatingSystem, true +} + +// HasOperatingSystem returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystem() bool { + if o != nil && !IsNil(o.OperatingSystem) { + return true + } + + return false +} + +// SetOperatingSystem gets a reference to the given string and assigns it to the OperatingSystem field. +func (o *ImageConfig) SetOperatingSystem(v string) { + o.OperatingSystem = &v +} + +// GetOperatingSystemDistro returns the OperatingSystemDistro field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetOperatingSystemDistro() string { + if o == nil || IsNil(o.OperatingSystemDistro.Get()) { + var ret string + return ret + } + return *o.OperatingSystemDistro.Get() +} + +// GetOperatingSystemDistroOk returns a tuple with the OperatingSystemDistro field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetOperatingSystemDistroOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OperatingSystemDistro.Get(), o.OperatingSystemDistro.IsSet() +} + +// HasOperatingSystemDistro returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystemDistro() bool { + if o != nil && o.OperatingSystemDistro.IsSet() { + return true + } + + return false +} + +// SetOperatingSystemDistro gets a reference to the given NullableString and assigns it to the OperatingSystemDistro field. +func (o *ImageConfig) SetOperatingSystemDistro(v string) { + o.OperatingSystemDistro.Set(&v) +} + +// SetOperatingSystemDistroNil sets the value for OperatingSystemDistro to be an explicit nil +func (o *ImageConfig) SetOperatingSystemDistroNil() { + o.OperatingSystemDistro.Set(nil) +} + +// UnsetOperatingSystemDistro ensures that no value is present for OperatingSystemDistro, not even an explicit nil +func (o *ImageConfig) UnsetOperatingSystemDistro() { + o.OperatingSystemDistro.Unset() +} + +// GetOperatingSystemVersion returns the OperatingSystemVersion field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetOperatingSystemVersion() string { + if o == nil || IsNil(o.OperatingSystemVersion.Get()) { + var ret string + return ret + } + return *o.OperatingSystemVersion.Get() +} + +// GetOperatingSystemVersionOk returns a tuple with the OperatingSystemVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetOperatingSystemVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OperatingSystemVersion.Get(), o.OperatingSystemVersion.IsSet() +} + +// HasOperatingSystemVersion returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystemVersion() bool { + if o != nil && o.OperatingSystemVersion.IsSet() { + return true + } + + return false +} + +// SetOperatingSystemVersion gets a reference to the given NullableString and assigns it to the OperatingSystemVersion field. +func (o *ImageConfig) SetOperatingSystemVersion(v string) { + o.OperatingSystemVersion.Set(&v) +} + +// SetOperatingSystemVersionNil sets the value for OperatingSystemVersion to be an explicit nil +func (o *ImageConfig) SetOperatingSystemVersionNil() { + o.OperatingSystemVersion.Set(nil) +} + +// UnsetOperatingSystemVersion ensures that no value is present for OperatingSystemVersion, not even an explicit nil +func (o *ImageConfig) UnsetOperatingSystemVersion() { + o.OperatingSystemVersion.Unset() +} + +// GetRescueBus returns the RescueBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetRescueBus() string { + if o == nil || IsNil(o.RescueBus.Get()) { + var ret string + return ret + } + return *o.RescueBus.Get() +} + +// GetRescueBusOk returns a tuple with the RescueBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetRescueBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RescueBus.Get(), o.RescueBus.IsSet() +} + +// HasRescueBus returns a boolean if a field has been set. +func (o *ImageConfig) HasRescueBus() bool { + if o != nil && o.RescueBus.IsSet() { + return true + } + + return false +} + +// SetRescueBus gets a reference to the given NullableString and assigns it to the RescueBus field. +func (o *ImageConfig) SetRescueBus(v string) { + o.RescueBus.Set(&v) +} + +// SetRescueBusNil sets the value for RescueBus to be an explicit nil +func (o *ImageConfig) SetRescueBusNil() { + o.RescueBus.Set(nil) +} + +// UnsetRescueBus ensures that no value is present for RescueBus, not even an explicit nil +func (o *ImageConfig) UnsetRescueBus() { + o.RescueBus.Unset() +} + +// GetRescueDevice returns the RescueDevice field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetRescueDevice() string { + if o == nil || IsNil(o.RescueDevice.Get()) { + var ret string + return ret + } + return *o.RescueDevice.Get() +} + +// GetRescueDeviceOk returns a tuple with the RescueDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetRescueDeviceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RescueDevice.Get(), o.RescueDevice.IsSet() +} + +// HasRescueDevice returns a boolean if a field has been set. +func (o *ImageConfig) HasRescueDevice() bool { + if o != nil && o.RescueDevice.IsSet() { + return true + } + + return false +} + +// SetRescueDevice gets a reference to the given NullableString and assigns it to the RescueDevice field. +func (o *ImageConfig) SetRescueDevice(v string) { + o.RescueDevice.Set(&v) +} + +// SetRescueDeviceNil sets the value for RescueDevice to be an explicit nil +func (o *ImageConfig) SetRescueDeviceNil() { + o.RescueDevice.Set(nil) +} + +// UnsetRescueDevice ensures that no value is present for RescueDevice, not even an explicit nil +func (o *ImageConfig) UnsetRescueDevice() { + o.RescueDevice.Unset() +} + +// GetSecureBoot returns the SecureBoot field value if set, zero value otherwise. +func (o *ImageConfig) GetSecureBoot() bool { + if o == nil || IsNil(o.SecureBoot) { + var ret bool + return ret + } + return *o.SecureBoot +} + +// GetSecureBootOk returns a tuple with the SecureBoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetSecureBootOk() (*bool, bool) { + if o == nil || IsNil(o.SecureBoot) { + return nil, false + } + return o.SecureBoot, true +} + +// HasSecureBoot returns a boolean if a field has been set. +func (o *ImageConfig) HasSecureBoot() bool { + if o != nil && !IsNil(o.SecureBoot) { + return true + } + + return false +} + +// SetSecureBoot gets a reference to the given bool and assigns it to the SecureBoot field. +func (o *ImageConfig) SetSecureBoot(v bool) { + o.SecureBoot = &v +} + +// GetUefi returns the Uefi field value if set, zero value otherwise. +func (o *ImageConfig) GetUefi() bool { + if o == nil || IsNil(o.Uefi) { + var ret bool + return ret + } + return *o.Uefi +} + +// GetUefiOk returns a tuple with the Uefi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetUefiOk() (*bool, bool) { + if o == nil || IsNil(o.Uefi) { + return nil, false + } + return o.Uefi, true +} + +// HasUefi returns a boolean if a field has been set. +func (o *ImageConfig) HasUefi() bool { + if o != nil && !IsNil(o.Uefi) { + return true + } + + return false +} + +// SetUefi gets a reference to the given bool and assigns it to the Uefi field. +func (o *ImageConfig) SetUefi(v bool) { + o.Uefi = &v +} + +// GetVideoModel returns the VideoModel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetVideoModel() string { + if o == nil || IsNil(o.VideoModel.Get()) { + var ret string + return ret + } + return *o.VideoModel.Get() +} + +// GetVideoModelOk returns a tuple with the VideoModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetVideoModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VideoModel.Get(), o.VideoModel.IsSet() +} + +// HasVideoModel returns a boolean if a field has been set. +func (o *ImageConfig) HasVideoModel() bool { + if o != nil && o.VideoModel.IsSet() { + return true + } + + return false +} + +// SetVideoModel gets a reference to the given NullableString and assigns it to the VideoModel field. +func (o *ImageConfig) SetVideoModel(v string) { + o.VideoModel.Set(&v) +} + +// SetVideoModelNil sets the value for VideoModel to be an explicit nil +func (o *ImageConfig) SetVideoModelNil() { + o.VideoModel.Set(nil) +} + +// UnsetVideoModel ensures that no value is present for VideoModel, not even an explicit nil +func (o *ImageConfig) UnsetVideoModel() { + o.VideoModel.Unset() +} + +// GetVirtioScsi returns the VirtioScsi field value if set, zero value otherwise. +func (o *ImageConfig) GetVirtioScsi() bool { + if o == nil || IsNil(o.VirtioScsi) { + var ret bool + return ret + } + return *o.VirtioScsi +} + +// GetVirtioScsiOk returns a tuple with the VirtioScsi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetVirtioScsiOk() (*bool, bool) { + if o == nil || IsNil(o.VirtioScsi) { + return nil, false + } + return o.VirtioScsi, true +} + +// HasVirtioScsi returns a boolean if a field has been set. +func (o *ImageConfig) HasVirtioScsi() bool { + if o != nil && !IsNil(o.VirtioScsi) { + return true + } + + return false +} + +// SetVirtioScsi gets a reference to the given bool and assigns it to the VirtioScsi field. +func (o *ImageConfig) SetVirtioScsi(v bool) { + o.VirtioScsi = &v +} + +func (o ImageConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Architecture) { + toSerialize["architecture"] = o.Architecture + } + if !IsNil(o.BootMenu) { + toSerialize["bootMenu"] = o.BootMenu + } + if o.CdromBus.IsSet() { + toSerialize["cdromBus"] = o.CdromBus.Get() + } + if o.DiskBus.IsSet() { + toSerialize["diskBus"] = o.DiskBus.Get() + } + if o.NicModel.IsSet() { + toSerialize["nicModel"] = o.NicModel.Get() + } + if !IsNil(o.OperatingSystem) { + toSerialize["operatingSystem"] = o.OperatingSystem + } + if o.OperatingSystemDistro.IsSet() { + toSerialize["operatingSystemDistro"] = o.OperatingSystemDistro.Get() + } + if o.OperatingSystemVersion.IsSet() { + toSerialize["operatingSystemVersion"] = o.OperatingSystemVersion.Get() + } + if o.RescueBus.IsSet() { + toSerialize["rescueBus"] = o.RescueBus.Get() + } + if o.RescueDevice.IsSet() { + toSerialize["rescueDevice"] = o.RescueDevice.Get() + } + if !IsNil(o.SecureBoot) { + toSerialize["secureBoot"] = o.SecureBoot + } + if !IsNil(o.Uefi) { + toSerialize["uefi"] = o.Uefi + } + if o.VideoModel.IsSet() { + toSerialize["videoModel"] = o.VideoModel.Get() + } + if !IsNil(o.VirtioScsi) { + toSerialize["virtioScsi"] = o.VirtioScsi + } + return toSerialize, nil +} + +type NullableImageConfig struct { + value *ImageConfig + isSet bool +} + +func (v NullableImageConfig) Get() *ImageConfig { + return v.value +} + +func (v *NullableImageConfig) Set(val *ImageConfig) { + v.value = val + v.isSet = true +} + +func (v NullableImageConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableImageConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageConfig(val *ImageConfig) *NullableImageConfig { + return &NullableImageConfig{value: val, isSet: true} +} + +func (v NullableImageConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_image_create_response.go b/services/iaas/v1api/model_image_create_response.go new file mode 100644 index 000000000..86595c8fa --- /dev/null +++ b/services/iaas/v1api/model_image_create_response.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageCreateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageCreateResponse{} + +// ImageCreateResponse Image creation response. +type ImageCreateResponse struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + UploadUrl string `json:"uploadUrl"` +} + +type _ImageCreateResponse ImageCreateResponse + +// NewImageCreateResponse instantiates a new ImageCreateResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageCreateResponse(id string, uploadUrl string) *ImageCreateResponse { + this := ImageCreateResponse{} + this.Id = id + this.UploadUrl = uploadUrl + return &this +} + +// NewImageCreateResponseWithDefaults instantiates a new ImageCreateResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageCreateResponseWithDefaults() *ImageCreateResponse { + this := ImageCreateResponse{} + return &this +} + +// GetId returns the Id field value +func (o *ImageCreateResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ImageCreateResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ImageCreateResponse) SetId(v string) { + o.Id = v +} + +// GetUploadUrl returns the UploadUrl field value +func (o *ImageCreateResponse) GetUploadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.UploadUrl +} + +// GetUploadUrlOk returns a tuple with the UploadUrl field value +// and a boolean to check if the value has been set. +func (o *ImageCreateResponse) GetUploadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UploadUrl, true +} + +// SetUploadUrl sets field value +func (o *ImageCreateResponse) SetUploadUrl(v string) { + o.UploadUrl = v +} + +func (o ImageCreateResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageCreateResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["uploadUrl"] = o.UploadUrl + return toSerialize, nil +} + +func (o *ImageCreateResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uploadUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageCreateResponse := _ImageCreateResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageCreateResponse) + + if err != nil { + return err + } + + *o = ImageCreateResponse(varImageCreateResponse) + + return err +} + +type NullableImageCreateResponse struct { + value *ImageCreateResponse + isSet bool +} + +func (v NullableImageCreateResponse) Get() *ImageCreateResponse { + return v.value +} + +func (v *NullableImageCreateResponse) Set(val *ImageCreateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableImageCreateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableImageCreateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageCreateResponse(val *ImageCreateResponse) *NullableImageCreateResponse { + return &NullableImageCreateResponse{value: val, isSet: true} +} + +func (v NullableImageCreateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageCreateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_image_list_response.go b/services/iaas/v1api/model_image_list_response.go new file mode 100644 index 000000000..85fe5e64d --- /dev/null +++ b/services/iaas/v1api/model_image_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageListResponse{} + +// ImageListResponse Image list response. +type ImageListResponse struct { + // A list containing image objects. + Items []Image `json:"items"` +} + +type _ImageListResponse ImageListResponse + +// NewImageListResponse instantiates a new ImageListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageListResponse(items []Image) *ImageListResponse { + this := ImageListResponse{} + this.Items = items + return &this +} + +// NewImageListResponseWithDefaults instantiates a new ImageListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageListResponseWithDefaults() *ImageListResponse { + this := ImageListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ImageListResponse) GetItems() []Image { + if o == nil { + var ret []Image + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ImageListResponse) GetItemsOk() ([]Image, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ImageListResponse) SetItems(v []Image) { + o.Items = v +} + +func (o ImageListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ImageListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageListResponse := _ImageListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageListResponse) + + if err != nil { + return err + } + + *o = ImageListResponse(varImageListResponse) + + return err +} + +type NullableImageListResponse struct { + value *ImageListResponse + isSet bool +} + +func (v NullableImageListResponse) Get() *ImageListResponse { + return v.value +} + +func (v *NullableImageListResponse) Set(val *ImageListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableImageListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableImageListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageListResponse(val *ImageListResponse) *NullableImageListResponse { + return &NullableImageListResponse{value: val, isSet: true} +} + +func (v NullableImageListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_image_share.go b/services/iaas/v1api/model_image_share.go new file mode 100644 index 000000000..b9dfd14a2 --- /dev/null +++ b/services/iaas/v1api/model_image_share.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ImageShare type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageShare{} + +// ImageShare Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type ImageShare struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewImageShare instantiates a new ImageShare object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageShare() *ImageShare { + this := ImageShare{} + return &this +} + +// NewImageShareWithDefaults instantiates a new ImageShare object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageShareWithDefaults() *ImageShare { + this := ImageShare{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *ImageShare) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShare) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *ImageShare) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *ImageShare) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *ImageShare) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShare) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *ImageShare) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *ImageShare) SetProjects(v []string) { + o.Projects = v +} + +func (o ImageShare) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageShare) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableImageShare struct { + value *ImageShare + isSet bool +} + +func (v NullableImageShare) Get() *ImageShare { + return v.value +} + +func (v *NullableImageShare) Set(val *ImageShare) { + v.value = val + v.isSet = true +} + +func (v NullableImageShare) IsSet() bool { + return v.isSet +} + +func (v *NullableImageShare) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageShare(val *ImageShare) *NullableImageShare { + return &NullableImageShare{value: val, isSet: true} +} + +func (v NullableImageShare) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageShare) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_image_share_consumer.go b/services/iaas/v1api/model_image_share_consumer.go new file mode 100644 index 000000000..562e2f9d2 --- /dev/null +++ b/services/iaas/v1api/model_image_share_consumer.go @@ -0,0 +1,238 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "time" +) + +// checks if the ImageShareConsumer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageShareConsumer{} + +// ImageShareConsumer The details of an Image share consumer. +type ImageShareConsumer struct { + // Universally Unique Identifier (UUID). + ConsumerProjectId *string `json:"consumerProjectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +// NewImageShareConsumer instantiates a new ImageShareConsumer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageShareConsumer() *ImageShareConsumer { + this := ImageShareConsumer{} + return &this +} + +// NewImageShareConsumerWithDefaults instantiates a new ImageShareConsumer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageShareConsumerWithDefaults() *ImageShareConsumer { + this := ImageShareConsumer{} + return &this +} + +// GetConsumerProjectId returns the ConsumerProjectId field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetConsumerProjectId() string { + if o == nil || IsNil(o.ConsumerProjectId) { + var ret string + return ret + } + return *o.ConsumerProjectId +} + +// GetConsumerProjectIdOk returns a tuple with the ConsumerProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetConsumerProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ConsumerProjectId) { + return nil, false + } + return o.ConsumerProjectId, true +} + +// HasConsumerProjectId returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasConsumerProjectId() bool { + if o != nil && !IsNil(o.ConsumerProjectId) { + return true + } + + return false +} + +// SetConsumerProjectId gets a reference to the given string and assigns it to the ConsumerProjectId field. +func (o *ImageShareConsumer) SetConsumerProjectId(v string) { + o.ConsumerProjectId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ImageShareConsumer) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *ImageShareConsumer) SetImageId(v string) { + o.ImageId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *ImageShareConsumer) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o ImageShareConsumer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageShareConsumer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConsumerProjectId) { + toSerialize["consumerProjectId"] = o.ConsumerProjectId + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableImageShareConsumer struct { + value *ImageShareConsumer + isSet bool +} + +func (v NullableImageShareConsumer) Get() *ImageShareConsumer { + return v.value +} + +func (v *NullableImageShareConsumer) Set(val *ImageShareConsumer) { + v.value = val + v.isSet = true +} + +func (v NullableImageShareConsumer) IsSet() bool { + return v.isSet +} + +func (v *NullableImageShareConsumer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageShareConsumer(val *ImageShareConsumer) *NullableImageShareConsumer { + return &NullableImageShareConsumer{value: val, isSet: true} +} + +func (v NullableImageShareConsumer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageShareConsumer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_key_pair_list_response.go b/services/iaas/v1api/model_key_pair_list_response.go new file mode 100644 index 000000000..52d3aee54 --- /dev/null +++ b/services/iaas/v1api/model_key_pair_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the KeyPairListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyPairListResponse{} + +// KeyPairListResponse SSH keypair list response. +type KeyPairListResponse struct { + // A list of SSH keypairs. + Items []Keypair `json:"items"` +} + +type _KeyPairListResponse KeyPairListResponse + +// NewKeyPairListResponse instantiates a new KeyPairListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeyPairListResponse(items []Keypair) *KeyPairListResponse { + this := KeyPairListResponse{} + this.Items = items + return &this +} + +// NewKeyPairListResponseWithDefaults instantiates a new KeyPairListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyPairListResponseWithDefaults() *KeyPairListResponse { + this := KeyPairListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *KeyPairListResponse) GetItems() []Keypair { + if o == nil { + var ret []Keypair + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *KeyPairListResponse) GetItemsOk() ([]Keypair, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *KeyPairListResponse) SetItems(v []Keypair) { + o.Items = v +} + +func (o KeyPairListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyPairListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *KeyPairListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeyPairListResponse := _KeyPairListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeyPairListResponse) + + if err != nil { + return err + } + + *o = KeyPairListResponse(varKeyPairListResponse) + + return err +} + +type NullableKeyPairListResponse struct { + value *KeyPairListResponse + isSet bool +} + +func (v NullableKeyPairListResponse) Get() *KeyPairListResponse { + return v.value +} + +func (v *NullableKeyPairListResponse) Set(val *KeyPairListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeyPairListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyPairListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyPairListResponse(val *KeyPairListResponse) *NullableKeyPairListResponse { + return &NullableKeyPairListResponse{value: val, isSet: true} +} + +func (v NullableKeyPairListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyPairListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_keypair.go b/services/iaas/v1api/model_keypair.go new file mode 100644 index 000000000..b340e7669 --- /dev/null +++ b/services/iaas/v1api/model_keypair.go @@ -0,0 +1,344 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Keypair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Keypair{} + +// Keypair Object that represents the public key of an SSH keypair and its name. +type Keypair struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents an SSH keypair MD5 fingerprint. + Fingerprint *string `json:"fingerprint,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // Object that represents a public SSH key. + PublicKey string `json:"publicKey" validate:"regexp=^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\\\\s+[A-Za-z0-9+\\/]+[=]{0,3}(\\\\s+.+)?\\\\s*$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Keypair Keypair + +// NewKeypair instantiates a new Keypair object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeypair(publicKey string) *Keypair { + this := Keypair{} + this.PublicKey = publicKey + return &this +} + +// NewKeypairWithDefaults instantiates a new Keypair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeypairWithDefaults() *Keypair { + this := Keypair{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Keypair) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Keypair) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Keypair) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *Keypair) GetFingerprint() string { + if o == nil || IsNil(o.Fingerprint) { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetFingerprintOk() (*string, bool) { + if o == nil || IsNil(o.Fingerprint) { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *Keypair) HasFingerprint() bool { + if o != nil && !IsNil(o.Fingerprint) { + return true + } + + return false +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *Keypair) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Keypair) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Keypair) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Keypair) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Keypair) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Keypair) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Keypair) SetName(v string) { + o.Name = &v +} + +// GetPublicKey returns the PublicKey field value +func (o *Keypair) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *Keypair) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *Keypair) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Keypair) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Keypair) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Keypair) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Keypair) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Keypair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Fingerprint) { + toSerialize["fingerprint"] = o.Fingerprint + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["publicKey"] = o.PublicKey + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Keypair) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "publicKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeypair := _Keypair{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeypair) + + if err != nil { + return err + } + + *o = Keypair(varKeypair) + + return err +} + +type NullableKeypair struct { + value *Keypair + isSet bool +} + +func (v NullableKeypair) Get() *Keypair { + return v.value +} + +func (v *NullableKeypair) Set(val *Keypair) { + v.value = val + v.isSet = true +} + +func (v NullableKeypair) IsSet() bool { + return v.isSet +} + +func (v *NullableKeypair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeypair(val *Keypair) *NullableKeypair { + return &NullableKeypair{value: val, isSet: true} +} + +func (v NullableKeypair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeypair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_machine_type.go b/services/iaas/v1api/model_machine_type.go new file mode 100644 index 000000000..9bcefd996 --- /dev/null +++ b/services/iaas/v1api/model_machine_type.go @@ -0,0 +1,319 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the MachineType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MachineType{} + +// MachineType Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, `ram`, `vcpus`. +type MachineType struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Size in Gigabyte. + Disk int64 `json:"disk"` + // Properties to control certain aspects or scheduling behavior for an object. + ExtraSpecs map[string]interface{} `json:"extraSpecs,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Megabyte. + Ram int64 `json:"ram"` + // The number of virtual CPUs of a server. + Vcpus int64 `json:"vcpus"` +} + +type _MachineType MachineType + +// NewMachineType instantiates a new MachineType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMachineType(disk int64, name string, ram int64, vcpus int64) *MachineType { + this := MachineType{} + this.Disk = disk + this.Name = name + this.Ram = ram + this.Vcpus = vcpus + return &this +} + +// NewMachineTypeWithDefaults instantiates a new MachineType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMachineTypeWithDefaults() *MachineType { + this := MachineType{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MachineType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MachineType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *MachineType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *MachineType) SetDescription(v string) { + o.Description = &v +} + +// GetDisk returns the Disk field value +func (o *MachineType) GetDisk() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Disk +} + +// GetDiskOk returns a tuple with the Disk field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetDiskOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Disk, true +} + +// SetDisk sets field value +func (o *MachineType) SetDisk(v int64) { + o.Disk = v +} + +// GetExtraSpecs returns the ExtraSpecs field value if set, zero value otherwise. +func (o *MachineType) GetExtraSpecs() map[string]interface{} { + if o == nil || IsNil(o.ExtraSpecs) { + var ret map[string]interface{} + return ret + } + return o.ExtraSpecs +} + +// GetExtraSpecsOk returns a tuple with the ExtraSpecs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MachineType) GetExtraSpecsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ExtraSpecs) { + return map[string]interface{}{}, false + } + return o.ExtraSpecs, true +} + +// HasExtraSpecs returns a boolean if a field has been set. +func (o *MachineType) HasExtraSpecs() bool { + if o != nil && !IsNil(o.ExtraSpecs) { + return true + } + + return false +} + +// SetExtraSpecs gets a reference to the given map[string]interface{} and assigns it to the ExtraSpecs field. +func (o *MachineType) SetExtraSpecs(v map[string]interface{}) { + o.ExtraSpecs = v +} + +// GetName returns the Name field value +func (o *MachineType) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MachineType) SetName(v string) { + o.Name = v +} + +// GetRam returns the Ram field value +func (o *MachineType) GetRam() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Ram +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetRamOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Ram, true +} + +// SetRam sets field value +func (o *MachineType) SetRam(v int64) { + o.Ram = v +} + +// GetVcpus returns the Vcpus field value +func (o *MachineType) GetVcpus() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Vcpus +} + +// GetVcpusOk returns a tuple with the Vcpus field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetVcpusOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Vcpus, true +} + +// SetVcpus sets field value +func (o *MachineType) SetVcpus(v int64) { + o.Vcpus = v +} + +func (o MachineType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MachineType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["disk"] = o.Disk + if !IsNil(o.ExtraSpecs) { + toSerialize["extraSpecs"] = o.ExtraSpecs + } + toSerialize["name"] = o.Name + toSerialize["ram"] = o.Ram + toSerialize["vcpus"] = o.Vcpus + return toSerialize, nil +} + +func (o *MachineType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "disk", + "name", + "ram", + "vcpus", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMachineType := _MachineType{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMachineType) + + if err != nil { + return err + } + + *o = MachineType(varMachineType) + + return err +} + +type NullableMachineType struct { + value *MachineType + isSet bool +} + +func (v NullableMachineType) Get() *MachineType { + return v.value +} + +func (v *NullableMachineType) Set(val *MachineType) { + v.value = val + v.isSet = true +} + +func (v NullableMachineType) IsSet() bool { + return v.isSet +} + +func (v *NullableMachineType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMachineType(val *MachineType) *NullableMachineType { + return &NullableMachineType{value: val, isSet: true} +} + +func (v NullableMachineType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMachineType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_machine_type_list_response.go b/services/iaas/v1api/model_machine_type_list_response.go new file mode 100644 index 000000000..b2c2c04ef --- /dev/null +++ b/services/iaas/v1api/model_machine_type_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the MachineTypeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MachineTypeListResponse{} + +// MachineTypeListResponse Machine type list response. +type MachineTypeListResponse struct { + // Machine type list. + Items []MachineType `json:"items"` +} + +type _MachineTypeListResponse MachineTypeListResponse + +// NewMachineTypeListResponse instantiates a new MachineTypeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMachineTypeListResponse(items []MachineType) *MachineTypeListResponse { + this := MachineTypeListResponse{} + this.Items = items + return &this +} + +// NewMachineTypeListResponseWithDefaults instantiates a new MachineTypeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMachineTypeListResponseWithDefaults() *MachineTypeListResponse { + this := MachineTypeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *MachineTypeListResponse) GetItems() []MachineType { + if o == nil { + var ret []MachineType + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *MachineTypeListResponse) GetItemsOk() ([]MachineType, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *MachineTypeListResponse) SetItems(v []MachineType) { + o.Items = v +} + +func (o MachineTypeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MachineTypeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *MachineTypeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMachineTypeListResponse := _MachineTypeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMachineTypeListResponse) + + if err != nil { + return err + } + + *o = MachineTypeListResponse(varMachineTypeListResponse) + + return err +} + +type NullableMachineTypeListResponse struct { + value *MachineTypeListResponse + isSet bool +} + +func (v NullableMachineTypeListResponse) Get() *MachineTypeListResponse { + return v.value +} + +func (v *NullableMachineTypeListResponse) Set(val *MachineTypeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMachineTypeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMachineTypeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMachineTypeListResponse(val *MachineTypeListResponse) *NullableMachineTypeListResponse { + return &NullableMachineTypeListResponse{value: val, isSet: true} +} + +func (v NullableMachineTypeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMachineTypeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_network.go b/services/iaas/v1api/model_network.go new file mode 100644 index 000000000..2f4836ddf --- /dev/null +++ b/services/iaas/v1api/model_network.go @@ -0,0 +1,680 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Network type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Network{} + +// Network Object that represents a network. +type Network struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gatewayv6 NullableString `json:"gatewayv6,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + // A list containing DNS Servers/Nameservers for IPv6. + NameserversV6 []string `json:"nameserversV6,omitempty"` + // Universally Unique Identifier (UUID). + NetworkId string `json:"networkId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Prefixes []string `json:"prefixes,omitempty"` + PrefixesV6 []string `json:"prefixesV6,omitempty"` + // Object that represents an IP address. + PublicIp *string `json:"publicIp,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + State string `json:"state"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Network Network + +// NewNetwork instantiates a new Network object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetwork(name string, networkId string, state string) *Network { + this := Network{} + this.Name = name + this.NetworkId = networkId + this.State = state + return &this +} + +// NewNetworkWithDefaults instantiates a new Network object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkWithDefaults() *Network { + this := Network{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Network) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Network) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Network) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *Network) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *Network) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *Network) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Network) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Network) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *Network) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *Network) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *Network) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *Network) UnsetGateway() { + o.Gateway.Unset() +} + +// GetGatewayv6 returns the Gatewayv6 field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *Network) GetGatewayv6() string { + if o == nil || IsNil(o.Gatewayv6.Get()) { + var ret string + return ret + } + return *o.Gatewayv6.Get() +} + +// GetGatewayv6Ok returns a tuple with the Gatewayv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *Network) GetGatewayv6Ok() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gatewayv6.Get(), o.Gatewayv6.IsSet() +} + +// HasGatewayv6 returns a boolean if a field has been set. +func (o *Network) HasGatewayv6() bool { + if o != nil && o.Gatewayv6.IsSet() { + return true + } + + return false +} + +// SetGatewayv6 gets a reference to the given NullableString and assigns it to the Gatewayv6 field. +func (o *Network) SetGatewayv6(v string) { + o.Gatewayv6.Set(&v) +} + +// SetGatewayv6Nil sets the value for Gatewayv6 to be an explicit nil +func (o *Network) SetGatewayv6Nil() { + o.Gatewayv6.Set(nil) +} + +// UnsetGatewayv6 ensures that no value is present for Gatewayv6, not even an explicit nil +func (o *Network) UnsetGatewayv6() { + o.Gatewayv6.Unset() +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Network) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Network) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Network) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *Network) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Network) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Network) SetName(v string) { + o.Name = v +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *Network) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *Network) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *Network) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetNameserversV6 returns the NameserversV6 field value if set, zero value otherwise. +func (o *Network) GetNameserversV6() []string { + if o == nil || IsNil(o.NameserversV6) { + var ret []string + return ret + } + return o.NameserversV6 +} + +// GetNameserversV6Ok returns a tuple with the NameserversV6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetNameserversV6Ok() ([]string, bool) { + if o == nil || IsNil(o.NameserversV6) { + return nil, false + } + return o.NameserversV6, true +} + +// HasNameserversV6 returns a boolean if a field has been set. +func (o *Network) HasNameserversV6() bool { + if o != nil && !IsNil(o.NameserversV6) { + return true + } + + return false +} + +// SetNameserversV6 gets a reference to the given []string and assigns it to the NameserversV6 field. +func (o *Network) SetNameserversV6(v []string) { + o.NameserversV6 = v +} + +// GetNetworkId returns the NetworkId field value +func (o *Network) GetNetworkId() string { + if o == nil { + var ret string + return ret + } + + return o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value +// and a boolean to check if the value has been set. +func (o *Network) GetNetworkIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NetworkId, true +} + +// SetNetworkId sets field value +func (o *Network) SetNetworkId(v string) { + o.NetworkId = v +} + +// GetPrefixes returns the Prefixes field value if set, zero value otherwise. +func (o *Network) GetPrefixes() []string { + if o == nil || IsNil(o.Prefixes) { + var ret []string + return ret + } + return o.Prefixes +} + +// GetPrefixesOk returns a tuple with the Prefixes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetPrefixesOk() ([]string, bool) { + if o == nil || IsNil(o.Prefixes) { + return nil, false + } + return o.Prefixes, true +} + +// HasPrefixes returns a boolean if a field has been set. +func (o *Network) HasPrefixes() bool { + if o != nil && !IsNil(o.Prefixes) { + return true + } + + return false +} + +// SetPrefixes gets a reference to the given []string and assigns it to the Prefixes field. +func (o *Network) SetPrefixes(v []string) { + o.Prefixes = v +} + +// GetPrefixesV6 returns the PrefixesV6 field value if set, zero value otherwise. +func (o *Network) GetPrefixesV6() []string { + if o == nil || IsNil(o.PrefixesV6) { + var ret []string + return ret + } + return o.PrefixesV6 +} + +// GetPrefixesV6Ok returns a tuple with the PrefixesV6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetPrefixesV6Ok() ([]string, bool) { + if o == nil || IsNil(o.PrefixesV6) { + return nil, false + } + return o.PrefixesV6, true +} + +// HasPrefixesV6 returns a boolean if a field has been set. +func (o *Network) HasPrefixesV6() bool { + if o != nil && !IsNil(o.PrefixesV6) { + return true + } + + return false +} + +// SetPrefixesV6 gets a reference to the given []string and assigns it to the PrefixesV6 field. +func (o *Network) SetPrefixesV6(v []string) { + o.PrefixesV6 = v +} + +// GetPublicIp returns the PublicIp field value if set, zero value otherwise. +func (o *Network) GetPublicIp() string { + if o == nil || IsNil(o.PublicIp) { + var ret string + return ret + } + return *o.PublicIp +} + +// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetPublicIpOk() (*string, bool) { + if o == nil || IsNil(o.PublicIp) { + return nil, false + } + return o.PublicIp, true +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *Network) HasPublicIp() bool { + if o != nil && !IsNil(o.PublicIp) { + return true + } + + return false +} + +// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +func (o *Network) SetPublicIp(v string) { + o.PublicIp = &v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *Network) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *Network) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *Network) SetRouted(v bool) { + o.Routed = &v +} + +// GetState returns the State field value +func (o *Network) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *Network) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *Network) SetState(v string) { + o.State = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Network) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Network) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Network) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Network) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Network) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if o.Gatewayv6.IsSet() { + toSerialize["gatewayv6"] = o.Gatewayv6.Get() + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + if !IsNil(o.NameserversV6) { + toSerialize["nameserversV6"] = o.NameserversV6 + } + toSerialize["networkId"] = o.NetworkId + if !IsNil(o.Prefixes) { + toSerialize["prefixes"] = o.Prefixes + } + if !IsNil(o.PrefixesV6) { + toSerialize["prefixesV6"] = o.PrefixesV6 + } + if !IsNil(o.PublicIp) { + toSerialize["publicIp"] = o.PublicIp + } + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + toSerialize["state"] = o.State + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Network) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "networkId", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetwork := _Network{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetwork) + + if err != nil { + return err + } + + *o = Network(varNetwork) + + return err +} + +type NullableNetwork struct { + value *Network + isSet bool +} + +func (v NullableNetwork) Get() *Network { + return v.value +} + +func (v *NullableNetwork) Set(val *Network) { + v.value = val + v.isSet = true +} + +func (v NullableNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetwork(val *Network) *NullableNetwork { + return &NullableNetwork{value: val, isSet: true} +} + +func (v NullableNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_network_area.go b/services/iaas/v1api/model_network_area.go new file mode 100644 index 000000000..457426f1e --- /dev/null +++ b/services/iaas/v1api/model_network_area.go @@ -0,0 +1,392 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the NetworkArea type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkArea{} + +// NetworkArea Object that represents a network area. +type NetworkArea struct { + // Universally Unique Identifier (UUID). + AreaId string `json:"areaId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + Ipv4 *NetworkAreaIPv4 `json:"ipv4,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` + // The amount of projects currently referencing a specific area. + ProjectCount int64 `json:"projectCount"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + State string `json:"state"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _NetworkArea NetworkArea + +// NewNetworkArea instantiates a new NetworkArea object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkArea(areaId string, name string, projectCount int64, state string) *NetworkArea { + this := NetworkArea{} + this.AreaId = areaId + this.Name = name + this.ProjectCount = projectCount + this.State = state + return &this +} + +// NewNetworkAreaWithDefaults instantiates a new NetworkArea object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkAreaWithDefaults() *NetworkArea { + this := NetworkArea{} + return &this +} + +// GetAreaId returns the AreaId field value +func (o *NetworkArea) GetAreaId() string { + if o == nil { + var ret string + return ret + } + + return o.AreaId +} + +// GetAreaIdOk returns a tuple with the AreaId field value +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetAreaIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AreaId, true +} + +// SetAreaId sets field value +func (o *NetworkArea) SetAreaId(v string) { + o.AreaId = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *NetworkArea) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *NetworkArea) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *NetworkArea) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *NetworkArea) GetIpv4() NetworkAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret NetworkAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetIpv4Ok() (*NetworkAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *NetworkArea) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given NetworkAreaIPv4 and assigns it to the Ipv4 field. +func (o *NetworkArea) SetIpv4(v NetworkAreaIPv4) { + o.Ipv4 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *NetworkArea) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *NetworkArea) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *NetworkArea) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *NetworkArea) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NetworkArea) SetName(v string) { + o.Name = v +} + +// GetProjectCount returns the ProjectCount field value +func (o *NetworkArea) GetProjectCount() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.ProjectCount +} + +// GetProjectCountOk returns a tuple with the ProjectCount field value +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetProjectCountOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.ProjectCount, true +} + +// SetProjectCount sets field value +func (o *NetworkArea) SetProjectCount(v int64) { + o.ProjectCount = v +} + +// GetState returns the State field value +func (o *NetworkArea) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *NetworkArea) SetState(v string) { + o.State = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *NetworkArea) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *NetworkArea) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *NetworkArea) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o NetworkArea) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkArea) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["areaId"] = o.AreaId + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + toSerialize["projectCount"] = o.ProjectCount + toSerialize["state"] = o.State + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *NetworkArea) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "areaId", + "name", + "projectCount", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkArea := _NetworkArea{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkArea) + + if err != nil { + return err + } + + *o = NetworkArea(varNetworkArea) + + return err +} + +type NullableNetworkArea struct { + value *NetworkArea + isSet bool +} + +func (v NullableNetworkArea) Get() *NetworkArea { + return v.value +} + +func (v *NullableNetworkArea) Set(val *NetworkArea) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkArea) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkArea) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkArea(val *NetworkArea) *NullableNetworkArea { + return &NullableNetworkArea{value: val, isSet: true} +} + +func (v NullableNetworkArea) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkArea) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_network_area_ipv4.go b/services/iaas/v1api/model_network_area_ipv4.go new file mode 100644 index 000000000..2c809f73c --- /dev/null +++ b/services/iaas/v1api/model_network_area_ipv4.go @@ -0,0 +1,360 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the NetworkAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkAreaIPv4{} + +// NetworkAreaIPv4 The IPv4 properties of a network area. +type NetworkAreaIPv4 struct { + // A list containing DNS Servers/Nameservers for IPv4. + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // A list of network ranges. + NetworkRanges []NetworkRange `json:"networkRanges,omitempty"` + // A list of routes. + Routes []Route `json:"routes,omitempty"` + // Classless Inter-Domain Routing (CIDR). + TransferNetwork *string `json:"transferNetwork,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + // The default prefix length for networks in the network area. + DefaultPrefixLen *int32 `json:"defaultPrefixLen,omitempty"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen *int32 `json:"maxPrefixLen,omitempty"` + // The minimal prefix length for networks in the network area. + MinPrefixLen *int32 `json:"minPrefixLen,omitempty"` +} + +// NewNetworkAreaIPv4 instantiates a new NetworkAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkAreaIPv4() *NetworkAreaIPv4 { + this := NetworkAreaIPv4{} + var defaultPrefixLen int32 = 25 + this.DefaultPrefixLen = &defaultPrefixLen + var maxPrefixLen int32 = 29 + this.MaxPrefixLen = &maxPrefixLen + var minPrefixLen int32 = 24 + this.MinPrefixLen = &minPrefixLen + return &this +} + +// NewNetworkAreaIPv4WithDefaults instantiates a new NetworkAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkAreaIPv4WithDefaults() *NetworkAreaIPv4 { + this := NetworkAreaIPv4{} + var defaultPrefixLen int32 = 25 + this.DefaultPrefixLen = &defaultPrefixLen + var maxPrefixLen int32 = 29 + this.MaxPrefixLen = &maxPrefixLen + var minPrefixLen int32 = 24 + this.MinPrefixLen = &minPrefixLen + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *NetworkAreaIPv4) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkAreaIPv4) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *NetworkAreaIPv4) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *NetworkAreaIPv4) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetNetworkRanges returns the NetworkRanges field value if set, zero value otherwise. +func (o *NetworkAreaIPv4) GetNetworkRanges() []NetworkRange { + if o == nil || IsNil(o.NetworkRanges) { + var ret []NetworkRange + return ret + } + return o.NetworkRanges +} + +// GetNetworkRangesOk returns a tuple with the NetworkRanges field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkAreaIPv4) GetNetworkRangesOk() ([]NetworkRange, bool) { + if o == nil || IsNil(o.NetworkRanges) { + return nil, false + } + return o.NetworkRanges, true +} + +// HasNetworkRanges returns a boolean if a field has been set. +func (o *NetworkAreaIPv4) HasNetworkRanges() bool { + if o != nil && !IsNil(o.NetworkRanges) { + return true + } + + return false +} + +// SetNetworkRanges gets a reference to the given []NetworkRange and assigns it to the NetworkRanges field. +func (o *NetworkAreaIPv4) SetNetworkRanges(v []NetworkRange) { + o.NetworkRanges = v +} + +// GetRoutes returns the Routes field value if set, zero value otherwise. +func (o *NetworkAreaIPv4) GetRoutes() []Route { + if o == nil || IsNil(o.Routes) { + var ret []Route + return ret + } + return o.Routes +} + +// GetRoutesOk returns a tuple with the Routes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkAreaIPv4) GetRoutesOk() ([]Route, bool) { + if o == nil || IsNil(o.Routes) { + return nil, false + } + return o.Routes, true +} + +// HasRoutes returns a boolean if a field has been set. +func (o *NetworkAreaIPv4) HasRoutes() bool { + if o != nil && !IsNil(o.Routes) { + return true + } + + return false +} + +// SetRoutes gets a reference to the given []Route and assigns it to the Routes field. +func (o *NetworkAreaIPv4) SetRoutes(v []Route) { + o.Routes = v +} + +// GetTransferNetwork returns the TransferNetwork field value if set, zero value otherwise. +func (o *NetworkAreaIPv4) GetTransferNetwork() string { + if o == nil || IsNil(o.TransferNetwork) { + var ret string + return ret + } + return *o.TransferNetwork +} + +// GetTransferNetworkOk returns a tuple with the TransferNetwork field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkAreaIPv4) GetTransferNetworkOk() (*string, bool) { + if o == nil || IsNil(o.TransferNetwork) { + return nil, false + } + return o.TransferNetwork, true +} + +// HasTransferNetwork returns a boolean if a field has been set. +func (o *NetworkAreaIPv4) HasTransferNetwork() bool { + if o != nil && !IsNil(o.TransferNetwork) { + return true + } + + return false +} + +// SetTransferNetwork gets a reference to the given string and assigns it to the TransferNetwork field. +func (o *NetworkAreaIPv4) SetTransferNetwork(v string) { + o.TransferNetwork = &v +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. +func (o *NetworkAreaIPv4) GetDefaultPrefixLen() int32 { + if o == nil || IsNil(o.DefaultPrefixLen) { + var ret int32 + return ret + } + return *o.DefaultPrefixLen +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkAreaIPv4) GetDefaultPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.DefaultPrefixLen) { + return nil, false + } + return o.DefaultPrefixLen, true +} + +// HasDefaultPrefixLen returns a boolean if a field has been set. +func (o *NetworkAreaIPv4) HasDefaultPrefixLen() bool { + if o != nil && !IsNil(o.DefaultPrefixLen) { + return true + } + + return false +} + +// SetDefaultPrefixLen gets a reference to the given int32 and assigns it to the DefaultPrefixLen field. +func (o *NetworkAreaIPv4) SetDefaultPrefixLen(v int32) { + o.DefaultPrefixLen = &v +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. +func (o *NetworkAreaIPv4) GetMaxPrefixLen() int32 { + if o == nil || IsNil(o.MaxPrefixLen) { + var ret int32 + return ret + } + return *o.MaxPrefixLen +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkAreaIPv4) GetMaxPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.MaxPrefixLen) { + return nil, false + } + return o.MaxPrefixLen, true +} + +// HasMaxPrefixLen returns a boolean if a field has been set. +func (o *NetworkAreaIPv4) HasMaxPrefixLen() bool { + if o != nil && !IsNil(o.MaxPrefixLen) { + return true + } + + return false +} + +// SetMaxPrefixLen gets a reference to the given int32 and assigns it to the MaxPrefixLen field. +func (o *NetworkAreaIPv4) SetMaxPrefixLen(v int32) { + o.MaxPrefixLen = &v +} + +// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. +func (o *NetworkAreaIPv4) GetMinPrefixLen() int32 { + if o == nil || IsNil(o.MinPrefixLen) { + var ret int32 + return ret + } + return *o.MinPrefixLen +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkAreaIPv4) GetMinPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.MinPrefixLen) { + return nil, false + } + return o.MinPrefixLen, true +} + +// HasMinPrefixLen returns a boolean if a field has been set. +func (o *NetworkAreaIPv4) HasMinPrefixLen() bool { + if o != nil && !IsNil(o.MinPrefixLen) { + return true + } + + return false +} + +// SetMinPrefixLen gets a reference to the given int32 and assigns it to the MinPrefixLen field. +func (o *NetworkAreaIPv4) SetMinPrefixLen(v int32) { + o.MinPrefixLen = &v +} + +func (o NetworkAreaIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + if !IsNil(o.NetworkRanges) { + toSerialize["networkRanges"] = o.NetworkRanges + } + if !IsNil(o.Routes) { + toSerialize["routes"] = o.Routes + } + if !IsNil(o.TransferNetwork) { + toSerialize["transferNetwork"] = o.TransferNetwork + } + if !IsNil(o.DefaultPrefixLen) { + toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + } + if !IsNil(o.MaxPrefixLen) { + toSerialize["maxPrefixLen"] = o.MaxPrefixLen + } + if !IsNil(o.MinPrefixLen) { + toSerialize["minPrefixLen"] = o.MinPrefixLen + } + return toSerialize, nil +} + +type NullableNetworkAreaIPv4 struct { + value *NetworkAreaIPv4 + isSet bool +} + +func (v NullableNetworkAreaIPv4) Get() *NetworkAreaIPv4 { + return v.value +} + +func (v *NullableNetworkAreaIPv4) Set(val *NetworkAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkAreaIPv4(val *NetworkAreaIPv4) *NullableNetworkAreaIPv4 { + return &NullableNetworkAreaIPv4{value: val, isSet: true} +} + +func (v NullableNetworkAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_network_area_list_response.go b/services/iaas/v1api/model_network_area_list_response.go new file mode 100644 index 000000000..6af92432b --- /dev/null +++ b/services/iaas/v1api/model_network_area_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkAreaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkAreaListResponse{} + +// NetworkAreaListResponse Network area list response. +type NetworkAreaListResponse struct { + // A list of network areas. + Items []NetworkArea `json:"items"` +} + +type _NetworkAreaListResponse NetworkAreaListResponse + +// NewNetworkAreaListResponse instantiates a new NetworkAreaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkAreaListResponse(items []NetworkArea) *NetworkAreaListResponse { + this := NetworkAreaListResponse{} + this.Items = items + return &this +} + +// NewNetworkAreaListResponseWithDefaults instantiates a new NetworkAreaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkAreaListResponseWithDefaults() *NetworkAreaListResponse { + this := NetworkAreaListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkAreaListResponse) GetItems() []NetworkArea { + if o == nil { + var ret []NetworkArea + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkAreaListResponse) GetItemsOk() ([]NetworkArea, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkAreaListResponse) SetItems(v []NetworkArea) { + o.Items = v +} + +func (o NetworkAreaListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkAreaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkAreaListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkAreaListResponse := _NetworkAreaListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkAreaListResponse) + + if err != nil { + return err + } + + *o = NetworkAreaListResponse(varNetworkAreaListResponse) + + return err +} + +type NullableNetworkAreaListResponse struct { + value *NetworkAreaListResponse + isSet bool +} + +func (v NullableNetworkAreaListResponse) Get() *NetworkAreaListResponse { + return v.value +} + +func (v *NullableNetworkAreaListResponse) Set(val *NetworkAreaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkAreaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkAreaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkAreaListResponse(val *NetworkAreaListResponse) *NullableNetworkAreaListResponse { + return &NullableNetworkAreaListResponse{value: val, isSet: true} +} + +func (v NullableNetworkAreaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkAreaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_network_list_response.go b/services/iaas/v1api/model_network_list_response.go new file mode 100644 index 000000000..0fb4ef95d --- /dev/null +++ b/services/iaas/v1api/model_network_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkListResponse{} + +// NetworkListResponse Network list response. +type NetworkListResponse struct { + // A list of networks. + Items []Network `json:"items"` +} + +type _NetworkListResponse NetworkListResponse + +// NewNetworkListResponse instantiates a new NetworkListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkListResponse(items []Network) *NetworkListResponse { + this := NetworkListResponse{} + this.Items = items + return &this +} + +// NewNetworkListResponseWithDefaults instantiates a new NetworkListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkListResponseWithDefaults() *NetworkListResponse { + this := NetworkListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkListResponse) GetItems() []Network { + if o == nil { + var ret []Network + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkListResponse) GetItemsOk() ([]Network, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkListResponse) SetItems(v []Network) { + o.Items = v +} + +func (o NetworkListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkListResponse := _NetworkListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkListResponse) + + if err != nil { + return err + } + + *o = NetworkListResponse(varNetworkListResponse) + + return err +} + +type NullableNetworkListResponse struct { + value *NetworkListResponse + isSet bool +} + +func (v NullableNetworkListResponse) Get() *NetworkListResponse { + return v.value +} + +func (v *NullableNetworkListResponse) Set(val *NetworkListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkListResponse(val *NetworkListResponse) *NullableNetworkListResponse { + return &NullableNetworkListResponse{value: val, isSet: true} +} + +func (v NullableNetworkListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_network_range.go b/services/iaas/v1api/model_network_range.go new file mode 100644 index 000000000..8f07170b5 --- /dev/null +++ b/services/iaas/v1api/model_network_range.go @@ -0,0 +1,270 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the NetworkRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkRange{} + +// NetworkRange Object that represents a network range. +type NetworkRange struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + NetworkRangeId *string `json:"networkRangeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Classless Inter-Domain Routing (CIDR). + Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _NetworkRange NetworkRange + +// NewNetworkRange instantiates a new NetworkRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkRange(prefix string) *NetworkRange { + this := NetworkRange{} + this.Prefix = prefix + return &this +} + +// NewNetworkRangeWithDefaults instantiates a new NetworkRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkRangeWithDefaults() *NetworkRange { + this := NetworkRange{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *NetworkRange) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *NetworkRange) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *NetworkRange) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetNetworkRangeId returns the NetworkRangeId field value if set, zero value otherwise. +func (o *NetworkRange) GetNetworkRangeId() string { + if o == nil || IsNil(o.NetworkRangeId) { + var ret string + return ret + } + return *o.NetworkRangeId +} + +// GetNetworkRangeIdOk returns a tuple with the NetworkRangeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetNetworkRangeIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkRangeId) { + return nil, false + } + return o.NetworkRangeId, true +} + +// HasNetworkRangeId returns a boolean if a field has been set. +func (o *NetworkRange) HasNetworkRangeId() bool { + if o != nil && !IsNil(o.NetworkRangeId) { + return true + } + + return false +} + +// SetNetworkRangeId gets a reference to the given string and assigns it to the NetworkRangeId field. +func (o *NetworkRange) SetNetworkRangeId(v string) { + o.NetworkRangeId = &v +} + +// GetPrefix returns the Prefix field value +func (o *NetworkRange) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *NetworkRange) SetPrefix(v string) { + o.Prefix = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *NetworkRange) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *NetworkRange) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *NetworkRange) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o NetworkRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.NetworkRangeId) { + toSerialize["networkRangeId"] = o.NetworkRangeId + } + toSerialize["prefix"] = o.Prefix + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *NetworkRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkRange := _NetworkRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkRange) + + if err != nil { + return err + } + + *o = NetworkRange(varNetworkRange) + + return err +} + +type NullableNetworkRange struct { + value *NetworkRange + isSet bool +} + +func (v NullableNetworkRange) Get() *NetworkRange { + return v.value +} + +func (v *NullableNetworkRange) Set(val *NetworkRange) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRange) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRange(val *NetworkRange) *NullableNetworkRange { + return &NullableNetworkRange{value: val, isSet: true} +} + +func (v NullableNetworkRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_network_range_list_response.go b/services/iaas/v1api/model_network_range_list_response.go new file mode 100644 index 000000000..47083fde6 --- /dev/null +++ b/services/iaas/v1api/model_network_range_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkRangeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkRangeListResponse{} + +// NetworkRangeListResponse Network Range list response. +type NetworkRangeListResponse struct { + // A list of network ranges. + Items []NetworkRange `json:"items"` +} + +type _NetworkRangeListResponse NetworkRangeListResponse + +// NewNetworkRangeListResponse instantiates a new NetworkRangeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkRangeListResponse(items []NetworkRange) *NetworkRangeListResponse { + this := NetworkRangeListResponse{} + this.Items = items + return &this +} + +// NewNetworkRangeListResponseWithDefaults instantiates a new NetworkRangeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkRangeListResponseWithDefaults() *NetworkRangeListResponse { + this := NetworkRangeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkRangeListResponse) GetItems() []NetworkRange { + if o == nil { + var ret []NetworkRange + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkRangeListResponse) GetItemsOk() ([]NetworkRange, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkRangeListResponse) SetItems(v []NetworkRange) { + o.Items = v +} + +func (o NetworkRangeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkRangeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkRangeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkRangeListResponse := _NetworkRangeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkRangeListResponse) + + if err != nil { + return err + } + + *o = NetworkRangeListResponse(varNetworkRangeListResponse) + + return err +} + +type NullableNetworkRangeListResponse struct { + value *NetworkRangeListResponse + isSet bool +} + +func (v NullableNetworkRangeListResponse) Get() *NetworkRangeListResponse { + return v.value +} + +func (v *NullableNetworkRangeListResponse) Set(val *NetworkRangeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRangeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRangeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRangeListResponse(val *NetworkRangeListResponse) *NullableNetworkRangeListResponse { + return &NullableNetworkRangeListResponse{value: val, isSet: true} +} + +func (v NullableNetworkRangeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRangeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_nic.go b/services/iaas/v1api/model_nic.go new file mode 100644 index 000000000..3480c8ae3 --- /dev/null +++ b/services/iaas/v1api/model_nic.go @@ -0,0 +1,611 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the NIC type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NIC{} + +// NIC Object that represents a network interface. +type NIC struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Device *string `json:"device,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents an MAC address. + Mac *string `json:"mac,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` + // Possible values: `ACTIVE`, `DOWN`. + Status *string `json:"status,omitempty"` + // Possible values: `server`, `metadata`, `gateway`, `none`. + Type *string `json:"type,omitempty"` +} + +// NewNIC instantiates a new NIC object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNIC() *NIC { + this := NIC{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// NewNICWithDefaults instantiates a new NIC object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNICWithDefaults() *NIC { + this := NIC{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *NIC) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *NIC) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *NIC) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *NIC) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *NIC) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *NIC) SetDescription(v string) { + o.Description = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *NIC) GetDevice() string { + if o == nil || IsNil(o.Device) { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetDeviceOk() (*string, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *NIC) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *NIC) SetDevice(v string) { + o.Device = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NIC) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NIC) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NIC) SetId(v string) { + o.Id = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *NIC) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *NIC) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *NIC) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *NIC) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *NIC) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *NIC) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *NIC) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *NIC) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *NIC) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMac returns the Mac field value if set, zero value otherwise. +func (o *NIC) GetMac() string { + if o == nil || IsNil(o.Mac) { + var ret string + return ret + } + return *o.Mac +} + +// GetMacOk returns a tuple with the Mac field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetMacOk() (*string, bool) { + if o == nil || IsNil(o.Mac) { + return nil, false + } + return o.Mac, true +} + +// HasMac returns a boolean if a field has been set. +func (o *NIC) HasMac() bool { + if o != nil && !IsNil(o.Mac) { + return true + } + + return false +} + +// SetMac gets a reference to the given string and assigns it to the Mac field. +func (o *NIC) SetMac(v string) { + o.Mac = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *NIC) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *NIC) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *NIC) SetName(v string) { + o.Name = &v +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *NIC) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *NIC) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *NIC) SetNetworkId(v string) { + o.NetworkId = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *NIC) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *NIC) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *NIC) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *NIC) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *NIC) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *NIC) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *NIC) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *NIC) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *NIC) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *NIC) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *NIC) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *NIC) SetType(v string) { + o.Type = &v +} + +func (o NIC) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NIC) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Mac) { + toSerialize["mac"] = o.Mac + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableNIC struct { + value *NIC + isSet bool +} + +func (v NullableNIC) Get() *NIC { + return v.value +} + +func (v *NullableNIC) Set(val *NIC) { + v.value = val + v.isSet = true +} + +func (v NullableNIC) IsSet() bool { + return v.isSet +} + +func (v *NullableNIC) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNIC(val *NIC) *NullableNIC { + return &NullableNIC{value: val, isSet: true} +} + +func (v NullableNIC) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNIC) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_nic_list_response.go b/services/iaas/v1api/model_nic_list_response.go new file mode 100644 index 000000000..99224d420 --- /dev/null +++ b/services/iaas/v1api/model_nic_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NICListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NICListResponse{} + +// NICListResponse NIC list response. +type NICListResponse struct { + // A list of network interfaces. + Items []NIC `json:"items"` +} + +type _NICListResponse NICListResponse + +// NewNICListResponse instantiates a new NICListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNICListResponse(items []NIC) *NICListResponse { + this := NICListResponse{} + this.Items = items + return &this +} + +// NewNICListResponseWithDefaults instantiates a new NICListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNICListResponseWithDefaults() *NICListResponse { + this := NICListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NICListResponse) GetItems() []NIC { + if o == nil { + var ret []NIC + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NICListResponse) GetItemsOk() ([]NIC, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NICListResponse) SetItems(v []NIC) { + o.Items = v +} + +func (o NICListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NICListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NICListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNICListResponse := _NICListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNICListResponse) + + if err != nil { + return err + } + + *o = NICListResponse(varNICListResponse) + + return err +} + +type NullableNICListResponse struct { + value *NICListResponse + isSet bool +} + +func (v NullableNICListResponse) Get() *NICListResponse { + return v.value +} + +func (v *NullableNICListResponse) Set(val *NICListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNICListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNICListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNICListResponse(val *NICListResponse) *NullableNICListResponse { + return &NullableNICListResponse{value: val, isSet: true} +} + +func (v NullableNICListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNICListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_partial_update_network_area_payload.go b/services/iaas/v1api/model_partial_update_network_area_payload.go new file mode 100644 index 000000000..b5ec4dea3 --- /dev/null +++ b/services/iaas/v1api/model_partial_update_network_area_payload.go @@ -0,0 +1,199 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateNetworkAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkAreaPayload{} + +// PartialUpdateNetworkAreaPayload struct for PartialUpdateNetworkAreaPayload +type PartialUpdateNetworkAreaPayload struct { + AddressFamily *UpdateAreaAddressFamily `json:"addressFamily,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewPartialUpdateNetworkAreaPayload instantiates a new PartialUpdateNetworkAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateNetworkAreaPayload() *PartialUpdateNetworkAreaPayload { + this := PartialUpdateNetworkAreaPayload{} + return &this +} + +// NewPartialUpdateNetworkAreaPayloadWithDefaults instantiates a new PartialUpdateNetworkAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateNetworkAreaPayloadWithDefaults() *PartialUpdateNetworkAreaPayload { + this := PartialUpdateNetworkAreaPayload{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetAddressFamily() UpdateAreaAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret UpdateAreaAddressFamily + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetAddressFamilyOk() (*UpdateAreaAddressFamily, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given UpdateAreaAddressFamily and assigns it to the AddressFamily field. +func (o *PartialUpdateNetworkAreaPayload) SetAddressFamily(v UpdateAreaAddressFamily) { + o.AddressFamily = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkAreaPayload) SetName(v string) { + o.Name = &v +} + +func (o PartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["addressFamily"] = o.AddressFamily + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkAreaPayload struct { + value *PartialUpdateNetworkAreaPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkAreaPayload) Get() *PartialUpdateNetworkAreaPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkAreaPayload) Set(val *PartialUpdateNetworkAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkAreaPayload(val *PartialUpdateNetworkAreaPayload) *NullablePartialUpdateNetworkAreaPayload { + return &NullablePartialUpdateNetworkAreaPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_partial_update_network_payload.go b/services/iaas/v1api/model_partial_update_network_payload.go new file mode 100644 index 000000000..f57c224c2 --- /dev/null +++ b/services/iaas/v1api/model_partial_update_network_payload.go @@ -0,0 +1,273 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkPayload{} + +// PartialUpdateNetworkPayload Object that represents the request body for a network update. +type PartialUpdateNetworkPayload struct { + AddressFamily *UpdateNetworkAddressFamily `json:"addressFamily,omitempty"` + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` +} + +// NewPartialUpdateNetworkPayload instantiates a new PartialUpdateNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateNetworkPayload() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// NewPartialUpdateNetworkPayloadWithDefaults instantiates a new PartialUpdateNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// GetAddressFamily returns the AddressFamily field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetAddressFamily() UpdateNetworkAddressFamily { + if o == nil || IsNil(o.AddressFamily) { + var ret UpdateNetworkAddressFamily + return ret + } + return *o.AddressFamily +} + +// GetAddressFamilyOk returns a tuple with the AddressFamily field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetAddressFamilyOk() (*UpdateNetworkAddressFamily, bool) { + if o == nil || IsNil(o.AddressFamily) { + return nil, false + } + return o.AddressFamily, true +} + +// HasAddressFamily returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasAddressFamily() bool { + if o != nil && !IsNil(o.AddressFamily) { + return true + } + + return false +} + +// SetAddressFamily gets a reference to the given UpdateNetworkAddressFamily and assigns it to the AddressFamily field. +func (o *PartialUpdateNetworkPayload) SetAddressFamily(v UpdateNetworkAddressFamily) { + o.AddressFamily = &v +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *PartialUpdateNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkPayload) SetName(v string) { + o.Name = &v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *PartialUpdateNetworkPayload) SetRouted(v bool) { + o.Routed = &v +} + +func (o PartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AddressFamily) { + toSerialize["addressFamily"] = o.AddressFamily + } + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkPayload struct { + value *PartialUpdateNetworkPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkPayload) Get() *PartialUpdateNetworkPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkPayload) Set(val *PartialUpdateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkPayload(val *PartialUpdateNetworkPayload) *NullablePartialUpdateNetworkPayload { + return &NullablePartialUpdateNetworkPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_port_range.go b/services/iaas/v1api/model_port_range.go new file mode 100644 index 000000000..4b3a77458 --- /dev/null +++ b/services/iaas/v1api/model_port_range.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PortRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortRange{} + +// PortRange Object that represents a range of ports. +type PortRange struct { + // The maximum port number. Should be greater or equal to the minimum. + Max int64 `json:"max"` + // The minimum port number. Should be less or equal to the maximum. + Min int64 `json:"min"` +} + +type _PortRange PortRange + +// NewPortRange instantiates a new PortRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortRange(max int64, min int64) *PortRange { + this := PortRange{} + this.Max = max + this.Min = min + return &this +} + +// NewPortRangeWithDefaults instantiates a new PortRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortRangeWithDefaults() *PortRange { + this := PortRange{} + return &this +} + +// GetMax returns the Max field value +func (o *PortRange) GetMax() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Max +} + +// GetMaxOk returns a tuple with the Max field value +// and a boolean to check if the value has been set. +func (o *PortRange) GetMaxOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value +func (o *PortRange) SetMax(v int64) { + o.Max = v +} + +// GetMin returns the Min field value +func (o *PortRange) GetMin() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Min +} + +// GetMinOk returns a tuple with the Min field value +// and a boolean to check if the value has been set. +func (o *PortRange) GetMinOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value +func (o *PortRange) SetMin(v int64) { + o.Min = v +} + +func (o PortRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + return toSerialize, nil +} + +func (o *PortRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "max", + "min", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPortRange := _PortRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPortRange) + + if err != nil { + return err + } + + *o = PortRange(varPortRange) + + return err +} + +type NullablePortRange struct { + value *PortRange + isSet bool +} + +func (v NullablePortRange) Get() *PortRange { + return v.value +} + +func (v *NullablePortRange) Set(val *PortRange) { + v.value = val + v.isSet = true +} + +func (v NullablePortRange) IsSet() bool { + return v.isSet +} + +func (v *NullablePortRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortRange(val *PortRange) *NullablePortRange { + return &NullablePortRange{value: val, isSet: true} +} + +func (v NullablePortRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_project.go b/services/iaas/v1api/model_project.go new file mode 100644 index 000000000..ca9206f68 --- /dev/null +++ b/services/iaas/v1api/model_project.go @@ -0,0 +1,363 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Project type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Project{} + +// Project Object that represents a STACKIT project. +type Project struct { + AreaId AreaId `json:"areaId"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + InternetAccess *bool `json:"internetAccess,omitempty"` + // The identifier (ID) of the OpenStack project in the main region eu01. + OpenstackProjectId *string `json:"openstackProjectId,omitempty" validate:"regexp=^[0-9a-f]{32}$"` + // Universally Unique Identifier (UUID). + ProjectId string `json:"projectId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + State string `json:"state"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Project Project + +// NewProject instantiates a new Project object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProject(areaId AreaId, projectId string, state string) *Project { + this := Project{} + this.AreaId = areaId + this.ProjectId = projectId + this.State = state + return &this +} + +// NewProjectWithDefaults instantiates a new Project object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectWithDefaults() *Project { + this := Project{} + return &this +} + +// GetAreaId returns the AreaId field value +func (o *Project) GetAreaId() AreaId { + if o == nil { + var ret AreaId + return ret + } + + return o.AreaId +} + +// GetAreaIdOk returns a tuple with the AreaId field value +// and a boolean to check if the value has been set. +func (o *Project) GetAreaIdOk() (*AreaId, bool) { + if o == nil { + return nil, false + } + return &o.AreaId, true +} + +// SetAreaId sets field value +func (o *Project) SetAreaId(v AreaId) { + o.AreaId = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Project) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Project) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Project) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetInternetAccess returns the InternetAccess field value if set, zero value otherwise. +func (o *Project) GetInternetAccess() bool { + if o == nil || IsNil(o.InternetAccess) { + var ret bool + return ret + } + return *o.InternetAccess +} + +// GetInternetAccessOk returns a tuple with the InternetAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetInternetAccessOk() (*bool, bool) { + if o == nil || IsNil(o.InternetAccess) { + return nil, false + } + return o.InternetAccess, true +} + +// HasInternetAccess returns a boolean if a field has been set. +func (o *Project) HasInternetAccess() bool { + if o != nil && !IsNil(o.InternetAccess) { + return true + } + + return false +} + +// SetInternetAccess gets a reference to the given bool and assigns it to the InternetAccess field. +func (o *Project) SetInternetAccess(v bool) { + o.InternetAccess = &v +} + +// GetOpenstackProjectId returns the OpenstackProjectId field value if set, zero value otherwise. +func (o *Project) GetOpenstackProjectId() string { + if o == nil || IsNil(o.OpenstackProjectId) { + var ret string + return ret + } + return *o.OpenstackProjectId +} + +// GetOpenstackProjectIdOk returns a tuple with the OpenstackProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetOpenstackProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.OpenstackProjectId) { + return nil, false + } + return o.OpenstackProjectId, true +} + +// HasOpenstackProjectId returns a boolean if a field has been set. +func (o *Project) HasOpenstackProjectId() bool { + if o != nil && !IsNil(o.OpenstackProjectId) { + return true + } + + return false +} + +// SetOpenstackProjectId gets a reference to the given string and assigns it to the OpenstackProjectId field. +func (o *Project) SetOpenstackProjectId(v string) { + o.OpenstackProjectId = &v +} + +// GetProjectId returns the ProjectId field value +func (o *Project) GetProjectId() string { + if o == nil { + var ret string + return ret + } + + return o.ProjectId +} + +// GetProjectIdOk returns a tuple with the ProjectId field value +// and a boolean to check if the value has been set. +func (o *Project) GetProjectIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ProjectId, true +} + +// SetProjectId sets field value +func (o *Project) SetProjectId(v string) { + o.ProjectId = v +} + +// GetState returns the State field value +func (o *Project) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *Project) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *Project) SetState(v string) { + o.State = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Project) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Project) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Project) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Project) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Project) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["areaId"] = o.AreaId + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.InternetAccess) { + toSerialize["internetAccess"] = o.InternetAccess + } + if !IsNil(o.OpenstackProjectId) { + toSerialize["openstackProjectId"] = o.OpenstackProjectId + } + toSerialize["projectId"] = o.ProjectId + toSerialize["state"] = o.State + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Project) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "areaId", + "projectId", + "state", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProject := _Project{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProject) + + if err != nil { + return err + } + + *o = Project(varProject) + + return err +} + +type NullableProject struct { + value *Project + isSet bool +} + +func (v NullableProject) Get() *Project { + return v.value +} + +func (v *NullableProject) Set(val *Project) { + v.value = val + v.isSet = true +} + +func (v NullableProject) IsSet() bool { + return v.isSet +} + +func (v *NullableProject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProject(val *Project) *NullableProject { + return &NullableProject{value: val, isSet: true} +} + +func (v NullableProject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_project_list_response.go b/services/iaas/v1api/model_project_list_response.go new file mode 100644 index 000000000..4c12cad0b --- /dev/null +++ b/services/iaas/v1api/model_project_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ProjectListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectListResponse{} + +// ProjectListResponse Project list response. +type ProjectListResponse struct { + // A list of STACKIT projects. + Items []string `json:"items"` +} + +type _ProjectListResponse ProjectListResponse + +// NewProjectListResponse instantiates a new ProjectListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectListResponse(items []string) *ProjectListResponse { + this := ProjectListResponse{} + this.Items = items + return &this +} + +// NewProjectListResponseWithDefaults instantiates a new ProjectListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectListResponseWithDefaults() *ProjectListResponse { + this := ProjectListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ProjectListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ProjectListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ProjectListResponse) SetItems(v []string) { + o.Items = v +} + +func (o ProjectListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ProjectListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectListResponse := _ProjectListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProjectListResponse) + + if err != nil { + return err + } + + *o = ProjectListResponse(varProjectListResponse) + + return err +} + +type NullableProjectListResponse struct { + value *ProjectListResponse + isSet bool +} + +func (v NullableProjectListResponse) Get() *ProjectListResponse { + return v.value +} + +func (v *NullableProjectListResponse) Set(val *ProjectListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableProjectListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectListResponse(val *ProjectListResponse) *NullableProjectListResponse { + return &NullableProjectListResponse{value: val, isSet: true} +} + +func (v NullableProjectListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_protocol.go b/services/iaas/v1api/model_protocol.go new file mode 100644 index 000000000..00be27666 --- /dev/null +++ b/services/iaas/v1api/model_protocol.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the Protocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Protocol{} + +// Protocol The schema for a protocol of a security group rule. +type Protocol struct { + // The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`. + Name *string `json:"name,omitempty"` + // The protocol number which the rule should match. + Number *int64 `json:"number,omitempty"` +} + +// NewProtocol instantiates a new Protocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProtocol() *Protocol { + this := Protocol{} + return &this +} + +// NewProtocolWithDefaults instantiates a new Protocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProtocolWithDefaults() *Protocol { + this := Protocol{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Protocol) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Protocol) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Protocol) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Protocol) SetName(v string) { + o.Name = &v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *Protocol) GetNumber() int64 { + if o == nil || IsNil(o.Number) { + var ret int64 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Protocol) GetNumberOk() (*int64, bool) { + if o == nil || IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *Protocol) HasNumber() bool { + if o != nil && !IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given int64 and assigns it to the Number field. +func (o *Protocol) SetNumber(v int64) { + o.Number = &v +} + +func (o Protocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Protocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Number) { + toSerialize["number"] = o.Number + } + return toSerialize, nil +} + +type NullableProtocol struct { + value *Protocol + isSet bool +} + +func (v NullableProtocol) Get() *Protocol { + return v.value +} + +func (v *NullableProtocol) Set(val *Protocol) { + v.value = val + v.isSet = true +} + +func (v NullableProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocol(val *Protocol) *NullableProtocol { + return &NullableProtocol{value: val, isSet: true} +} + +func (v NullableProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_public_ip.go b/services/iaas/v1api/model_public_ip.go new file mode 100644 index 000000000..2a6c81003 --- /dev/null +++ b/services/iaas/v1api/model_public_ip.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the PublicIp type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicIp{} + +// PublicIp Object that represents a public IP. +type PublicIp struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ip *string `json:"ip,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewPublicIp instantiates a new PublicIp object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicIp() *PublicIp { + this := PublicIp{} + return &this +} + +// NewPublicIpWithDefaults instantiates a new PublicIp object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicIpWithDefaults() *PublicIp { + this := PublicIp{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PublicIp) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PublicIp) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PublicIp) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *PublicIp) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *PublicIp) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *PublicIp) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PublicIp) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PublicIp) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PublicIp) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PublicIp) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PublicIp) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *PublicIp) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *PublicIp) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *PublicIp) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *PublicIp) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o PublicIp) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicIp) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullablePublicIp struct { + value *PublicIp + isSet bool +} + +func (v NullablePublicIp) Get() *PublicIp { + return v.value +} + +func (v *NullablePublicIp) Set(val *PublicIp) { + v.value = val + v.isSet = true +} + +func (v NullablePublicIp) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicIp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicIp(val *PublicIp) *NullablePublicIp { + return &NullablePublicIp{value: val, isSet: true} +} + +func (v NullablePublicIp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicIp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_public_ip_list_response.go b/services/iaas/v1api/model_public_ip_list_response.go new file mode 100644 index 000000000..33e8da630 --- /dev/null +++ b/services/iaas/v1api/model_public_ip_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicIpListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicIpListResponse{} + +// PublicIpListResponse Public IP list response. +type PublicIpListResponse struct { + // A list of public IPs. + Items []PublicIp `json:"items"` +} + +type _PublicIpListResponse PublicIpListResponse + +// NewPublicIpListResponse instantiates a new PublicIpListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicIpListResponse(items []PublicIp) *PublicIpListResponse { + this := PublicIpListResponse{} + this.Items = items + return &this +} + +// NewPublicIpListResponseWithDefaults instantiates a new PublicIpListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicIpListResponseWithDefaults() *PublicIpListResponse { + this := PublicIpListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *PublicIpListResponse) GetItems() []PublicIp { + if o == nil { + var ret []PublicIp + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *PublicIpListResponse) GetItemsOk() ([]PublicIp, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *PublicIpListResponse) SetItems(v []PublicIp) { + o.Items = v +} + +func (o PublicIpListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicIpListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *PublicIpListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicIpListResponse := _PublicIpListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicIpListResponse) + + if err != nil { + return err + } + + *o = PublicIpListResponse(varPublicIpListResponse) + + return err +} + +type NullablePublicIpListResponse struct { + value *PublicIpListResponse + isSet bool +} + +func (v NullablePublicIpListResponse) Get() *PublicIpListResponse { + return v.value +} + +func (v *NullablePublicIpListResponse) Set(val *PublicIpListResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePublicIpListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicIpListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicIpListResponse(val *PublicIpListResponse) *NullablePublicIpListResponse { + return &NullablePublicIpListResponse{value: val, isSet: true} +} + +func (v NullablePublicIpListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicIpListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_public_network.go b/services/iaas/v1api/model_public_network.go new file mode 100644 index 000000000..58eed5933 --- /dev/null +++ b/services/iaas/v1api/model_public_network.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicNetwork{} + +// PublicNetwork Public network. +type PublicNetwork struct { + // Classless Inter-Domain Routing (CIDR). + Cidr string `json:"cidr" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +type _PublicNetwork PublicNetwork + +// NewPublicNetwork instantiates a new PublicNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicNetwork(cidr string) *PublicNetwork { + this := PublicNetwork{} + this.Cidr = cidr + return &this +} + +// NewPublicNetworkWithDefaults instantiates a new PublicNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicNetworkWithDefaults() *PublicNetwork { + this := PublicNetwork{} + return &this +} + +// GetCidr returns the Cidr field value +func (o *PublicNetwork) GetCidr() string { + if o == nil { + var ret string + return ret + } + + return o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value +// and a boolean to check if the value has been set. +func (o *PublicNetwork) GetCidrOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cidr, true +} + +// SetCidr sets field value +func (o *PublicNetwork) SetCidr(v string) { + o.Cidr = v +} + +func (o PublicNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cidr"] = o.Cidr + return toSerialize, nil +} + +func (o *PublicNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cidr", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicNetwork := _PublicNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicNetwork) + + if err != nil { + return err + } + + *o = PublicNetwork(varPublicNetwork) + + return err +} + +type NullablePublicNetwork struct { + value *PublicNetwork + isSet bool +} + +func (v NullablePublicNetwork) Get() *PublicNetwork { + return v.value +} + +func (v *NullablePublicNetwork) Set(val *PublicNetwork) { + v.value = val + v.isSet = true +} + +func (v NullablePublicNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicNetwork(val *PublicNetwork) *NullablePublicNetwork { + return &NullablePublicNetwork{value: val, isSet: true} +} + +func (v NullablePublicNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_public_network_list_response.go b/services/iaas/v1api/model_public_network_list_response.go new file mode 100644 index 000000000..95c6937b6 --- /dev/null +++ b/services/iaas/v1api/model_public_network_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicNetworkListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicNetworkListResponse{} + +// PublicNetworkListResponse Public network list response. +type PublicNetworkListResponse struct { + // A list of public networks. + Items []PublicNetwork `json:"items"` +} + +type _PublicNetworkListResponse PublicNetworkListResponse + +// NewPublicNetworkListResponse instantiates a new PublicNetworkListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicNetworkListResponse(items []PublicNetwork) *PublicNetworkListResponse { + this := PublicNetworkListResponse{} + this.Items = items + return &this +} + +// NewPublicNetworkListResponseWithDefaults instantiates a new PublicNetworkListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicNetworkListResponseWithDefaults() *PublicNetworkListResponse { + this := PublicNetworkListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *PublicNetworkListResponse) GetItems() []PublicNetwork { + if o == nil { + var ret []PublicNetwork + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *PublicNetworkListResponse) GetItemsOk() ([]PublicNetwork, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *PublicNetworkListResponse) SetItems(v []PublicNetwork) { + o.Items = v +} + +func (o PublicNetworkListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicNetworkListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *PublicNetworkListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicNetworkListResponse := _PublicNetworkListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicNetworkListResponse) + + if err != nil { + return err + } + + *o = PublicNetworkListResponse(varPublicNetworkListResponse) + + return err +} + +type NullablePublicNetworkListResponse struct { + value *PublicNetworkListResponse + isSet bool +} + +func (v NullablePublicNetworkListResponse) Get() *PublicNetworkListResponse { + return v.value +} + +func (v *NullablePublicNetworkListResponse) Set(val *PublicNetworkListResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePublicNetworkListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicNetworkListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicNetworkListResponse(val *PublicNetworkListResponse) *NullablePublicNetworkListResponse { + return &NullablePublicNetworkListResponse{value: val, isSet: true} +} + +func (v NullablePublicNetworkListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicNetworkListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_quota.go b/services/iaas/v1api/model_quota.go new file mode 100644 index 000000000..f972e2fdd --- /dev/null +++ b/services/iaas/v1api/model_quota.go @@ -0,0 +1,185 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Quota type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Quota{} + +// Quota Object that represents a single resource quota. +type Quota struct { + Limit int64 `json:"limit"` + Usage int64 `json:"usage"` +} + +type _Quota Quota + +// NewQuota instantiates a new Quota object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuota(limit int64, usage int64) *Quota { + this := Quota{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaWithDefaults instantiates a new Quota object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaWithDefaults() *Quota { + this := Quota{} + return &this +} + +// GetLimit returns the Limit field value +func (o *Quota) GetLimit() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *Quota) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *Quota) SetLimit(v int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *Quota) GetUsage() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *Quota) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Usage, true +} + +// SetUsage sets field value +func (o *Quota) SetUsage(v int64) { + o.Usage = v +} + +func (o Quota) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Quota) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +func (o *Quota) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "limit", + "usage", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuota := _Quota{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuota) + + if err != nil { + return err + } + + *o = Quota(varQuota) + + return err +} + +type NullableQuota struct { + value *Quota + isSet bool +} + +func (v NullableQuota) Get() *Quota { + return v.value +} + +func (v *NullableQuota) Set(val *Quota) { + v.value = val + v.isSet = true +} + +func (v NullableQuota) IsSet() bool { + return v.isSet +} + +func (v *NullableQuota) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuota(val *Quota) *NullableQuota { + return &NullableQuota{value: val, isSet: true} +} + +func (v NullableQuota) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuota) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_quota_list.go b/services/iaas/v1api/model_quota_list.go new file mode 100644 index 000000000..dac315467 --- /dev/null +++ b/services/iaas/v1api/model_quota_list.go @@ -0,0 +1,477 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the QuotaList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaList{} + +// QuotaList Object that represents the quotas for a project. +type QuotaList struct { + // Total size in GiB of backups. + BackupGigabytes Quota `json:"backupGigabytes"` + // Number of backups. + Backups Quota `json:"backups"` + // Total size in GiB of volumes and snapshots. + Gigabytes Quota `json:"gigabytes"` + // Number of networks. + Networks Quota `json:"networks"` + // Number of network interfaces. + Nics Quota `json:"nics"` + // Number of public IP addresses. + PublicIps Quota `json:"publicIps"` + // Amount of server RAM in MiB. + Ram Quota `json:"ram"` + // Number of security group rules. + SecurityGroupRules Quota `json:"securityGroupRules"` + // Number of security groups. + SecurityGroups Quota `json:"securityGroups"` + // Number of snapshots. + Snapshots Quota `json:"snapshots"` + // Number of server cores. + Vcpu Quota `json:"vcpu"` + // Number of volumes. + Volumes Quota `json:"volumes"` +} + +type _QuotaList QuotaList + +// NewQuotaList instantiates a new QuotaList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuotaList(backupGigabytes Quota, backups Quota, gigabytes Quota, networks Quota, nics Quota, publicIps Quota, ram Quota, securityGroupRules Quota, securityGroups Quota, snapshots Quota, vcpu Quota, volumes Quota) *QuotaList { + this := QuotaList{} + this.BackupGigabytes = backupGigabytes + this.Backups = backups + this.Gigabytes = gigabytes + this.Networks = networks + this.Nics = nics + this.PublicIps = publicIps + this.Ram = ram + this.SecurityGroupRules = securityGroupRules + this.SecurityGroups = securityGroups + this.Snapshots = snapshots + this.Vcpu = vcpu + this.Volumes = volumes + return &this +} + +// NewQuotaListWithDefaults instantiates a new QuotaList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaListWithDefaults() *QuotaList { + this := QuotaList{} + return &this +} + +// GetBackupGigabytes returns the BackupGigabytes field value +func (o *QuotaList) GetBackupGigabytes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.BackupGigabytes +} + +// GetBackupGigabytesOk returns a tuple with the BackupGigabytes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetBackupGigabytesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.BackupGigabytes, true +} + +// SetBackupGigabytes sets field value +func (o *QuotaList) SetBackupGigabytes(v Quota) { + o.BackupGigabytes = v +} + +// GetBackups returns the Backups field value +func (o *QuotaList) GetBackups() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Backups +} + +// GetBackupsOk returns a tuple with the Backups field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetBackupsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Backups, true +} + +// SetBackups sets field value +func (o *QuotaList) SetBackups(v Quota) { + o.Backups = v +} + +// GetGigabytes returns the Gigabytes field value +func (o *QuotaList) GetGigabytes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Gigabytes +} + +// GetGigabytesOk returns a tuple with the Gigabytes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetGigabytesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Gigabytes, true +} + +// SetGigabytes sets field value +func (o *QuotaList) SetGigabytes(v Quota) { + o.Gigabytes = v +} + +// GetNetworks returns the Networks field value +func (o *QuotaList) GetNetworks() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetNetworksOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Networks, true +} + +// SetNetworks sets field value +func (o *QuotaList) SetNetworks(v Quota) { + o.Networks = v +} + +// GetNics returns the Nics field value +func (o *QuotaList) GetNics() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetNicsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Nics, true +} + +// SetNics sets field value +func (o *QuotaList) SetNics(v Quota) { + o.Nics = v +} + +// GetPublicIps returns the PublicIps field value +func (o *QuotaList) GetPublicIps() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.PublicIps +} + +// GetPublicIpsOk returns a tuple with the PublicIps field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetPublicIpsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.PublicIps, true +} + +// SetPublicIps sets field value +func (o *QuotaList) SetPublicIps(v Quota) { + o.PublicIps = v +} + +// GetRam returns the Ram field value +func (o *QuotaList) GetRam() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Ram +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetRamOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Ram, true +} + +// SetRam sets field value +func (o *QuotaList) SetRam(v Quota) { + o.Ram = v +} + +// GetSecurityGroupRules returns the SecurityGroupRules field value +func (o *QuotaList) GetSecurityGroupRules() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.SecurityGroupRules +} + +// GetSecurityGroupRulesOk returns a tuple with the SecurityGroupRules field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSecurityGroupRulesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.SecurityGroupRules, true +} + +// SetSecurityGroupRules sets field value +func (o *QuotaList) SetSecurityGroupRules(v Quota) { + o.SecurityGroupRules = v +} + +// GetSecurityGroups returns the SecurityGroups field value +func (o *QuotaList) GetSecurityGroups() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSecurityGroupsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.SecurityGroups, true +} + +// SetSecurityGroups sets field value +func (o *QuotaList) SetSecurityGroups(v Quota) { + o.SecurityGroups = v +} + +// GetSnapshots returns the Snapshots field value +func (o *QuotaList) GetSnapshots() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Snapshots +} + +// GetSnapshotsOk returns a tuple with the Snapshots field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSnapshotsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Snapshots, true +} + +// SetSnapshots sets field value +func (o *QuotaList) SetSnapshots(v Quota) { + o.Snapshots = v +} + +// GetVcpu returns the Vcpu field value +func (o *QuotaList) GetVcpu() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Vcpu +} + +// GetVcpuOk returns a tuple with the Vcpu field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetVcpuOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Vcpu, true +} + +// SetVcpu sets field value +func (o *QuotaList) SetVcpu(v Quota) { + o.Vcpu = v +} + +// GetVolumes returns the Volumes field value +func (o *QuotaList) GetVolumes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetVolumesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Volumes, true +} + +// SetVolumes sets field value +func (o *QuotaList) SetVolumes(v Quota) { + o.Volumes = v +} + +func (o QuotaList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuotaList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupGigabytes"] = o.BackupGigabytes + toSerialize["backups"] = o.Backups + toSerialize["gigabytes"] = o.Gigabytes + toSerialize["networks"] = o.Networks + toSerialize["nics"] = o.Nics + toSerialize["publicIps"] = o.PublicIps + toSerialize["ram"] = o.Ram + toSerialize["securityGroupRules"] = o.SecurityGroupRules + toSerialize["securityGroups"] = o.SecurityGroups + toSerialize["snapshots"] = o.Snapshots + toSerialize["vcpu"] = o.Vcpu + toSerialize["volumes"] = o.Volumes + return toSerialize, nil +} + +func (o *QuotaList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupGigabytes", + "backups", + "gigabytes", + "networks", + "nics", + "publicIps", + "ram", + "securityGroupRules", + "securityGroups", + "snapshots", + "vcpu", + "volumes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuotaList := _QuotaList{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuotaList) + + if err != nil { + return err + } + + *o = QuotaList(varQuotaList) + + return err +} + +type NullableQuotaList struct { + value *QuotaList + isSet bool +} + +func (v NullableQuotaList) Get() *QuotaList { + return v.value +} + +func (v *NullableQuotaList) Set(val *QuotaList) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaList) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaList(val *QuotaList) *NullableQuotaList { + return &NullableQuotaList{value: val, isSet: true} +} + +func (v NullableQuotaList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_quota_list_response.go b/services/iaas/v1api/model_quota_list_response.go new file mode 100644 index 000000000..1c5da9eee --- /dev/null +++ b/services/iaas/v1api/model_quota_list_response.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the QuotaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListResponse{} + +// QuotaListResponse Quotas list response. +type QuotaListResponse struct { + Quotas QuotaList `json:"quotas"` +} + +type _QuotaListResponse QuotaListResponse + +// NewQuotaListResponse instantiates a new QuotaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuotaListResponse(quotas QuotaList) *QuotaListResponse { + this := QuotaListResponse{} + this.Quotas = quotas + return &this +} + +// NewQuotaListResponseWithDefaults instantiates a new QuotaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaListResponseWithDefaults() *QuotaListResponse { + this := QuotaListResponse{} + return &this +} + +// GetQuotas returns the Quotas field value +func (o *QuotaListResponse) GetQuotas() QuotaList { + if o == nil { + var ret QuotaList + return ret + } + + return o.Quotas +} + +// GetQuotasOk returns a tuple with the Quotas field value +// and a boolean to check if the value has been set. +func (o *QuotaListResponse) GetQuotasOk() (*QuotaList, bool) { + if o == nil { + return nil, false + } + return &o.Quotas, true +} + +// SetQuotas sets field value +func (o *QuotaListResponse) SetQuotas(v QuotaList) { + o.Quotas = v +} + +func (o QuotaListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuotaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["quotas"] = o.Quotas + return toSerialize, nil +} + +func (o *QuotaListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "quotas", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuotaListResponse := _QuotaListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuotaListResponse) + + if err != nil { + return err + } + + *o = QuotaListResponse(varQuotaListResponse) + + return err +} + +type NullableQuotaListResponse struct { + value *QuotaListResponse + isSet bool +} + +func (v NullableQuotaListResponse) Get() *QuotaListResponse { + return v.value +} + +func (v *NullableQuotaListResponse) Set(val *QuotaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListResponse(val *QuotaListResponse) *NullableQuotaListResponse { + return &NullableQuotaListResponse{value: val, isSet: true} +} + +func (v NullableQuotaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_request.go b/services/iaas/v1api/model_request.go new file mode 100644 index 000000000..581ad2078 --- /dev/null +++ b/services/iaas/v1api/model_request.go @@ -0,0 +1,309 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Request{} + +// Request Object that represents a request. +type Request struct { + Details *string `json:"details,omitempty"` + // Object that represents a resource action. Possible values: `CREATE`, `DELETE`, `UPDATE`. + RequestAction string `json:"requestAction"` + // Identifier (ID) representing a single API request. + RequestId string `json:"requestId" validate:"regexp=^req-[0-9a-f]{32}$"` + // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. + RequestType string `json:"requestType"` + Resources []RequestResource `json:"resources"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` +} + +type _Request Request + +// NewRequest instantiates a new Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequest(requestAction string, requestId string, requestType string, resources []RequestResource, status string) *Request { + this := Request{} + this.RequestAction = requestAction + this.RequestId = requestId + this.RequestType = requestType + this.Resources = resources + this.Status = status + return &this +} + +// NewRequestWithDefaults instantiates a new Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestWithDefaults() *Request { + this := Request{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Request) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *Request) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *Request) SetDetails(v string) { + o.Details = &v +} + +// GetRequestAction returns the RequestAction field value +func (o *Request) GetRequestAction() string { + if o == nil { + var ret string + return ret + } + + return o.RequestAction +} + +// GetRequestActionOk returns a tuple with the RequestAction field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestActionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestAction, true +} + +// SetRequestAction sets field value +func (o *Request) SetRequestAction(v string) { + o.RequestAction = v +} + +// GetRequestId returns the RequestId field value +func (o *Request) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *Request) SetRequestId(v string) { + o.RequestId = v +} + +// GetRequestType returns the RequestType field value +func (o *Request) GetRequestType() string { + if o == nil { + var ret string + return ret + } + + return o.RequestType +} + +// GetRequestTypeOk returns a tuple with the RequestType field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestType, true +} + +// SetRequestType sets field value +func (o *Request) SetRequestType(v string) { + o.RequestType = v +} + +// GetResources returns the Resources field value +func (o *Request) GetResources() []RequestResource { + if o == nil { + var ret []RequestResource + return ret + } + + return o.Resources +} + +// GetResourcesOk returns a tuple with the Resources field value +// and a boolean to check if the value has been set. +func (o *Request) GetResourcesOk() ([]RequestResource, bool) { + if o == nil { + return nil, false + } + return o.Resources, true +} + +// SetResources sets field value +func (o *Request) SetResources(v []RequestResource) { + o.Resources = v +} + +// GetStatus returns the Status field value +func (o *Request) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Request) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Request) SetStatus(v string) { + o.Status = v +} + +func (o Request) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["requestAction"] = o.RequestAction + toSerialize["requestId"] = o.RequestId + toSerialize["requestType"] = o.RequestType + toSerialize["resources"] = o.Resources + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *Request) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "requestAction", + "requestId", + "requestType", + "resources", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequest := _Request{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequest) + + if err != nil { + return err + } + + *o = Request(varRequest) + + return err +} + +type NullableRequest struct { + value *Request + isSet bool +} + +func (v NullableRequest) Get() *Request { + return v.value +} + +func (v *NullableRequest) Set(val *Request) { + v.value = val + v.isSet = true +} + +func (v NullableRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequest(val *Request) *NullableRequest { + return &NullableRequest{value: val, isSet: true} +} + +func (v NullableRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_request_resource.go b/services/iaas/v1api/model_request_resource.go new file mode 100644 index 000000000..2bfd2c443 --- /dev/null +++ b/services/iaas/v1api/model_request_resource.go @@ -0,0 +1,216 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RequestResource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestResource{} + +// RequestResource Object that represents a resource as part of a request. +type RequestResource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` + // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. + Type string `json:"type"` +} + +type _RequestResource RequestResource + +// NewRequestResource instantiates a new RequestResource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestResource(id string, status string, types string) *RequestResource { + this := RequestResource{} + this.Id = id + this.Status = status + this.Type = types + return &this +} + +// NewRequestResourceWithDefaults instantiates a new RequestResource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestResourceWithDefaults() *RequestResource { + this := RequestResource{} + return &this +} + +// GetId returns the Id field value +func (o *RequestResource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RequestResource) SetId(v string) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *RequestResource) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *RequestResource) SetStatus(v string) { + o.Status = v +} + +// GetType returns the Type field value +func (o *RequestResource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *RequestResource) SetType(v string) { + o.Type = v +} + +func (o RequestResource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestResource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *RequestResource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestResource := _RequestResource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestResource) + + if err != nil { + return err + } + + *o = RequestResource(varRequestResource) + + return err +} + +type NullableRequestResource struct { + value *RequestResource + isSet bool +} + +func (v NullableRequestResource) Get() *RequestResource { + return v.value +} + +func (v *NullableRequestResource) Set(val *RequestResource) { + v.value = val + v.isSet = true +} + +func (v NullableRequestResource) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestResource(val *RequestResource) *NullableRequestResource { + return &NullableRequestResource{value: val, isSet: true} +} + +func (v NullableRequestResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_rescue_server_payload.go b/services/iaas/v1api/model_rescue_server_payload.go new file mode 100644 index 000000000..223189765 --- /dev/null +++ b/services/iaas/v1api/model_rescue_server_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RescueServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RescueServerPayload{} + +// RescueServerPayload struct for RescueServerPayload +type RescueServerPayload struct { + // Universally Unique Identifier (UUID). + Image string `json:"image" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _RescueServerPayload RescueServerPayload + +// NewRescueServerPayload instantiates a new RescueServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRescueServerPayload(image string) *RescueServerPayload { + this := RescueServerPayload{} + this.Image = image + return &this +} + +// NewRescueServerPayloadWithDefaults instantiates a new RescueServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRescueServerPayloadWithDefaults() *RescueServerPayload { + this := RescueServerPayload{} + return &this +} + +// GetImage returns the Image field value +func (o *RescueServerPayload) GetImage() string { + if o == nil { + var ret string + return ret + } + + return o.Image +} + +// GetImageOk returns a tuple with the Image field value +// and a boolean to check if the value has been set. +func (o *RescueServerPayload) GetImageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Image, true +} + +// SetImage sets field value +func (o *RescueServerPayload) SetImage(v string) { + o.Image = v +} + +func (o RescueServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RescueServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["image"] = o.Image + return toSerialize, nil +} + +func (o *RescueServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "image", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRescueServerPayload := _RescueServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRescueServerPayload) + + if err != nil { + return err + } + + *o = RescueServerPayload(varRescueServerPayload) + + return err +} + +type NullableRescueServerPayload struct { + value *RescueServerPayload + isSet bool +} + +func (v NullableRescueServerPayload) Get() *RescueServerPayload { + return v.value +} + +func (v *NullableRescueServerPayload) Set(val *RescueServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableRescueServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableRescueServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRescueServerPayload(val *RescueServerPayload) *NullableRescueServerPayload { + return &NullableRescueServerPayload{value: val, isSet: true} +} + +func (v NullableRescueServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRescueServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_resize_server_payload.go b/services/iaas/v1api/model_resize_server_payload.go new file mode 100644 index 000000000..2abab4f20 --- /dev/null +++ b/services/iaas/v1api/model_resize_server_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ResizeServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResizeServerPayload{} + +// ResizeServerPayload struct for ResizeServerPayload +type ResizeServerPayload struct { + // The name for a General Object. Matches Names and also UUIDs. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +type _ResizeServerPayload ResizeServerPayload + +// NewResizeServerPayload instantiates a new ResizeServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResizeServerPayload(machineType string) *ResizeServerPayload { + this := ResizeServerPayload{} + this.MachineType = machineType + return &this +} + +// NewResizeServerPayloadWithDefaults instantiates a new ResizeServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResizeServerPayloadWithDefaults() *ResizeServerPayload { + this := ResizeServerPayload{} + return &this +} + +// GetMachineType returns the MachineType field value +func (o *ResizeServerPayload) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *ResizeServerPayload) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *ResizeServerPayload) SetMachineType(v string) { + o.MachineType = v +} + +func (o ResizeServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResizeServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["machineType"] = o.MachineType + return toSerialize, nil +} + +func (o *ResizeServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResizeServerPayload := _ResizeServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResizeServerPayload) + + if err != nil { + return err + } + + *o = ResizeServerPayload(varResizeServerPayload) + + return err +} + +type NullableResizeServerPayload struct { + value *ResizeServerPayload + isSet bool +} + +func (v NullableResizeServerPayload) Get() *ResizeServerPayload { + return v.value +} + +func (v *NullableResizeServerPayload) Set(val *ResizeServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableResizeServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableResizeServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResizeServerPayload(val *ResizeServerPayload) *NullableResizeServerPayload { + return &NullableResizeServerPayload{value: val, isSet: true} +} + +func (v NullableResizeServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResizeServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_resize_volume_payload.go b/services/iaas/v1api/model_resize_volume_payload.go new file mode 100644 index 000000000..06fac15a6 --- /dev/null +++ b/services/iaas/v1api/model_resize_volume_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ResizeVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResizeVolumePayload{} + +// ResizeVolumePayload struct for ResizeVolumePayload +type ResizeVolumePayload struct { + // Size in Gigabyte. + Size int64 `json:"size"` +} + +type _ResizeVolumePayload ResizeVolumePayload + +// NewResizeVolumePayload instantiates a new ResizeVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResizeVolumePayload(size int64) *ResizeVolumePayload { + this := ResizeVolumePayload{} + this.Size = size + return &this +} + +// NewResizeVolumePayloadWithDefaults instantiates a new ResizeVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResizeVolumePayloadWithDefaults() *ResizeVolumePayload { + this := ResizeVolumePayload{} + return &this +} + +// GetSize returns the Size field value +func (o *ResizeVolumePayload) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *ResizeVolumePayload) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *ResizeVolumePayload) SetSize(v int64) { + o.Size = v +} + +func (o ResizeVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResizeVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["size"] = o.Size + return toSerialize, nil +} + +func (o *ResizeVolumePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "size", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResizeVolumePayload := _ResizeVolumePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResizeVolumePayload) + + if err != nil { + return err + } + + *o = ResizeVolumePayload(varResizeVolumePayload) + + return err +} + +type NullableResizeVolumePayload struct { + value *ResizeVolumePayload + isSet bool +} + +func (v NullableResizeVolumePayload) Get() *ResizeVolumePayload { + return v.value +} + +func (v *NullableResizeVolumePayload) Set(val *ResizeVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableResizeVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableResizeVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResizeVolumePayload(val *ResizeVolumePayload) *NullableResizeVolumePayload { + return &NullableResizeVolumePayload{value: val, isSet: true} +} + +func (v NullableResizeVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResizeVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_route.go b/services/iaas/v1api/model_route.go new file mode 100644 index 000000000..622e1108c --- /dev/null +++ b/services/iaas/v1api/model_route.go @@ -0,0 +1,336 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Route type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Route{} + +// Route Object represents a network route. +type Route struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents an IP address. + Nexthop string `json:"nexthop" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // Classless Inter-Domain Routing (CIDR). + Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + // Universally Unique Identifier (UUID). + RouteId *string `json:"routeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Route Route + +// NewRoute instantiates a new Route object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoute(nexthop string, prefix string) *Route { + this := Route{} + this.Nexthop = nexthop + this.Prefix = prefix + return &this +} + +// NewRouteWithDefaults instantiates a new Route object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteWithDefaults() *Route { + this := Route{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Route) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Route) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Route) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Route) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Route) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Route) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNexthop returns the Nexthop field value +func (o *Route) GetNexthop() string { + if o == nil { + var ret string + return ret + } + + return o.Nexthop +} + +// GetNexthopOk returns a tuple with the Nexthop field value +// and a boolean to check if the value has been set. +func (o *Route) GetNexthopOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Nexthop, true +} + +// SetNexthop sets field value +func (o *Route) SetNexthop(v string) { + o.Nexthop = v +} + +// GetPrefix returns the Prefix field value +func (o *Route) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *Route) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *Route) SetPrefix(v string) { + o.Prefix = v +} + +// GetRouteId returns the RouteId field value if set, zero value otherwise. +func (o *Route) GetRouteId() string { + if o == nil || IsNil(o.RouteId) { + var ret string + return ret + } + return *o.RouteId +} + +// GetRouteIdOk returns a tuple with the RouteId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetRouteIdOk() (*string, bool) { + if o == nil || IsNil(o.RouteId) { + return nil, false + } + return o.RouteId, true +} + +// HasRouteId returns a boolean if a field has been set. +func (o *Route) HasRouteId() bool { + if o != nil && !IsNil(o.RouteId) { + return true + } + + return false +} + +// SetRouteId gets a reference to the given string and assigns it to the RouteId field. +func (o *Route) SetRouteId(v string) { + o.RouteId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Route) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Route) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Route) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Route) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Route) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["nexthop"] = o.Nexthop + toSerialize["prefix"] = o.Prefix + if !IsNil(o.RouteId) { + toSerialize["routeId"] = o.RouteId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Route) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "nexthop", + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoute := _Route{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoute) + + if err != nil { + return err + } + + *o = Route(varRoute) + + return err +} + +type NullableRoute struct { + value *Route + isSet bool +} + +func (v NullableRoute) Get() *Route { + return v.value +} + +func (v *NullableRoute) Set(val *Route) { + v.value = val + v.isSet = true +} + +func (v NullableRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoute(val *Route) *NullableRoute { + return &NullableRoute{value: val, isSet: true} +} + +func (v NullableRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_route_list_response.go b/services/iaas/v1api/model_route_list_response.go new file mode 100644 index 000000000..9e54eb4bf --- /dev/null +++ b/services/iaas/v1api/model_route_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RouteListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RouteListResponse{} + +// RouteListResponse Route list response. +type RouteListResponse struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _RouteListResponse RouteListResponse + +// NewRouteListResponse instantiates a new RouteListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRouteListResponse(items []Route) *RouteListResponse { + this := RouteListResponse{} + this.Items = items + return &this +} + +// NewRouteListResponseWithDefaults instantiates a new RouteListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteListResponseWithDefaults() *RouteListResponse { + this := RouteListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RouteListResponse) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RouteListResponse) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RouteListResponse) SetItems(v []Route) { + o.Items = v +} + +func (o RouteListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RouteListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RouteListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRouteListResponse := _RouteListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRouteListResponse) + + if err != nil { + return err + } + + *o = RouteListResponse(varRouteListResponse) + + return err +} + +type NullableRouteListResponse struct { + value *RouteListResponse + isSet bool +} + +func (v NullableRouteListResponse) Get() *RouteListResponse { + return v.value +} + +func (v *NullableRouteListResponse) Set(val *RouteListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRouteListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteListResponse(val *RouteListResponse) *NullableRouteListResponse { + return &NullableRouteListResponse{value: val, isSet: true} +} + +func (v NullableRouteListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_security_group.go b/services/iaas/v1api/model_security_group.go new file mode 100644 index 000000000..d4a57cbd3 --- /dev/null +++ b/services/iaas/v1api/model_security_group.go @@ -0,0 +1,422 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the SecurityGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroup{} + +// SecurityGroup Object that represents a security group. +type SecurityGroup struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A list containing security group rule objects. + Rules []SecurityGroupRule `json:"rules,omitempty"` + // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. + Stateful *bool `json:"stateful,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _SecurityGroup SecurityGroup + +// NewSecurityGroup instantiates a new SecurityGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroup(name string) *SecurityGroup { + this := SecurityGroup{} + this.Name = name + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// NewSecurityGroupWithDefaults instantiates a new SecurityGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupWithDefaults() *SecurityGroup { + this := SecurityGroup{} + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SecurityGroup) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SecurityGroup) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SecurityGroup) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SecurityGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SecurityGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SecurityGroup) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SecurityGroup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SecurityGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SecurityGroup) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *SecurityGroup) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *SecurityGroup) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *SecurityGroup) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *SecurityGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SecurityGroup) SetName(v string) { + o.Name = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *SecurityGroup) GetRules() []SecurityGroupRule { + if o == nil || IsNil(o.Rules) { + var ret []SecurityGroupRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetRulesOk() ([]SecurityGroupRule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *SecurityGroup) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. +func (o *SecurityGroup) SetRules(v []SecurityGroupRule) { + o.Rules = v +} + +// GetStateful returns the Stateful field value if set, zero value otherwise. +func (o *SecurityGroup) GetStateful() bool { + if o == nil || IsNil(o.Stateful) { + var ret bool + return ret + } + return *o.Stateful +} + +// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetStatefulOk() (*bool, bool) { + if o == nil || IsNil(o.Stateful) { + return nil, false + } + return o.Stateful, true +} + +// HasStateful returns a boolean if a field has been set. +func (o *SecurityGroup) HasStateful() bool { + if o != nil && !IsNil(o.Stateful) { + return true + } + + return false +} + +// SetStateful gets a reference to the given bool and assigns it to the Stateful field. +func (o *SecurityGroup) SetStateful(v bool) { + o.Stateful = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *SecurityGroup) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *SecurityGroup) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *SecurityGroup) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o SecurityGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + if !IsNil(o.Stateful) { + toSerialize["stateful"] = o.Stateful + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *SecurityGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroup := _SecurityGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroup) + + if err != nil { + return err + } + + *o = SecurityGroup(varSecurityGroup) + + return err +} + +type NullableSecurityGroup struct { + value *SecurityGroup + isSet bool +} + +func (v NullableSecurityGroup) Get() *SecurityGroup { + return v.value +} + +func (v *NullableSecurityGroup) Set(val *SecurityGroup) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroup(val *SecurityGroup) *NullableSecurityGroup { + return &NullableSecurityGroup{value: val, isSet: true} +} + +func (v NullableSecurityGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_security_group_list_response.go b/services/iaas/v1api/model_security_group_list_response.go new file mode 100644 index 000000000..ff6f17cd1 --- /dev/null +++ b/services/iaas/v1api/model_security_group_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SecurityGroupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupListResponse{} + +// SecurityGroupListResponse Security group list response. +type SecurityGroupListResponse struct { + // A list containing security group objects. + Items []SecurityGroup `json:"items"` +} + +type _SecurityGroupListResponse SecurityGroupListResponse + +// NewSecurityGroupListResponse instantiates a new SecurityGroupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupListResponse(items []SecurityGroup) *SecurityGroupListResponse { + this := SecurityGroupListResponse{} + this.Items = items + return &this +} + +// NewSecurityGroupListResponseWithDefaults instantiates a new SecurityGroupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupListResponseWithDefaults() *SecurityGroupListResponse { + this := SecurityGroupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SecurityGroupListResponse) GetItems() []SecurityGroup { + if o == nil { + var ret []SecurityGroup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupListResponse) GetItemsOk() ([]SecurityGroup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SecurityGroupListResponse) SetItems(v []SecurityGroup) { + o.Items = v +} + +func (o SecurityGroupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SecurityGroupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupListResponse := _SecurityGroupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupListResponse) + + if err != nil { + return err + } + + *o = SecurityGroupListResponse(varSecurityGroupListResponse) + + return err +} + +type NullableSecurityGroupListResponse struct { + value *SecurityGroupListResponse + isSet bool +} + +func (v NullableSecurityGroupListResponse) Get() *SecurityGroupListResponse { + return v.value +} + +func (v *NullableSecurityGroupListResponse) Set(val *SecurityGroupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupListResponse(val *SecurityGroupListResponse) *NullableSecurityGroupListResponse { + return &NullableSecurityGroupListResponse{value: val, isSet: true} +} + +func (v NullableSecurityGroupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_security_group_rule.go b/services/iaas/v1api/model_security_group_rule.go new file mode 100644 index 000000000..caf9d07a5 --- /dev/null +++ b/services/iaas/v1api/model_security_group_rule.go @@ -0,0 +1,567 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the SecurityGroupRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRule{} + +// SecurityGroupRule Object that represents a security group rule. +type SecurityGroupRule struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Protocol *Protocol `json:"protocol,omitempty"` +} + +type _SecurityGroupRule SecurityGroupRule + +// NewSecurityGroupRule instantiates a new SecurityGroupRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRule(direction string) *SecurityGroupRule { + this := SecurityGroupRule{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewSecurityGroupRuleWithDefaults instantiates a new SecurityGroupRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleWithDefaults() *SecurityGroupRule { + this := SecurityGroupRule{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SecurityGroupRule) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SecurityGroupRule) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *SecurityGroupRule) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *SecurityGroupRule) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *SecurityGroupRule) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *SecurityGroupRule) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SecurityGroupRule) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *SecurityGroupRule) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *SecurityGroupRule) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *SecurityGroupRule) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *SecurityGroupRule) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *SecurityGroupRule) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetProtocol() Protocol { + if o == nil || IsNil(o.Protocol) { + var ret Protocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetProtocolOk() (*Protocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +func (o *SecurityGroupRule) SetProtocol(v Protocol) { + o.Protocol = &v +} + +func (o SecurityGroupRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +func (o *SecurityGroupRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupRule := _SecurityGroupRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupRule) + + if err != nil { + return err + } + + *o = SecurityGroupRule(varSecurityGroupRule) + + return err +} + +type NullableSecurityGroupRule struct { + value *SecurityGroupRule + isSet bool +} + +func (v NullableSecurityGroupRule) Get() *SecurityGroupRule { + return v.value +} + +func (v *NullableSecurityGroupRule) Set(val *SecurityGroupRule) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRule) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRule(val *SecurityGroupRule) *NullableSecurityGroupRule { + return &NullableSecurityGroupRule{value: val, isSet: true} +} + +func (v NullableSecurityGroupRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_security_group_rule_list_response.go b/services/iaas/v1api/model_security_group_rule_list_response.go new file mode 100644 index 000000000..773a9426e --- /dev/null +++ b/services/iaas/v1api/model_security_group_rule_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SecurityGroupRuleListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRuleListResponse{} + +// SecurityGroupRuleListResponse Security group rule list response. +type SecurityGroupRuleListResponse struct { + // A list containing security group rule objects. + Items []SecurityGroupRule `json:"items"` +} + +type _SecurityGroupRuleListResponse SecurityGroupRuleListResponse + +// NewSecurityGroupRuleListResponse instantiates a new SecurityGroupRuleListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRuleListResponse(items []SecurityGroupRule) *SecurityGroupRuleListResponse { + this := SecurityGroupRuleListResponse{} + this.Items = items + return &this +} + +// NewSecurityGroupRuleListResponseWithDefaults instantiates a new SecurityGroupRuleListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleListResponseWithDefaults() *SecurityGroupRuleListResponse { + this := SecurityGroupRuleListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SecurityGroupRuleListResponse) GetItems() []SecurityGroupRule { + if o == nil { + var ret []SecurityGroupRule + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupRuleListResponse) GetItemsOk() ([]SecurityGroupRule, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SecurityGroupRuleListResponse) SetItems(v []SecurityGroupRule) { + o.Items = v +} + +func (o SecurityGroupRuleListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRuleListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SecurityGroupRuleListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupRuleListResponse := _SecurityGroupRuleListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupRuleListResponse) + + if err != nil { + return err + } + + *o = SecurityGroupRuleListResponse(varSecurityGroupRuleListResponse) + + return err +} + +type NullableSecurityGroupRuleListResponse struct { + value *SecurityGroupRuleListResponse + isSet bool +} + +func (v NullableSecurityGroupRuleListResponse) Get() *SecurityGroupRuleListResponse { + return v.value +} + +func (v *NullableSecurityGroupRuleListResponse) Set(val *SecurityGroupRuleListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRuleListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRuleListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRuleListResponse(val *SecurityGroupRuleListResponse) *NullableSecurityGroupRuleListResponse { + return &NullableSecurityGroupRuleListResponse{value: val, isSet: true} +} + +func (v NullableSecurityGroupRuleListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRuleListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_security_group_rule_protocol.go b/services/iaas/v1api/model_security_group_rule_protocol.go new file mode 100644 index 000000000..83555606f --- /dev/null +++ b/services/iaas/v1api/model_security_group_rule_protocol.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the SecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRuleProtocol{} + +// SecurityGroupRuleProtocol The internet protocol which the rule matches. +type SecurityGroupRuleProtocol struct { + Protocol *Protocol `json:"protocol,omitempty"` +} + +// NewSecurityGroupRuleProtocol instantiates a new SecurityGroupRuleProtocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRuleProtocol() *SecurityGroupRuleProtocol { + this := SecurityGroupRuleProtocol{} + return &this +} + +// NewSecurityGroupRuleProtocolWithDefaults instantiates a new SecurityGroupRuleProtocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleProtocolWithDefaults() *SecurityGroupRuleProtocol { + this := SecurityGroupRuleProtocol{} + return &this +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SecurityGroupRuleProtocol) GetProtocol() Protocol { + if o == nil || IsNil(o.Protocol) { + var ret Protocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRuleProtocol) GetProtocolOk() (*Protocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SecurityGroupRuleProtocol) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +func (o *SecurityGroupRuleProtocol) SetProtocol(v Protocol) { + o.Protocol = &v +} + +func (o SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +type NullableSecurityGroupRuleProtocol struct { + value *SecurityGroupRuleProtocol + isSet bool +} + +func (v NullableSecurityGroupRuleProtocol) Get() *SecurityGroupRuleProtocol { + return v.value +} + +func (v *NullableSecurityGroupRuleProtocol) Set(val *SecurityGroupRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRuleProtocol(val *SecurityGroupRuleProtocol) *NullableSecurityGroupRuleProtocol { + return &NullableSecurityGroupRuleProtocol{value: val, isSet: true} +} + +func (v NullableSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_server.go b/services/iaas/v1api/model_server.go new file mode 100644 index 000000000..ce22a596c --- /dev/null +++ b/services/iaas/v1api/model_server.go @@ -0,0 +1,998 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Server type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Server{} + +// Server Representation of a single server object. +type Server struct { + // The affinity group the server is assigned to. + AffinityGroup *string `json:"affinityGroup,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Agent *ServerAgent `json:"agent,omitempty"` + // This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + BootVolume *BootVolume `json:"bootVolume,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // An error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The SSH keypair used during the server creation. + KeypairName *string `json:"keypairName,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Date-time when resource was launched. + LaunchedAt *time.Time `json:"launchedAt,omitempty"` + // Name of the machine type the server shall belong to. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + MaintenanceWindow *ServerMaintenance `json:"maintenanceWindow,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name string `json:"name" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` + Networking *ServerNetworking `json:"networking,omitempty"` + // The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested. + Nics []ServerNetwork `json:"nics,omitempty"` + // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. + PowerStatus *string `json:"powerStatus,omitempty"` + // The initial security groups for the server creation. + SecurityGroups []string `json:"securityGroups,omitempty"` + // A list of service account mails. Only shown when detailed information is requested. + ServiceAccountMails []string `json:"serviceAccountMails,omitempty"` + // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. + UserData *string `json:"userData,omitempty"` + // The list of volumes attached to the server. + Volumes []string `json:"volumes,omitempty"` +} + +type _Server Server + +// NewServer instantiates a new Server object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServer(machineType string, name string) *Server { + this := Server{} + this.MachineType = machineType + this.Name = name + return &this +} + +// NewServerWithDefaults instantiates a new Server object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerWithDefaults() *Server { + this := Server{} + return &this +} + +// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +func (o *Server) GetAffinityGroup() string { + if o == nil || IsNil(o.AffinityGroup) { + var ret string + return ret + } + return *o.AffinityGroup +} + +// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAffinityGroupOk() (*string, bool) { + if o == nil || IsNil(o.AffinityGroup) { + return nil, false + } + return o.AffinityGroup, true +} + +// HasAffinityGroup returns a boolean if a field has been set. +func (o *Server) HasAffinityGroup() bool { + if o != nil && !IsNil(o.AffinityGroup) { + return true + } + + return false +} + +// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +func (o *Server) SetAffinityGroup(v string) { + o.AffinityGroup = &v +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *Server) GetAgent() ServerAgent { + if o == nil || IsNil(o.Agent) { + var ret ServerAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAgentOk() (*ServerAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *Server) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ServerAgent and assigns it to the Agent field. +func (o *Server) SetAgent(v ServerAgent) { + o.Agent = &v +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *Server) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *Server) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *Server) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetBootVolume returns the BootVolume field value if set, zero value otherwise. +func (o *Server) GetBootVolume() BootVolume { + if o == nil || IsNil(o.BootVolume) { + var ret BootVolume + return ret + } + return *o.BootVolume +} + +// GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetBootVolumeOk() (*BootVolume, bool) { + if o == nil || IsNil(o.BootVolume) { + return nil, false + } + return o.BootVolume, true +} + +// HasBootVolume returns a boolean if a field has been set. +func (o *Server) HasBootVolume() bool { + if o != nil && !IsNil(o.BootVolume) { + return true + } + + return false +} + +// SetBootVolume gets a reference to the given BootVolume and assigns it to the BootVolume field. +func (o *Server) SetBootVolume(v BootVolume) { + o.BootVolume = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Server) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Server) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Server) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *Server) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *Server) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *Server) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Server) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Server) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Server) SetId(v string) { + o.Id = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *Server) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *Server) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *Server) SetImageId(v string) { + o.ImageId = &v +} + +// GetKeypairName returns the KeypairName field value if set, zero value otherwise. +func (o *Server) GetKeypairName() string { + if o == nil || IsNil(o.KeypairName) { + var ret string + return ret + } + return *o.KeypairName +} + +// GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetKeypairNameOk() (*string, bool) { + if o == nil || IsNil(o.KeypairName) { + return nil, false + } + return o.KeypairName, true +} + +// HasKeypairName returns a boolean if a field has been set. +func (o *Server) HasKeypairName() bool { + if o != nil && !IsNil(o.KeypairName) { + return true + } + + return false +} + +// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. +func (o *Server) SetKeypairName(v string) { + o.KeypairName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Server) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Server) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Server) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. +func (o *Server) GetLaunchedAt() time.Time { + if o == nil || IsNil(o.LaunchedAt) { + var ret time.Time + return ret + } + return *o.LaunchedAt +} + +// GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetLaunchedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LaunchedAt) { + return nil, false + } + return o.LaunchedAt, true +} + +// HasLaunchedAt returns a boolean if a field has been set. +func (o *Server) HasLaunchedAt() bool { + if o != nil && !IsNil(o.LaunchedAt) { + return true + } + + return false +} + +// SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. +func (o *Server) SetLaunchedAt(v time.Time) { + o.LaunchedAt = &v +} + +// GetMachineType returns the MachineType field value +func (o *Server) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *Server) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *Server) SetMachineType(v string) { + o.MachineType = v +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *Server) GetMaintenanceWindow() ServerMaintenance { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret ServerMaintenance + return ret + } + return *o.MaintenanceWindow +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { + if o == nil || IsNil(o.MaintenanceWindow) { + return nil, false + } + return o.MaintenanceWindow, true +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *Server) HasMaintenanceWindow() bool { + if o != nil && !IsNil(o.MaintenanceWindow) { + return true + } + + return false +} + +// SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. +func (o *Server) SetMaintenanceWindow(v ServerMaintenance) { + o.MaintenanceWindow = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *Server) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *Server) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *Server) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value +func (o *Server) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Server) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Server) SetName(v string) { + o.Name = v +} + +// GetNetworking returns the Networking field value if set, zero value otherwise. +func (o *Server) GetNetworking() ServerNetworking { + if o == nil || IsNil(o.Networking) { + var ret ServerNetworking + return ret + } + return *o.Networking +} + +// GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetNetworkingOk() (*ServerNetworking, bool) { + if o == nil || IsNil(o.Networking) { + return nil, false + } + return o.Networking, true +} + +// HasNetworking returns a boolean if a field has been set. +func (o *Server) HasNetworking() bool { + if o != nil && !IsNil(o.Networking) { + return true + } + + return false +} + +// SetNetworking gets a reference to the given ServerNetworking and assigns it to the Networking field. +func (o *Server) SetNetworking(v ServerNetworking) { + o.Networking = &v +} + +// GetNics returns the Nics field value if set, zero value otherwise. +func (o *Server) GetNics() []ServerNetwork { + if o == nil || IsNil(o.Nics) { + var ret []ServerNetwork + return ret + } + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetNicsOk() ([]ServerNetwork, bool) { + if o == nil || IsNil(o.Nics) { + return nil, false + } + return o.Nics, true +} + +// HasNics returns a boolean if a field has been set. +func (o *Server) HasNics() bool { + if o != nil && !IsNil(o.Nics) { + return true + } + + return false +} + +// SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. +func (o *Server) SetNics(v []ServerNetwork) { + o.Nics = v +} + +// GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. +func (o *Server) GetPowerStatus() string { + if o == nil || IsNil(o.PowerStatus) { + var ret string + return ret + } + return *o.PowerStatus +} + +// GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetPowerStatusOk() (*string, bool) { + if o == nil || IsNil(o.PowerStatus) { + return nil, false + } + return o.PowerStatus, true +} + +// HasPowerStatus returns a boolean if a field has been set. +func (o *Server) HasPowerStatus() bool { + if o != nil && !IsNil(o.PowerStatus) { + return true + } + + return false +} + +// SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. +func (o *Server) SetPowerStatus(v string) { + o.PowerStatus = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *Server) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *Server) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *Server) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. +func (o *Server) GetServiceAccountMails() []string { + if o == nil || IsNil(o.ServiceAccountMails) { + var ret []string + return ret + } + return o.ServiceAccountMails +} + +// GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetServiceAccountMailsOk() ([]string, bool) { + if o == nil || IsNil(o.ServiceAccountMails) { + return nil, false + } + return o.ServiceAccountMails, true +} + +// HasServiceAccountMails returns a boolean if a field has been set. +func (o *Server) HasServiceAccountMails() bool { + if o != nil && !IsNil(o.ServiceAccountMails) { + return true + } + + return false +} + +// SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. +func (o *Server) SetServiceAccountMails(v []string) { + o.ServiceAccountMails = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Server) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Server) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Server) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Server) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Server) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Server) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *Server) GetUserData() string { + if o == nil || IsNil(o.UserData) { + var ret string + return ret + } + return *o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetUserDataOk() (*string, bool) { + if o == nil || IsNil(o.UserData) { + return nil, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *Server) HasUserData() bool { + if o != nil && !IsNil(o.UserData) { + return true + } + + return false +} + +// SetUserData gets a reference to the given string and assigns it to the UserData field. +func (o *Server) SetUserData(v string) { + o.UserData = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *Server) GetVolumes() []string { + if o == nil || IsNil(o.Volumes) { + var ret []string + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetVolumesOk() ([]string, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *Server) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +func (o *Server) SetVolumes(v []string) { + o.Volumes = v +} + +func (o Server) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Server) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AffinityGroup) { + toSerialize["affinityGroup"] = o.AffinityGroup + } + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.BootVolume) { + toSerialize["bootVolume"] = o.BootVolume + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.KeypairName) { + toSerialize["keypairName"] = o.KeypairName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.LaunchedAt) { + toSerialize["launchedAt"] = o.LaunchedAt + } + toSerialize["machineType"] = o.MachineType + if !IsNil(o.MaintenanceWindow) { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + toSerialize["name"] = o.Name + if !IsNil(o.Networking) { + toSerialize["networking"] = o.Networking + } + if !IsNil(o.Nics) { + toSerialize["nics"] = o.Nics + } + if !IsNil(o.PowerStatus) { + toSerialize["powerStatus"] = o.PowerStatus + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.ServiceAccountMails) { + toSerialize["serviceAccountMails"] = o.ServiceAccountMails + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.UserData) { + toSerialize["userData"] = o.UserData + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + return toSerialize, nil +} + +func (o *Server) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServer := _Server{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServer) + + if err != nil { + return err + } + + *o = Server(varServer) + + return err +} + +type NullableServer struct { + value *Server + isSet bool +} + +func (v NullableServer) Get() *Server { + return v.value +} + +func (v *NullableServer) Set(val *Server) { + v.value = val + v.isSet = true +} + +func (v NullableServer) IsSet() bool { + return v.isSet +} + +func (v *NullableServer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServer(val *Server) *NullableServer { + return &NullableServer{value: val, isSet: true} +} + +func (v NullableServer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_server_agent.go b/services/iaas/v1api/model_server_agent.go new file mode 100644 index 000000000..013dcb639 --- /dev/null +++ b/services/iaas/v1api/model_server_agent.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ServerAgent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerAgent{} + +// ServerAgent STACKIT server agent options for a server. +type ServerAgent struct { + // Configure the STACKIT server agent provisioning during the first boot of the server. Only works when booting from an images that supports the STACKIT server agent. When `false` the agent IS NOT installed. When `true` the agent IS installed. When its not set the result depend on the used image and its default provisioning setting. + Provisioned *bool `json:"provisioned,omitempty"` +} + +// NewServerAgent instantiates a new ServerAgent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerAgent() *ServerAgent { + this := ServerAgent{} + return &this +} + +// NewServerAgentWithDefaults instantiates a new ServerAgent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerAgentWithDefaults() *ServerAgent { + this := ServerAgent{} + return &this +} + +// GetProvisioned returns the Provisioned field value if set, zero value otherwise. +func (o *ServerAgent) GetProvisioned() bool { + if o == nil || IsNil(o.Provisioned) { + var ret bool + return ret + } + return *o.Provisioned +} + +// GetProvisionedOk returns a tuple with the Provisioned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerAgent) GetProvisionedOk() (*bool, bool) { + if o == nil || IsNil(o.Provisioned) { + return nil, false + } + return o.Provisioned, true +} + +// HasProvisioned returns a boolean if a field has been set. +func (o *ServerAgent) HasProvisioned() bool { + if o != nil && !IsNil(o.Provisioned) { + return true + } + + return false +} + +// SetProvisioned gets a reference to the given bool and assigns it to the Provisioned field. +func (o *ServerAgent) SetProvisioned(v bool) { + o.Provisioned = &v +} + +func (o ServerAgent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerAgent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Provisioned) { + toSerialize["provisioned"] = o.Provisioned + } + return toSerialize, nil +} + +type NullableServerAgent struct { + value *ServerAgent + isSet bool +} + +func (v NullableServerAgent) Get() *ServerAgent { + return v.value +} + +func (v *NullableServerAgent) Set(val *ServerAgent) { + v.value = val + v.isSet = true +} + +func (v NullableServerAgent) IsSet() bool { + return v.isSet +} + +func (v *NullableServerAgent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerAgent(val *ServerAgent) *NullableServerAgent { + return &NullableServerAgent{value: val, isSet: true} +} + +func (v NullableServerAgent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerAgent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_server_console_url.go b/services/iaas/v1api/model_server_console_url.go new file mode 100644 index 000000000..ff80b806f --- /dev/null +++ b/services/iaas/v1api/model_server_console_url.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerConsoleUrl type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerConsoleUrl{} + +// ServerConsoleUrl Object that represents a server console URL. +type ServerConsoleUrl struct { + Url string `json:"url"` +} + +type _ServerConsoleUrl ServerConsoleUrl + +// NewServerConsoleUrl instantiates a new ServerConsoleUrl object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerConsoleUrl(url string) *ServerConsoleUrl { + this := ServerConsoleUrl{} + this.Url = url + return &this +} + +// NewServerConsoleUrlWithDefaults instantiates a new ServerConsoleUrl object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerConsoleUrlWithDefaults() *ServerConsoleUrl { + this := ServerConsoleUrl{} + return &this +} + +// GetUrl returns the Url field value +func (o *ServerConsoleUrl) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ServerConsoleUrl) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ServerConsoleUrl) SetUrl(v string) { + o.Url = v +} + +func (o ServerConsoleUrl) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerConsoleUrl) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *ServerConsoleUrl) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerConsoleUrl := _ServerConsoleUrl{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerConsoleUrl) + + if err != nil { + return err + } + + *o = ServerConsoleUrl(varServerConsoleUrl) + + return err +} + +type NullableServerConsoleUrl struct { + value *ServerConsoleUrl + isSet bool +} + +func (v NullableServerConsoleUrl) Get() *ServerConsoleUrl { + return v.value +} + +func (v *NullableServerConsoleUrl) Set(val *ServerConsoleUrl) { + v.value = val + v.isSet = true +} + +func (v NullableServerConsoleUrl) IsSet() bool { + return v.isSet +} + +func (v *NullableServerConsoleUrl) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerConsoleUrl(val *ServerConsoleUrl) *NullableServerConsoleUrl { + return &NullableServerConsoleUrl{value: val, isSet: true} +} + +func (v NullableServerConsoleUrl) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerConsoleUrl) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_server_list_response.go b/services/iaas/v1api/model_server_list_response.go new file mode 100644 index 000000000..093e403f0 --- /dev/null +++ b/services/iaas/v1api/model_server_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerListResponse{} + +// ServerListResponse Response object for server list request. +type ServerListResponse struct { + // A list of servers. + Items []Server `json:"items"` +} + +type _ServerListResponse ServerListResponse + +// NewServerListResponse instantiates a new ServerListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerListResponse(items []Server) *ServerListResponse { + this := ServerListResponse{} + this.Items = items + return &this +} + +// NewServerListResponseWithDefaults instantiates a new ServerListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerListResponseWithDefaults() *ServerListResponse { + this := ServerListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ServerListResponse) GetItems() []Server { + if o == nil { + var ret []Server + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ServerListResponse) GetItemsOk() ([]Server, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ServerListResponse) SetItems(v []Server) { + o.Items = v +} + +func (o ServerListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ServerListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerListResponse := _ServerListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerListResponse) + + if err != nil { + return err + } + + *o = ServerListResponse(varServerListResponse) + + return err +} + +type NullableServerListResponse struct { + value *ServerListResponse + isSet bool +} + +func (v NullableServerListResponse) Get() *ServerListResponse { + return v.value +} + +func (v *NullableServerListResponse) Set(val *ServerListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableServerListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableServerListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerListResponse(val *ServerListResponse) *NullableServerListResponse { + return &NullableServerListResponse{value: val, isSet: true} +} + +func (v NullableServerListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_server_maintenance.go b/services/iaas/v1api/model_server_maintenance.go new file mode 100644 index 000000000..5460272a9 --- /dev/null +++ b/services/iaas/v1api/model_server_maintenance.go @@ -0,0 +1,253 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the ServerMaintenance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerMaintenance{} + +// ServerMaintenance Object that represents the information about the next planned server maintenance window. +type ServerMaintenance struct { + Details *string `json:"details,omitempty"` + // End of the maintenance window. + EndsAt time.Time `json:"endsAt"` + // Start of the maintenance window. + StartsAt time.Time `json:"startsAt"` + // Possible values: `PLANNED`, `ONGOING`. + Status string `json:"status"` +} + +type _ServerMaintenance ServerMaintenance + +// NewServerMaintenance instantiates a new ServerMaintenance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerMaintenance(endsAt time.Time, startsAt time.Time, status string) *ServerMaintenance { + this := ServerMaintenance{} + this.EndsAt = endsAt + this.StartsAt = startsAt + this.Status = status + return &this +} + +// NewServerMaintenanceWithDefaults instantiates a new ServerMaintenance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerMaintenanceWithDefaults() *ServerMaintenance { + this := ServerMaintenance{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *ServerMaintenance) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *ServerMaintenance) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *ServerMaintenance) SetDetails(v string) { + o.Details = &v +} + +// GetEndsAt returns the EndsAt field value +func (o *ServerMaintenance) GetEndsAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.EndsAt +} + +// GetEndsAtOk returns a tuple with the EndsAt field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetEndsAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EndsAt, true +} + +// SetEndsAt sets field value +func (o *ServerMaintenance) SetEndsAt(v time.Time) { + o.EndsAt = v +} + +// GetStartsAt returns the StartsAt field value +func (o *ServerMaintenance) GetStartsAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartsAt +} + +// GetStartsAtOk returns a tuple with the StartsAt field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetStartsAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartsAt, true +} + +// SetStartsAt sets field value +func (o *ServerMaintenance) SetStartsAt(v time.Time) { + o.StartsAt = v +} + +// GetStatus returns the Status field value +func (o *ServerMaintenance) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ServerMaintenance) SetStatus(v string) { + o.Status = v +} + +func (o ServerMaintenance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerMaintenance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["endsAt"] = o.EndsAt + toSerialize["startsAt"] = o.StartsAt + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *ServerMaintenance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "endsAt", + "startsAt", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerMaintenance := _ServerMaintenance{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerMaintenance) + + if err != nil { + return err + } + + *o = ServerMaintenance(varServerMaintenance) + + return err +} + +type NullableServerMaintenance struct { + value *ServerMaintenance + isSet bool +} + +func (v NullableServerMaintenance) Get() *ServerMaintenance { + return v.value +} + +func (v *NullableServerMaintenance) Set(val *ServerMaintenance) { + v.value = val + v.isSet = true +} + +func (v NullableServerMaintenance) IsSet() bool { + return v.isSet +} + +func (v *NullableServerMaintenance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerMaintenance(val *ServerMaintenance) *NullableServerMaintenance { + return &NullableServerMaintenance{value: val, isSet: true} +} + +func (v NullableServerMaintenance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerMaintenance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_server_network.go b/services/iaas/v1api/model_server_network.go new file mode 100644 index 000000000..0ac0cb9e9 --- /dev/null +++ b/services/iaas/v1api/model_server_network.go @@ -0,0 +1,459 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerNetwork{} + +// ServerNetwork Describes the object that matches servers to its networks. +type ServerNetwork struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // Object that represents an MAC address. + Mac string `json:"mac" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // Universally Unique Identifier (UUID). + NetworkId string `json:"networkId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The name for a General Object. Matches Names and also UUIDs. + NetworkName string `json:"networkName" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NicId string `json:"nicId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this server network interface. + NicSecurity bool `json:"nicSecurity"` + // Object that represents an IP address. + PublicIp *string `json:"publicIp,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` +} + +type _ServerNetwork ServerNetwork + +// NewServerNetwork instantiates a new ServerNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerNetwork(mac string, networkId string, networkName string, nicId string, nicSecurity bool) *ServerNetwork { + this := ServerNetwork{} + this.Mac = mac + this.NetworkId = networkId + this.NetworkName = networkName + this.NicId = nicId + this.NicSecurity = nicSecurity + return &this +} + +// NewServerNetworkWithDefaults instantiates a new ServerNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerNetworkWithDefaults() *ServerNetwork { + this := ServerNetwork{} + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *ServerNetwork) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *ServerNetwork) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *ServerNetwork) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *ServerNetwork) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *ServerNetwork) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *ServerNetwork) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *ServerNetwork) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *ServerNetwork) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *ServerNetwork) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetMac returns the Mac field value +func (o *ServerNetwork) GetMac() string { + if o == nil { + var ret string + return ret + } + + return o.Mac +} + +// GetMacOk returns a tuple with the Mac field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetMacOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Mac, true +} + +// SetMac sets field value +func (o *ServerNetwork) SetMac(v string) { + o.Mac = v +} + +// GetNetworkId returns the NetworkId field value +func (o *ServerNetwork) GetNetworkId() string { + if o == nil { + var ret string + return ret + } + + return o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNetworkIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NetworkId, true +} + +// SetNetworkId sets field value +func (o *ServerNetwork) SetNetworkId(v string) { + o.NetworkId = v +} + +// GetNetworkName returns the NetworkName field value +func (o *ServerNetwork) GetNetworkName() string { + if o == nil { + var ret string + return ret + } + + return o.NetworkName +} + +// GetNetworkNameOk returns a tuple with the NetworkName field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNetworkNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NetworkName, true +} + +// SetNetworkName sets field value +func (o *ServerNetwork) SetNetworkName(v string) { + o.NetworkName = v +} + +// GetNicId returns the NicId field value +func (o *ServerNetwork) GetNicId() string { + if o == nil { + var ret string + return ret + } + + return o.NicId +} + +// GetNicIdOk returns a tuple with the NicId field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNicIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NicId, true +} + +// SetNicId sets field value +func (o *ServerNetwork) SetNicId(v string) { + o.NicId = v +} + +// GetNicSecurity returns the NicSecurity field value +func (o *ServerNetwork) GetNicSecurity() bool { + if o == nil { + var ret bool + return ret + } + + return o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNicSecurityOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.NicSecurity, true +} + +// SetNicSecurity sets field value +func (o *ServerNetwork) SetNicSecurity(v bool) { + o.NicSecurity = v +} + +// GetPublicIp returns the PublicIp field value if set, zero value otherwise. +func (o *ServerNetwork) GetPublicIp() string { + if o == nil || IsNil(o.PublicIp) { + var ret string + return ret + } + return *o.PublicIp +} + +// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetPublicIpOk() (*string, bool) { + if o == nil || IsNil(o.PublicIp) { + return nil, false + } + return o.PublicIp, true +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *ServerNetwork) HasPublicIp() bool { + if o != nil && !IsNil(o.PublicIp) { + return true + } + + return false +} + +// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +func (o *ServerNetwork) SetPublicIp(v string) { + o.PublicIp = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *ServerNetwork) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *ServerNetwork) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *ServerNetwork) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +func (o ServerNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + toSerialize["mac"] = o.Mac + toSerialize["networkId"] = o.NetworkId + toSerialize["networkName"] = o.NetworkName + toSerialize["nicId"] = o.NicId + toSerialize["nicSecurity"] = o.NicSecurity + if !IsNil(o.PublicIp) { + toSerialize["publicIp"] = o.PublicIp + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + return toSerialize, nil +} + +func (o *ServerNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "mac", + "networkId", + "networkName", + "nicId", + "nicSecurity", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerNetwork := _ServerNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerNetwork) + + if err != nil { + return err + } + + *o = ServerNetwork(varServerNetwork) + + return err +} + +type NullableServerNetwork struct { + value *ServerNetwork + isSet bool +} + +func (v NullableServerNetwork) Get() *ServerNetwork { + return v.value +} + +func (v *NullableServerNetwork) Set(val *ServerNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableServerNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableServerNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerNetwork(val *ServerNetwork) *NullableServerNetwork { + return &NullableServerNetwork{value: val, isSet: true} +} + +func (v NullableServerNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_server_networking.go b/services/iaas/v1api/model_server_networking.go new file mode 100644 index 000000000..fdc5392b8 --- /dev/null +++ b/services/iaas/v1api/model_server_networking.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// ServerNetworking - The initial networking setup for the server creation. A network, a nic or nothing can be given. +type ServerNetworking struct { + CreateServerNetworking *CreateServerNetworking + CreateServerNetworkingWithNics *CreateServerNetworkingWithNics +} + +// CreateServerNetworkingAsServerNetworking is a convenience function that returns CreateServerNetworking wrapped in ServerNetworking +func CreateServerNetworkingAsServerNetworking(v *CreateServerNetworking) ServerNetworking { + return ServerNetworking{ + CreateServerNetworking: v, + } +} + +// CreateServerNetworkingWithNicsAsServerNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in ServerNetworking +func CreateServerNetworkingWithNicsAsServerNetworking(v *CreateServerNetworkingWithNics) ServerNetworking { + return ServerNetworking{ + CreateServerNetworkingWithNics: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ServerNetworking) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateServerNetworking + err = json.Unmarshal(data, &dst.CreateServerNetworking) + if err == nil { + jsonCreateServerNetworking, _ := json.Marshal(dst.CreateServerNetworking) + if string(jsonCreateServerNetworking) == "{}" { // empty struct + dst.CreateServerNetworking = nil + } else { + match++ + } + } else { + dst.CreateServerNetworking = nil + } + + // try to unmarshal data into CreateServerNetworkingWithNics + err = json.Unmarshal(data, &dst.CreateServerNetworkingWithNics) + if err == nil { + jsonCreateServerNetworkingWithNics, _ := json.Marshal(dst.CreateServerNetworkingWithNics) + if string(jsonCreateServerNetworkingWithNics) == "{}" { // empty struct + dst.CreateServerNetworkingWithNics = nil + } else { + match++ + } + } else { + dst.CreateServerNetworkingWithNics = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateServerNetworking = nil + dst.CreateServerNetworkingWithNics = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ServerNetworking)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ServerNetworking)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ServerNetworking) MarshalJSON() ([]byte, error) { + if src.CreateServerNetworking != nil { + return json.Marshal(&src.CreateServerNetworking) + } + + if src.CreateServerNetworkingWithNics != nil { + return json.Marshal(&src.CreateServerNetworkingWithNics) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ServerNetworking) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateServerNetworking != nil { + return obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ServerNetworking) GetActualInstanceValue() interface{} { + if obj.CreateServerNetworking != nil { + return *obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return *obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +type NullableServerNetworking struct { + value *ServerNetworking + isSet bool +} + +func (v NullableServerNetworking) Get() *ServerNetworking { + return v.value +} + +func (v *NullableServerNetworking) Set(val *ServerNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableServerNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableServerNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerNetworking(val *ServerNetworking) *NullableServerNetworking { + return &NullableServerNetworking{value: val, isSet: true} +} + +func (v NullableServerNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_service_account_mail_list_response.go b/services/iaas/v1api/model_service_account_mail_list_response.go new file mode 100644 index 000000000..a8acb581a --- /dev/null +++ b/services/iaas/v1api/model_service_account_mail_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServiceAccountMailListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceAccountMailListResponse{} + +// ServiceAccountMailListResponse Service account mail list response. +type ServiceAccountMailListResponse struct { + // A list of service account mails. + Items []string `json:"items"` +} + +type _ServiceAccountMailListResponse ServiceAccountMailListResponse + +// NewServiceAccountMailListResponse instantiates a new ServiceAccountMailListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceAccountMailListResponse(items []string) *ServiceAccountMailListResponse { + this := ServiceAccountMailListResponse{} + this.Items = items + return &this +} + +// NewServiceAccountMailListResponseWithDefaults instantiates a new ServiceAccountMailListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceAccountMailListResponseWithDefaults() *ServiceAccountMailListResponse { + this := ServiceAccountMailListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ServiceAccountMailListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ServiceAccountMailListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ServiceAccountMailListResponse) SetItems(v []string) { + o.Items = v +} + +func (o ServiceAccountMailListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceAccountMailListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ServiceAccountMailListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceAccountMailListResponse := _ServiceAccountMailListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServiceAccountMailListResponse) + + if err != nil { + return err + } + + *o = ServiceAccountMailListResponse(varServiceAccountMailListResponse) + + return err +} + +type NullableServiceAccountMailListResponse struct { + value *ServiceAccountMailListResponse + isSet bool +} + +func (v NullableServiceAccountMailListResponse) Get() *ServiceAccountMailListResponse { + return v.value +} + +func (v *NullableServiceAccountMailListResponse) Set(val *ServiceAccountMailListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableServiceAccountMailListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceAccountMailListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceAccountMailListResponse(val *ServiceAccountMailListResponse) *NullableServiceAccountMailListResponse { + return &NullableServiceAccountMailListResponse{value: val, isSet: true} +} + +func (v NullableServiceAccountMailListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceAccountMailListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_set_image_share_payload.go b/services/iaas/v1api/model_set_image_share_payload.go new file mode 100644 index 000000000..39696f876 --- /dev/null +++ b/services/iaas/v1api/model_set_image_share_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the SetImageSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetImageSharePayload{} + +// SetImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type SetImageSharePayload struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewSetImageSharePayload instantiates a new SetImageSharePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetImageSharePayload() *SetImageSharePayload { + this := SetImageSharePayload{} + return &this +} + +// NewSetImageSharePayloadWithDefaults instantiates a new SetImageSharePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetImageSharePayloadWithDefaults() *SetImageSharePayload { + this := SetImageSharePayload{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *SetImageSharePayload) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetImageSharePayload) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *SetImageSharePayload) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *SetImageSharePayload) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *SetImageSharePayload) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetImageSharePayload) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *SetImageSharePayload) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *SetImageSharePayload) SetProjects(v []string) { + o.Projects = v +} + +func (o SetImageSharePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetImageSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableSetImageSharePayload struct { + value *SetImageSharePayload + isSet bool +} + +func (v NullableSetImageSharePayload) Get() *SetImageSharePayload { + return v.value +} + +func (v *NullableSetImageSharePayload) Set(val *SetImageSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableSetImageSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableSetImageSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetImageSharePayload(val *SetImageSharePayload) *NullableSetImageSharePayload { + return &NullableSetImageSharePayload{value: val, isSet: true} +} + +func (v NullableSetImageSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetImageSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_snapshot.go b/services/iaas/v1api/model_snapshot.go new file mode 100644 index 000000000..342231207 --- /dev/null +++ b/services/iaas/v1api/model_snapshot.go @@ -0,0 +1,418 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Snapshot type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Snapshot{} + +// Snapshot Object that represents a snapshot. +type Snapshot struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId string `json:"volumeId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _Snapshot Snapshot + +// NewSnapshot instantiates a new Snapshot object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshot(volumeId string) *Snapshot { + this := Snapshot{} + this.VolumeId = volumeId + return &this +} + +// NewSnapshotWithDefaults instantiates a new Snapshot object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotWithDefaults() *Snapshot { + this := Snapshot{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Snapshot) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Snapshot) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Snapshot) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Snapshot) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Snapshot) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Snapshot) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Snapshot) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Snapshot) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Snapshot) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Snapshot) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Snapshot) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Snapshot) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Snapshot) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Snapshot) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Snapshot) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Snapshot) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Snapshot) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Snapshot) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Snapshot) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Snapshot) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Snapshot) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value +func (o *Snapshot) GetVolumeId() string { + if o == nil { + var ret string + return ret + } + + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value +// and a boolean to check if the value has been set. +func (o *Snapshot) GetVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VolumeId, true +} + +// SetVolumeId sets field value +func (o *Snapshot) SetVolumeId(v string) { + o.VolumeId = v +} + +func (o Snapshot) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Snapshot) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + toSerialize["volumeId"] = o.VolumeId + return toSerialize, nil +} + +func (o *Snapshot) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "volumeId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSnapshot := _Snapshot{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSnapshot) + + if err != nil { + return err + } + + *o = Snapshot(varSnapshot) + + return err +} + +type NullableSnapshot struct { + value *Snapshot + isSet bool +} + +func (v NullableSnapshot) Get() *Snapshot { + return v.value +} + +func (v *NullableSnapshot) Set(val *Snapshot) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshot) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshot(val *Snapshot) *NullableSnapshot { + return &NullableSnapshot{value: val, isSet: true} +} + +func (v NullableSnapshot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_snapshot_list_response.go b/services/iaas/v1api/model_snapshot_list_response.go new file mode 100644 index 000000000..c93acc2bc --- /dev/null +++ b/services/iaas/v1api/model_snapshot_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SnapshotListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotListResponse{} + +// SnapshotListResponse Snapshot list response. +type SnapshotListResponse struct { + // A list containing snapshot objects. + Items []Snapshot `json:"items"` +} + +type _SnapshotListResponse SnapshotListResponse + +// NewSnapshotListResponse instantiates a new SnapshotListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotListResponse(items []Snapshot) *SnapshotListResponse { + this := SnapshotListResponse{} + this.Items = items + return &this +} + +// NewSnapshotListResponseWithDefaults instantiates a new SnapshotListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotListResponseWithDefaults() *SnapshotListResponse { + this := SnapshotListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SnapshotListResponse) GetItems() []Snapshot { + if o == nil { + var ret []Snapshot + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SnapshotListResponse) GetItemsOk() ([]Snapshot, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SnapshotListResponse) SetItems(v []Snapshot) { + o.Items = v +} + +func (o SnapshotListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SnapshotListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SnapshotListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSnapshotListResponse := _SnapshotListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSnapshotListResponse) + + if err != nil { + return err + } + + *o = SnapshotListResponse(varSnapshotListResponse) + + return err +} + +type NullableSnapshotListResponse struct { + value *SnapshotListResponse + isSet bool +} + +func (v NullableSnapshotListResponse) Get() *SnapshotListResponse { + return v.value +} + +func (v *NullableSnapshotListResponse) Set(val *SnapshotListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotListResponse(val *SnapshotListResponse) *NullableSnapshotListResponse { + return &NullableSnapshotListResponse{value: val, isSet: true} +} + +func (v NullableSnapshotListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_static_area_id.go b/services/iaas/v1api/model_static_area_id.go new file mode 100644 index 000000000..7ed769723 --- /dev/null +++ b/services/iaas/v1api/model_static_area_id.go @@ -0,0 +1,111 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "fmt" +) + +// StaticAreaID The identifier (ID) of a static area. +type StaticAreaID string + +// List of StaticAreaID +const ( + STATICAREAID_PUBLIC StaticAreaID = "PUBLIC" + STATICAREAID_SCHWARZ StaticAreaID = "SCHWARZ" +) + +// All allowed values of StaticAreaID enum +var AllowedStaticAreaIDEnumValues = []StaticAreaID{ + "PUBLIC", + "SCHWARZ", +} + +func (v *StaticAreaID) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StaticAreaID(value) + for _, existing := range AllowedStaticAreaIDEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid StaticAreaID", value) +} + +// NewStaticAreaIDFromValue returns a pointer to a valid StaticAreaID +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStaticAreaIDFromValue(v string) (*StaticAreaID, error) { + ev := StaticAreaID(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StaticAreaID: valid values are %v", v, AllowedStaticAreaIDEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StaticAreaID) IsValid() bool { + for _, existing := range AllowedStaticAreaIDEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StaticAreaID value +func (v StaticAreaID) Ptr() *StaticAreaID { + return &v +} + +type NullableStaticAreaID struct { + value *StaticAreaID + isSet bool +} + +func (v NullableStaticAreaID) Get() *StaticAreaID { + return v.value +} + +func (v *NullableStaticAreaID) Set(val *StaticAreaID) { + v.value = val + v.isSet = true +} + +func (v NullableStaticAreaID) IsSet() bool { + return v.isSet +} + +func (v *NullableStaticAreaID) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStaticAreaID(val *StaticAreaID) *NullableStaticAreaID { + return &NullableStaticAreaID{value: val, isSet: true} +} + +func (v NullableStaticAreaID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStaticAreaID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_area_address_family.go b/services/iaas/v1api/model_update_area_address_family.go new file mode 100644 index 000000000..04c92c906 --- /dev/null +++ b/services/iaas/v1api/model_update_area_address_family.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateAreaAddressFamily type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateAreaAddressFamily{} + +// UpdateAreaAddressFamily The addressFamily object for a area update request. +type UpdateAreaAddressFamily struct { + Ipv4 *UpdateAreaIPv4 `json:"ipv4,omitempty"` +} + +// NewUpdateAreaAddressFamily instantiates a new UpdateAreaAddressFamily object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateAreaAddressFamily() *UpdateAreaAddressFamily { + this := UpdateAreaAddressFamily{} + return &this +} + +// NewUpdateAreaAddressFamilyWithDefaults instantiates a new UpdateAreaAddressFamily object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateAreaAddressFamilyWithDefaults() *UpdateAreaAddressFamily { + this := UpdateAreaAddressFamily{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *UpdateAreaAddressFamily) GetIpv4() UpdateAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret UpdateAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAreaAddressFamily) GetIpv4Ok() (*UpdateAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *UpdateAreaAddressFamily) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given UpdateAreaIPv4 and assigns it to the Ipv4 field. +func (o *UpdateAreaAddressFamily) SetIpv4(v UpdateAreaIPv4) { + o.Ipv4 = &v +} + +func (o UpdateAreaAddressFamily) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateAreaAddressFamily) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableUpdateAreaAddressFamily struct { + value *UpdateAreaAddressFamily + isSet bool +} + +func (v NullableUpdateAreaAddressFamily) Get() *UpdateAreaAddressFamily { + return v.value +} + +func (v *NullableUpdateAreaAddressFamily) Set(val *UpdateAreaAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateAreaAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateAreaAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateAreaAddressFamily(val *UpdateAreaAddressFamily) *NullableUpdateAreaAddressFamily { + return &NullableUpdateAreaAddressFamily{value: val, isSet: true} +} + +func (v NullableUpdateAreaAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateAreaAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_area_ipv4.go b/services/iaas/v1api/model_update_area_ipv4.go new file mode 100644 index 000000000..690c671e2 --- /dev/null +++ b/services/iaas/v1api/model_update_area_ipv4.go @@ -0,0 +1,236 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateAreaIPv4{} + +// UpdateAreaIPv4 The update object for a IPv4 network area. +type UpdateAreaIPv4 struct { + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // The default prefix length for networks in the network area. + DefaultPrefixLen *int32 `json:"defaultPrefixLen,omitempty"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen *int32 `json:"maxPrefixLen,omitempty"` + // The minimal prefix length for networks in the network area. + MinPrefixLen *int32 `json:"minPrefixLen,omitempty"` +} + +// NewUpdateAreaIPv4 instantiates a new UpdateAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateAreaIPv4() *UpdateAreaIPv4 { + this := UpdateAreaIPv4{} + return &this +} + +// NewUpdateAreaIPv4WithDefaults instantiates a new UpdateAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateAreaIPv4WithDefaults() *UpdateAreaIPv4 { + this := UpdateAreaIPv4{} + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *UpdateAreaIPv4) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAreaIPv4) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *UpdateAreaIPv4) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *UpdateAreaIPv4) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. +func (o *UpdateAreaIPv4) GetDefaultPrefixLen() int32 { + if o == nil || IsNil(o.DefaultPrefixLen) { + var ret int32 + return ret + } + return *o.DefaultPrefixLen +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAreaIPv4) GetDefaultPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.DefaultPrefixLen) { + return nil, false + } + return o.DefaultPrefixLen, true +} + +// HasDefaultPrefixLen returns a boolean if a field has been set. +func (o *UpdateAreaIPv4) HasDefaultPrefixLen() bool { + if o != nil && !IsNil(o.DefaultPrefixLen) { + return true + } + + return false +} + +// SetDefaultPrefixLen gets a reference to the given int32 and assigns it to the DefaultPrefixLen field. +func (o *UpdateAreaIPv4) SetDefaultPrefixLen(v int32) { + o.DefaultPrefixLen = &v +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. +func (o *UpdateAreaIPv4) GetMaxPrefixLen() int32 { + if o == nil || IsNil(o.MaxPrefixLen) { + var ret int32 + return ret + } + return *o.MaxPrefixLen +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAreaIPv4) GetMaxPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.MaxPrefixLen) { + return nil, false + } + return o.MaxPrefixLen, true +} + +// HasMaxPrefixLen returns a boolean if a field has been set. +func (o *UpdateAreaIPv4) HasMaxPrefixLen() bool { + if o != nil && !IsNil(o.MaxPrefixLen) { + return true + } + + return false +} + +// SetMaxPrefixLen gets a reference to the given int32 and assigns it to the MaxPrefixLen field. +func (o *UpdateAreaIPv4) SetMaxPrefixLen(v int32) { + o.MaxPrefixLen = &v +} + +// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. +func (o *UpdateAreaIPv4) GetMinPrefixLen() int32 { + if o == nil || IsNil(o.MinPrefixLen) { + var ret int32 + return ret + } + return *o.MinPrefixLen +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAreaIPv4) GetMinPrefixLenOk() (*int32, bool) { + if o == nil || IsNil(o.MinPrefixLen) { + return nil, false + } + return o.MinPrefixLen, true +} + +// HasMinPrefixLen returns a boolean if a field has been set. +func (o *UpdateAreaIPv4) HasMinPrefixLen() bool { + if o != nil && !IsNil(o.MinPrefixLen) { + return true + } + + return false +} + +// SetMinPrefixLen gets a reference to the given int32 and assigns it to the MinPrefixLen field. +func (o *UpdateAreaIPv4) SetMinPrefixLen(v int32) { + o.MinPrefixLen = &v +} + +func (o UpdateAreaIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + if !IsNil(o.DefaultPrefixLen) { + toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + } + if !IsNil(o.MaxPrefixLen) { + toSerialize["maxPrefixLen"] = o.MaxPrefixLen + } + if !IsNil(o.MinPrefixLen) { + toSerialize["minPrefixLen"] = o.MinPrefixLen + } + return toSerialize, nil +} + +type NullableUpdateAreaIPv4 struct { + value *UpdateAreaIPv4 + isSet bool +} + +func (v NullableUpdateAreaIPv4) Get() *UpdateAreaIPv4 { + return v.value +} + +func (v *NullableUpdateAreaIPv4) Set(val *UpdateAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateAreaIPv4(val *UpdateAreaIPv4) *NullableUpdateAreaIPv4 { + return &NullableUpdateAreaIPv4{value: val, isSet: true} +} + +func (v NullableUpdateAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_attached_volume_payload.go b/services/iaas/v1api/model_update_attached_volume_payload.go new file mode 100644 index 000000000..2ff8094cd --- /dev/null +++ b/services/iaas/v1api/model_update_attached_volume_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateAttachedVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateAttachedVolumePayload{} + +// UpdateAttachedVolumePayload Object that represents a Volume attachment to a server. +type UpdateAttachedVolumePayload struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewUpdateAttachedVolumePayload instantiates a new UpdateAttachedVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateAttachedVolumePayload() *UpdateAttachedVolumePayload { + this := UpdateAttachedVolumePayload{} + return &this +} + +// NewUpdateAttachedVolumePayloadWithDefaults instantiates a new UpdateAttachedVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateAttachedVolumePayloadWithDefaults() *UpdateAttachedVolumePayload { + this := UpdateAttachedVolumePayload{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *UpdateAttachedVolumePayload) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *UpdateAttachedVolumePayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *UpdateAttachedVolumePayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o UpdateAttachedVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateAttachedVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableUpdateAttachedVolumePayload struct { + value *UpdateAttachedVolumePayload + isSet bool +} + +func (v NullableUpdateAttachedVolumePayload) Get() *UpdateAttachedVolumePayload { + return v.value +} + +func (v *NullableUpdateAttachedVolumePayload) Set(val *UpdateAttachedVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateAttachedVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateAttachedVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateAttachedVolumePayload(val *UpdateAttachedVolumePayload) *NullableUpdateAttachedVolumePayload { + return &NullableUpdateAttachedVolumePayload{value: val, isSet: true} +} + +func (v NullableUpdateAttachedVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateAttachedVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_backup_payload.go b/services/iaas/v1api/model_update_backup_payload.go new file mode 100644 index 000000000..7a38a2872 --- /dev/null +++ b/services/iaas/v1api/model_update_backup_payload.go @@ -0,0 +1,497 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "time" +) + +// checks if the UpdateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupPayload{} + +// UpdateBackupPayload Object that represents a backup. +type UpdateBackupPayload struct { + // Object that represents an availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // Universally Unique Identifier (UUID). + SnapshotId *string `json:"snapshotId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewUpdateBackupPayload instantiates a new UpdateBackupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupPayload() *UpdateBackupPayload { + this := UpdateBackupPayload{} + return &this +} + +// NewUpdateBackupPayloadWithDefaults instantiates a new UpdateBackupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupPayloadWithDefaults() *UpdateBackupPayload { + this := UpdateBackupPayload{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *UpdateBackupPayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *UpdateBackupPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *UpdateBackupPayload) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdateBackupPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateBackupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateBackupPayload) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *UpdateBackupPayload) SetSize(v int64) { + o.Size = &v +} + +// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetSnapshotId() string { + if o == nil || IsNil(o.SnapshotId) { + var ret string + return ret + } + return *o.SnapshotId +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetSnapshotIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotId) { + return nil, false + } + return o.SnapshotId, true +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasSnapshotId() bool { + if o != nil && !IsNil(o.SnapshotId) { + return true + } + + return false +} + +// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +func (o *UpdateBackupPayload) SetSnapshotId(v string) { + o.SnapshotId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *UpdateBackupPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *UpdateBackupPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *UpdateBackupPayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o UpdateBackupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SnapshotId) { + toSerialize["snapshotId"] = o.SnapshotId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableUpdateBackupPayload struct { + value *UpdateBackupPayload + isSet bool +} + +func (v NullableUpdateBackupPayload) Get() *UpdateBackupPayload { + return v.value +} + +func (v *NullableUpdateBackupPayload) Set(val *UpdateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupPayload(val *UpdateBackupPayload) *NullableUpdateBackupPayload { + return &NullableUpdateBackupPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_image_payload.go b/services/iaas/v1api/model_update_image_payload.go new file mode 100644 index 000000000..0c7e79aa7 --- /dev/null +++ b/services/iaas/v1api/model_update_image_payload.go @@ -0,0 +1,383 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateImagePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateImagePayload{} + +// UpdateImagePayload Object that represents an update request body of an Image. +type UpdateImagePayload struct { + Agent *ImageAgent `json:"agent,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat *string `json:"diskFormat,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` +} + +// NewUpdateImagePayload instantiates a new UpdateImagePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateImagePayload() *UpdateImagePayload { + this := UpdateImagePayload{} + return &this +} + +// NewUpdateImagePayloadWithDefaults instantiates a new UpdateImagePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateImagePayloadWithDefaults() *UpdateImagePayload { + this := UpdateImagePayload{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *UpdateImagePayload) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *UpdateImagePayload) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetDiskFormat returns the DiskFormat field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetDiskFormat() string { + if o == nil || IsNil(o.DiskFormat) { + var ret string + return ret + } + return *o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetDiskFormatOk() (*string, bool) { + if o == nil || IsNil(o.DiskFormat) { + return nil, false + } + return o.DiskFormat, true +} + +// HasDiskFormat returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasDiskFormat() bool { + if o != nil && !IsNil(o.DiskFormat) { + return true + } + + return false +} + +// SetDiskFormat gets a reference to the given string and assigns it to the DiskFormat field. +func (o *UpdateImagePayload) SetDiskFormat(v string) { + o.DiskFormat = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateImagePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *UpdateImagePayload) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *UpdateImagePayload) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateImagePayload) SetName(v string) { + o.Name = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *UpdateImagePayload) SetProtected(v bool) { + o.Protected = &v +} + +func (o UpdateImagePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateImagePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.DiskFormat) { + toSerialize["diskFormat"] = o.DiskFormat + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + return toSerialize, nil +} + +type NullableUpdateImagePayload struct { + value *UpdateImagePayload + isSet bool +} + +func (v NullableUpdateImagePayload) Get() *UpdateImagePayload { + return v.value +} + +func (v *NullableUpdateImagePayload) Set(val *UpdateImagePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateImagePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateImagePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateImagePayload(val *UpdateImagePayload) *NullableUpdateImagePayload { + return &NullableUpdateImagePayload{value: val, isSet: true} +} + +func (v NullableUpdateImagePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateImagePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_image_share_payload.go b/services/iaas/v1api/model_update_image_share_payload.go new file mode 100644 index 000000000..db3274d5d --- /dev/null +++ b/services/iaas/v1api/model_update_image_share_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateImageSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateImageSharePayload{} + +// UpdateImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type UpdateImageSharePayload struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewUpdateImageSharePayload instantiates a new UpdateImageSharePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateImageSharePayload() *UpdateImageSharePayload { + this := UpdateImageSharePayload{} + return &this +} + +// NewUpdateImageSharePayloadWithDefaults instantiates a new UpdateImageSharePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateImageSharePayloadWithDefaults() *UpdateImageSharePayload { + this := UpdateImageSharePayload{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *UpdateImageSharePayload) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImageSharePayload) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *UpdateImageSharePayload) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *UpdateImageSharePayload) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *UpdateImageSharePayload) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImageSharePayload) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *UpdateImageSharePayload) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *UpdateImageSharePayload) SetProjects(v []string) { + o.Projects = v +} + +func (o UpdateImageSharePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateImageSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableUpdateImageSharePayload struct { + value *UpdateImageSharePayload + isSet bool +} + +func (v NullableUpdateImageSharePayload) Get() *UpdateImageSharePayload { + return v.value +} + +func (v *NullableUpdateImageSharePayload) Set(val *UpdateImageSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateImageSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateImageSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateImageSharePayload(val *UpdateImageSharePayload) *NullableUpdateImageSharePayload { + return &NullableUpdateImageSharePayload{value: val, isSet: true} +} + +func (v NullableUpdateImageSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateImageSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_key_pair_payload.go b/services/iaas/v1api/model_update_key_pair_payload.go new file mode 100644 index 000000000..87f71b67d --- /dev/null +++ b/services/iaas/v1api/model_update_key_pair_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateKeyPairPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateKeyPairPayload{} + +// UpdateKeyPairPayload Object that represents an update request body of a public key of an SSH keypair. +type UpdateKeyPairPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewUpdateKeyPairPayload instantiates a new UpdateKeyPairPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateKeyPairPayload() *UpdateKeyPairPayload { + this := UpdateKeyPairPayload{} + return &this +} + +// NewUpdateKeyPairPayloadWithDefaults instantiates a new UpdateKeyPairPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateKeyPairPayloadWithDefaults() *UpdateKeyPairPayload { + this := UpdateKeyPairPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateKeyPairPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateKeyPairPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateKeyPairPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateKeyPairPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o UpdateKeyPairPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateKeyPairPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableUpdateKeyPairPayload struct { + value *UpdateKeyPairPayload + isSet bool +} + +func (v NullableUpdateKeyPairPayload) Get() *UpdateKeyPairPayload { + return v.value +} + +func (v *NullableUpdateKeyPairPayload) Set(val *UpdateKeyPairPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateKeyPairPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateKeyPairPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateKeyPairPayload(val *UpdateKeyPairPayload) *NullableUpdateKeyPairPayload { + return &NullableUpdateKeyPairPayload{value: val, isSet: true} +} + +func (v NullableUpdateKeyPairPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateKeyPairPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_network_address_family.go b/services/iaas/v1api/model_update_network_address_family.go new file mode 100644 index 000000000..64469f95f --- /dev/null +++ b/services/iaas/v1api/model_update_network_address_family.go @@ -0,0 +1,161 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkAddressFamily type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkAddressFamily{} + +// UpdateNetworkAddressFamily The addressFamily object for a network update request. +type UpdateNetworkAddressFamily struct { + Ipv4 *UpdateNetworkIPv4Body `json:"ipv4,omitempty"` + Ipv6 *UpdateNetworkIPv6Body `json:"ipv6,omitempty"` +} + +// NewUpdateNetworkAddressFamily instantiates a new UpdateNetworkAddressFamily object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkAddressFamily() *UpdateNetworkAddressFamily { + this := UpdateNetworkAddressFamily{} + return &this +} + +// NewUpdateNetworkAddressFamilyWithDefaults instantiates a new UpdateNetworkAddressFamily object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkAddressFamilyWithDefaults() *UpdateNetworkAddressFamily { + this := UpdateNetworkAddressFamily{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *UpdateNetworkAddressFamily) GetIpv4() UpdateNetworkIPv4Body { + if o == nil || IsNil(o.Ipv4) { + var ret UpdateNetworkIPv4Body + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkAddressFamily) GetIpv4Ok() (*UpdateNetworkIPv4Body, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *UpdateNetworkAddressFamily) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. +func (o *UpdateNetworkAddressFamily) SetIpv4(v UpdateNetworkIPv4Body) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *UpdateNetworkAddressFamily) GetIpv6() UpdateNetworkIPv6Body { + if o == nil || IsNil(o.Ipv6) { + var ret UpdateNetworkIPv6Body + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkAddressFamily) GetIpv6Ok() (*UpdateNetworkIPv6Body, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *UpdateNetworkAddressFamily) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. +func (o *UpdateNetworkAddressFamily) SetIpv6(v UpdateNetworkIPv6Body) { + o.Ipv6 = &v +} + +func (o UpdateNetworkAddressFamily) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkAddressFamily) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + return toSerialize, nil +} + +type NullableUpdateNetworkAddressFamily struct { + value *UpdateNetworkAddressFamily + isSet bool +} + +func (v NullableUpdateNetworkAddressFamily) Get() *UpdateNetworkAddressFamily { + return v.value +} + +func (v *NullableUpdateNetworkAddressFamily) Set(val *UpdateNetworkAddressFamily) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkAddressFamily) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkAddressFamily) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkAddressFamily(val *UpdateNetworkAddressFamily) *NullableUpdateNetworkAddressFamily { + return &NullableUpdateNetworkAddressFamily{value: val, isSet: true} +} + +func (v NullableUpdateNetworkAddressFamily) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkAddressFamily) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_network_area_route_payload.go b/services/iaas/v1api/model_update_network_area_route_payload.go new file mode 100644 index 000000000..58330608e --- /dev/null +++ b/services/iaas/v1api/model_update_network_area_route_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkAreaRoutePayload{} + +// UpdateNetworkAreaRoutePayload Object that represents the request body for a route update. +type UpdateNetworkAreaRoutePayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewUpdateNetworkAreaRoutePayload instantiates a new UpdateNetworkAreaRoutePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkAreaRoutePayload() *UpdateNetworkAreaRoutePayload { + this := UpdateNetworkAreaRoutePayload{} + return &this +} + +// NewUpdateNetworkAreaRoutePayloadWithDefaults instantiates a new UpdateNetworkAreaRoutePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkAreaRoutePayloadWithDefaults() *UpdateNetworkAreaRoutePayload { + this := UpdateNetworkAreaRoutePayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateNetworkAreaRoutePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkAreaRoutePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateNetworkAreaRoutePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateNetworkAreaRoutePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o UpdateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableUpdateNetworkAreaRoutePayload struct { + value *UpdateNetworkAreaRoutePayload + isSet bool +} + +func (v NullableUpdateNetworkAreaRoutePayload) Get() *UpdateNetworkAreaRoutePayload { + return v.value +} + +func (v *NullableUpdateNetworkAreaRoutePayload) Set(val *UpdateNetworkAreaRoutePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkAreaRoutePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkAreaRoutePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkAreaRoutePayload(val *UpdateNetworkAreaRoutePayload) *NullableUpdateNetworkAreaRoutePayload { + return &NullableUpdateNetworkAreaRoutePayload{value: val, isSet: true} +} + +func (v NullableUpdateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_network_ipv4_body.go b/services/iaas/v1api/model_update_network_ipv4_body.go new file mode 100644 index 000000000..39e999394 --- /dev/null +++ b/services/iaas/v1api/model_update_network_ipv4_body.go @@ -0,0 +1,174 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkIPv4Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv4Body{} + +// UpdateNetworkIPv4Body The config object for a IPv4 network update. +type UpdateNetworkIPv4Body struct { + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv4Body instantiates a new UpdateNetworkIPv4Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// NewUpdateNetworkIPv4BodyWithDefaults instantiates a new UpdateNetworkIPv4Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv4Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv4Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *UpdateNetworkIPv4Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *UpdateNetworkIPv4Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *UpdateNetworkIPv4Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv4Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv4Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv4Body) SetNameservers(v []string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv4Body struct { + value *UpdateNetworkIPv4Body + isSet bool +} + +func (v NullableUpdateNetworkIPv4Body) Get() *UpdateNetworkIPv4Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv4Body) Set(val *UpdateNetworkIPv4Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv4Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv4Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv4Body(val *UpdateNetworkIPv4Body) *NullableUpdateNetworkIPv4Body { + return &NullableUpdateNetworkIPv4Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv4Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_network_ipv6_body.go b/services/iaas/v1api/model_update_network_ipv6_body.go new file mode 100644 index 000000000..c7b91fc19 --- /dev/null +++ b/services/iaas/v1api/model_update_network_ipv6_body.go @@ -0,0 +1,174 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkIPv6Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv6Body{} + +// UpdateNetworkIPv6Body The config object for a IPv6 network update. +type UpdateNetworkIPv6Body struct { + // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv6Body instantiates a new UpdateNetworkIPv6Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkIPv6Body() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// NewUpdateNetworkIPv6BodyWithDefaults instantiates a new UpdateNetworkIPv6Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkIPv6BodyWithDefaults() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv6Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv6Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *UpdateNetworkIPv6Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *UpdateNetworkIPv6Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *UpdateNetworkIPv6Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv6Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv6Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv6Body) SetNameservers(v []string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv6Body struct { + value *UpdateNetworkIPv6Body + isSet bool +} + +func (v NullableUpdateNetworkIPv6Body) Get() *UpdateNetworkIPv6Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv6Body) Set(val *UpdateNetworkIPv6Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv6Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv6Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv6Body(val *UpdateNetworkIPv6Body) *NullableUpdateNetworkIPv6Body { + return &NullableUpdateNetworkIPv6Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv6Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_nic_payload.go b/services/iaas/v1api/model_update_nic_payload.go new file mode 100644 index 000000000..037d973d4 --- /dev/null +++ b/services/iaas/v1api/model_update_nic_payload.go @@ -0,0 +1,311 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateNicPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNicPayload{} + +// UpdateNicPayload Object that represents a network interface update. +type UpdateNicPayload struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` +} + +// NewUpdateNicPayload instantiates a new UpdateNicPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNicPayload() *UpdateNicPayload { + this := UpdateNicPayload{} + return &this +} + +// NewUpdateNicPayloadWithDefaults instantiates a new UpdateNicPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNicPayloadWithDefaults() *UpdateNicPayload { + this := UpdateNicPayload{} + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *UpdateNicPayload) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateNicPayload) SetDescription(v string) { + o.Description = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateNicPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateNicPayload) SetName(v string) { + o.Name = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *UpdateNicPayload) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *UpdateNicPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +func (o UpdateNicPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNicPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + return toSerialize, nil +} + +type NullableUpdateNicPayload struct { + value *UpdateNicPayload + isSet bool +} + +func (v NullableUpdateNicPayload) Get() *UpdateNicPayload { + return v.value +} + +func (v *NullableUpdateNicPayload) Set(val *UpdateNicPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNicPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNicPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNicPayload(val *UpdateNicPayload) *NullableUpdateNicPayload { + return &NullableUpdateNicPayload{value: val, isSet: true} +} + +func (v NullableUpdateNicPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNicPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_public_ip_payload.go b/services/iaas/v1api/model_update_public_ip_payload.go new file mode 100644 index 000000000..39fed47ac --- /dev/null +++ b/services/iaas/v1api/model_update_public_ip_payload.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdatePublicIPPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdatePublicIPPayload{} + +// UpdatePublicIPPayload Object that represents a public IP. +type UpdatePublicIPPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ip *string `json:"ip,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewUpdatePublicIPPayload instantiates a new UpdatePublicIPPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdatePublicIPPayload() *UpdatePublicIPPayload { + this := UpdatePublicIPPayload{} + return &this +} + +// NewUpdatePublicIPPayloadWithDefaults instantiates a new UpdatePublicIPPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdatePublicIPPayloadWithDefaults() *UpdatePublicIPPayload { + this := UpdatePublicIPPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdatePublicIPPayload) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *UpdatePublicIPPayload) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdatePublicIPPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdatePublicIPPayload) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *UpdatePublicIPPayload) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *UpdatePublicIPPayload) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *UpdatePublicIPPayload) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o UpdatePublicIPPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdatePublicIPPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullableUpdatePublicIPPayload struct { + value *UpdatePublicIPPayload + isSet bool +} + +func (v NullableUpdatePublicIPPayload) Get() *UpdatePublicIPPayload { + return v.value +} + +func (v *NullableUpdatePublicIPPayload) Set(val *UpdatePublicIPPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdatePublicIPPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdatePublicIPPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdatePublicIPPayload(val *UpdatePublicIPPayload) *NullableUpdatePublicIPPayload { + return &NullableUpdatePublicIPPayload{value: val, isSet: true} +} + +func (v NullableUpdatePublicIPPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdatePublicIPPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_security_group_payload.go b/services/iaas/v1api/model_update_security_group_payload.go new file mode 100644 index 000000000..cc1ed0aa6 --- /dev/null +++ b/services/iaas/v1api/model_update_security_group_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateSecurityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateSecurityGroupPayload{} + +// UpdateSecurityGroupPayload Object that represents an update request body of a security group. +type UpdateSecurityGroupPayload struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewUpdateSecurityGroupPayload instantiates a new UpdateSecurityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateSecurityGroupPayload() *UpdateSecurityGroupPayload { + this := UpdateSecurityGroupPayload{} + return &this +} + +// NewUpdateSecurityGroupPayloadWithDefaults instantiates a new UpdateSecurityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateSecurityGroupPayloadWithDefaults() *UpdateSecurityGroupPayload { + this := UpdateSecurityGroupPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateSecurityGroupPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateSecurityGroupPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateSecurityGroupPayload) SetDescription(v string) { + o.Description = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateSecurityGroupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSecurityGroupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateSecurityGroupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateSecurityGroupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateSecurityGroupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSecurityGroupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateSecurityGroupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateSecurityGroupPayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateSecurityGroupPayload struct { + value *UpdateSecurityGroupPayload + isSet bool +} + +func (v NullableUpdateSecurityGroupPayload) Get() *UpdateSecurityGroupPayload { + return v.value +} + +func (v *NullableUpdateSecurityGroupPayload) Set(val *UpdateSecurityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSecurityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSecurityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSecurityGroupPayload(val *UpdateSecurityGroupPayload) *NullableUpdateSecurityGroupPayload { + return &NullableUpdateSecurityGroupPayload{value: val, isSet: true} +} + +func (v NullableUpdateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSecurityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_server_payload.go b/services/iaas/v1api/model_update_server_payload.go new file mode 100644 index 000000000..11da51a93 --- /dev/null +++ b/services/iaas/v1api/model_update_server_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateServerPayload{} + +// UpdateServerPayload Object that represents an update request body of a server. +type UpdateServerPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name *string `json:"name,omitempty" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` +} + +// NewUpdateServerPayload instantiates a new UpdateServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateServerPayload() *UpdateServerPayload { + this := UpdateServerPayload{} + return &this +} + +// NewUpdateServerPayloadWithDefaults instantiates a new UpdateServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateServerPayloadWithDefaults() *UpdateServerPayload { + this := UpdateServerPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateServerPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *UpdateServerPayload) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateServerPayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateServerPayload struct { + value *UpdateServerPayload + isSet bool +} + +func (v NullableUpdateServerPayload) Get() *UpdateServerPayload { + return v.value +} + +func (v *NullableUpdateServerPayload) Set(val *UpdateServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateServerPayload(val *UpdateServerPayload) *NullableUpdateServerPayload { + return &NullableUpdateServerPayload{value: val, isSet: true} +} + +func (v NullableUpdateServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_snapshot_payload.go b/services/iaas/v1api/model_update_snapshot_payload.go new file mode 100644 index 000000000..cb2aa6d9e --- /dev/null +++ b/services/iaas/v1api/model_update_snapshot_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateSnapshotPayload{} + +// UpdateSnapshotPayload Object that represents an update request body of a snapshot. +type UpdateSnapshotPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewUpdateSnapshotPayload instantiates a new UpdateSnapshotPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateSnapshotPayload() *UpdateSnapshotPayload { + this := UpdateSnapshotPayload{} + return &this +} + +// NewUpdateSnapshotPayloadWithDefaults instantiates a new UpdateSnapshotPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateSnapshotPayloadWithDefaults() *UpdateSnapshotPayload { + this := UpdateSnapshotPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateSnapshotPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSnapshotPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateSnapshotPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateSnapshotPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateSnapshotPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSnapshotPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateSnapshotPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateSnapshotPayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateSnapshotPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateSnapshotPayload struct { + value *UpdateSnapshotPayload + isSet bool +} + +func (v NullableUpdateSnapshotPayload) Get() *UpdateSnapshotPayload { + return v.value +} + +func (v *NullableUpdateSnapshotPayload) Set(val *UpdateSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSnapshotPayload(val *UpdateSnapshotPayload) *NullableUpdateSnapshotPayload { + return &NullableUpdateSnapshotPayload{value: val, isSet: true} +} + +func (v NullableUpdateSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_update_volume_payload.go b/services/iaas/v1api/model_update_volume_payload.go new file mode 100644 index 000000000..74971ca53 --- /dev/null +++ b/services/iaas/v1api/model_update_volume_payload.go @@ -0,0 +1,273 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the UpdateVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateVolumePayload{} + +// UpdateVolumePayload Object that represents an update request body of a volume. +type UpdateVolumePayload struct { + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewUpdateVolumePayload instantiates a new UpdateVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateVolumePayload() *UpdateVolumePayload { + this := UpdateVolumePayload{} + return &this +} + +// NewUpdateVolumePayloadWithDefaults instantiates a new UpdateVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateVolumePayloadWithDefaults() *UpdateVolumePayload { + this := UpdateVolumePayload{} + return &this +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *UpdateVolumePayload) SetBootable(v bool) { + o.Bootable = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateVolumePayload) SetDescription(v string) { + o.Description = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *UpdateVolumePayload) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateVolumePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateVolumePayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateVolumePayload struct { + value *UpdateVolumePayload + isSet bool +} + +func (v NullableUpdateVolumePayload) Get() *UpdateVolumePayload { + return v.value +} + +func (v *NullableUpdateVolumePayload) Set(val *UpdateVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateVolumePayload(val *UpdateVolumePayload) *NullableUpdateVolumePayload { + return &NullableUpdateVolumePayload{value: val, isSet: true} +} + +func (v NullableUpdateVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_volume.go b/services/iaas/v1api/model_volume.go new file mode 100644 index 000000000..4c5777590 --- /dev/null +++ b/services/iaas/v1api/model_volume.go @@ -0,0 +1,711 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Volume type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Volume{} + +// Volume Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. +type Volume struct { + // Object that represents an availability zone. + AvailabilityZone string `json:"availabilityZone"` + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionParameters *VolumeEncryptionParameter `json:"encryptionParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *VolumeSource `json:"source,omitempty"` + // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Volume Volume + +// NewVolume instantiates a new Volume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolume(availabilityZone string) *Volume { + this := Volume{} + this.AvailabilityZone = availabilityZone + return &this +} + +// NewVolumeWithDefaults instantiates a new Volume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeWithDefaults() *Volume { + this := Volume{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value +func (o *Volume) GetAvailabilityZone() string { + if o == nil { + var ret string + return ret + } + + return o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value +// and a boolean to check if the value has been set. +func (o *Volume) GetAvailabilityZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailabilityZone, true +} + +// SetAvailabilityZone sets field value +func (o *Volume) SetAvailabilityZone(v string) { + o.AvailabilityZone = v +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *Volume) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *Volume) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *Volume) SetBootable(v bool) { + o.Bootable = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Volume) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Volume) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Volume) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Volume) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Volume) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Volume) SetDescription(v string) { + o.Description = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *Volume) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *Volume) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *Volume) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetEncryptionParameters returns the EncryptionParameters field value if set, zero value otherwise. +func (o *Volume) GetEncryptionParameters() VolumeEncryptionParameter { + if o == nil || IsNil(o.EncryptionParameters) { + var ret VolumeEncryptionParameter + return ret + } + return *o.EncryptionParameters +} + +// GetEncryptionParametersOk returns a tuple with the EncryptionParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetEncryptionParametersOk() (*VolumeEncryptionParameter, bool) { + if o == nil || IsNil(o.EncryptionParameters) { + return nil, false + } + return o.EncryptionParameters, true +} + +// HasEncryptionParameters returns a boolean if a field has been set. +func (o *Volume) HasEncryptionParameters() bool { + if o != nil && !IsNil(o.EncryptionParameters) { + return true + } + + return false +} + +// SetEncryptionParameters gets a reference to the given VolumeEncryptionParameter and assigns it to the EncryptionParameters field. +func (o *Volume) SetEncryptionParameters(v VolumeEncryptionParameter) { + o.EncryptionParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Volume) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Volume) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Volume) SetId(v string) { + o.Id = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *Volume) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *Volume) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *Volume) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Volume) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Volume) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Volume) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Volume) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Volume) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Volume) SetName(v string) { + o.Name = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *Volume) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *Volume) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *Volume) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *Volume) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *Volume) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *Volume) SetServerId(v string) { + o.ServerId = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Volume) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Volume) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Volume) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *Volume) GetSource() VolumeSource { + if o == nil || IsNil(o.Source) { + var ret VolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetSourceOk() (*VolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *Volume) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given VolumeSource and assigns it to the Source field. +func (o *Volume) SetSource(v VolumeSource) { + o.Source = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Volume) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Volume) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Volume) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Volume) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Volume) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Volume) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Volume) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Volume) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["availabilityZone"] = o.AvailabilityZone + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.EncryptionParameters) { + toSerialize["encryptionParameters"] = o.EncryptionParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Volume) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "availabilityZone", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolume := _Volume{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolume) + + if err != nil { + return err + } + + *o = Volume(varVolume) + + return err +} + +type NullableVolume struct { + value *Volume + isSet bool +} + +func (v NullableVolume) Get() *Volume { + return v.value +} + +func (v *NullableVolume) Set(val *Volume) { + v.value = val + v.isSet = true +} + +func (v NullableVolume) IsSet() bool { + return v.isSet +} + +func (v *NullableVolume) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolume(val *Volume) *NullableVolume { + return &NullableVolume{value: val, isSet: true} +} + +func (v NullableVolume) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolume) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_volume_attachment.go b/services/iaas/v1api/model_volume_attachment.go new file mode 100644 index 000000000..0e62577ce --- /dev/null +++ b/services/iaas/v1api/model_volume_attachment.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the VolumeAttachment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeAttachment{} + +// VolumeAttachment Object that represents a Volume attachment to a server. +type VolumeAttachment struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewVolumeAttachment instantiates a new VolumeAttachment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeAttachment() *VolumeAttachment { + this := VolumeAttachment{} + return &this +} + +// NewVolumeAttachmentWithDefaults instantiates a new VolumeAttachment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeAttachmentWithDefaults() *VolumeAttachment { + this := VolumeAttachment{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *VolumeAttachment) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *VolumeAttachment) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *VolumeAttachment) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *VolumeAttachment) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *VolumeAttachment) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *VolumeAttachment) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *VolumeAttachment) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *VolumeAttachment) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *VolumeAttachment) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o VolumeAttachment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeAttachment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableVolumeAttachment struct { + value *VolumeAttachment + isSet bool +} + +func (v NullableVolumeAttachment) Get() *VolumeAttachment { + return v.value +} + +func (v *NullableVolumeAttachment) Set(val *VolumeAttachment) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeAttachment) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeAttachment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeAttachment(val *VolumeAttachment) *NullableVolumeAttachment { + return &NullableVolumeAttachment{value: val, isSet: true} +} + +func (v NullableVolumeAttachment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeAttachment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_volume_attachment_list_response.go b/services/iaas/v1api/model_volume_attachment_list_response.go new file mode 100644 index 000000000..aa7a7ce8a --- /dev/null +++ b/services/iaas/v1api/model_volume_attachment_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeAttachmentListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeAttachmentListResponse{} + +// VolumeAttachmentListResponse Volume attachment list response. +type VolumeAttachmentListResponse struct { + // A list containing Volume attachments of a server. + Items []VolumeAttachment `json:"items"` +} + +type _VolumeAttachmentListResponse VolumeAttachmentListResponse + +// NewVolumeAttachmentListResponse instantiates a new VolumeAttachmentListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeAttachmentListResponse(items []VolumeAttachment) *VolumeAttachmentListResponse { + this := VolumeAttachmentListResponse{} + this.Items = items + return &this +} + +// NewVolumeAttachmentListResponseWithDefaults instantiates a new VolumeAttachmentListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeAttachmentListResponseWithDefaults() *VolumeAttachmentListResponse { + this := VolumeAttachmentListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumeAttachmentListResponse) GetItems() []VolumeAttachment { + if o == nil { + var ret []VolumeAttachment + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumeAttachmentListResponse) GetItemsOk() ([]VolumeAttachment, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumeAttachmentListResponse) SetItems(v []VolumeAttachment) { + o.Items = v +} + +func (o VolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumeAttachmentListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeAttachmentListResponse := _VolumeAttachmentListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeAttachmentListResponse) + + if err != nil { + return err + } + + *o = VolumeAttachmentListResponse(varVolumeAttachmentListResponse) + + return err +} + +type NullableVolumeAttachmentListResponse struct { + value *VolumeAttachmentListResponse + isSet bool +} + +func (v NullableVolumeAttachmentListResponse) Get() *VolumeAttachmentListResponse { + return v.value +} + +func (v *NullableVolumeAttachmentListResponse) Set(val *VolumeAttachmentListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeAttachmentListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeAttachmentListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeAttachmentListResponse(val *VolumeAttachmentListResponse) *NullableVolumeAttachmentListResponse { + return &NullableVolumeAttachmentListResponse{value: val, isSet: true} +} + +func (v NullableVolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeAttachmentListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_volume_encryption_parameter.go b/services/iaas/v1api/model_volume_encryption_parameter.go new file mode 100644 index 000000000..9845c3a8a --- /dev/null +++ b/services/iaas/v1api/model_volume_encryption_parameter.go @@ -0,0 +1,319 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeEncryptionParameter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeEncryptionParameter{} + +// VolumeEncryptionParameter Parameter to connect to a key-encryption-key within the STACKIT-KMS to create encrypted volumes. If no key_payload is set, a random passphrase is generated, which will be encrypted against the STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the responses. +type VolumeEncryptionParameter struct { + // UUID of the Key within the STACKIT-KMS to use for the encryption. + KekKeyId string `json:"kekKeyId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Version of the key within the STACKIT-KMS to use for the encryption. + KekKeyVersion int64 `json:"kekKeyVersion"` + // UUID of the keyring where the key is located within the STACKTI-KMS. + KekKeyringId string `json:"kekKeyringId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Id of the project, where the key in the STACKIT-KMS belongs to, in case the key is located in a different project. By default the same project ID is used, like for the volume itself. Defining a key in a different project is only allowed for privileged internal projects. + KekProjectId *string `json:"kekProjectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Optional predefined secret, which will be encrypted against the key-encryption-key within the STACKIT-KMS. If not defined, a random secret will be generated by the API and encrypted against the STACKIT-KMS. If a key-payload is provided here, it must be base64 encoded. + KeyPayload *string `json:"keyPayload,omitempty"` + // Service-Account linked to the Key within the STACKIT-KMS. + ServiceAccount string `json:"serviceAccount" validate:"regexp=[a-z0-9-]+(?:\\\\.[a-z0-9]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"` +} + +type _VolumeEncryptionParameter VolumeEncryptionParameter + +// NewVolumeEncryptionParameter instantiates a new VolumeEncryptionParameter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeEncryptionParameter(kekKeyId string, kekKeyVersion int64, kekKeyringId string, serviceAccount string) *VolumeEncryptionParameter { + this := VolumeEncryptionParameter{} + this.KekKeyId = kekKeyId + this.KekKeyVersion = kekKeyVersion + this.KekKeyringId = kekKeyringId + this.ServiceAccount = serviceAccount + return &this +} + +// NewVolumeEncryptionParameterWithDefaults instantiates a new VolumeEncryptionParameter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeEncryptionParameterWithDefaults() *VolumeEncryptionParameter { + this := VolumeEncryptionParameter{} + return &this +} + +// GetKekKeyId returns the KekKeyId field value +func (o *VolumeEncryptionParameter) GetKekKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyId +} + +// GetKekKeyIdOk returns a tuple with the KekKeyId field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyId, true +} + +// SetKekKeyId sets field value +func (o *VolumeEncryptionParameter) SetKekKeyId(v string) { + o.KekKeyId = v +} + +// GetKekKeyVersion returns the KekKeyVersion field value +func (o *VolumeEncryptionParameter) GetKekKeyVersion() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.KekKeyVersion +} + +// GetKekKeyVersionOk returns a tuple with the KekKeyVersion field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyVersionOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyVersion, true +} + +// SetKekKeyVersion sets field value +func (o *VolumeEncryptionParameter) SetKekKeyVersion(v int64) { + o.KekKeyVersion = v +} + +// GetKekKeyringId returns the KekKeyringId field value +func (o *VolumeEncryptionParameter) GetKekKeyringId() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyringId +} + +// GetKekKeyringIdOk returns a tuple with the KekKeyringId field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyringIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyringId, true +} + +// SetKekKeyringId sets field value +func (o *VolumeEncryptionParameter) SetKekKeyringId(v string) { + o.KekKeyringId = v +} + +// GetKekProjectId returns the KekProjectId field value if set, zero value otherwise. +func (o *VolumeEncryptionParameter) GetKekProjectId() string { + if o == nil || IsNil(o.KekProjectId) { + var ret string + return ret + } + return *o.KekProjectId +} + +// GetKekProjectIdOk returns a tuple with the KekProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.KekProjectId) { + return nil, false + } + return o.KekProjectId, true +} + +// HasKekProjectId returns a boolean if a field has been set. +func (o *VolumeEncryptionParameter) HasKekProjectId() bool { + if o != nil && !IsNil(o.KekProjectId) { + return true + } + + return false +} + +// SetKekProjectId gets a reference to the given string and assigns it to the KekProjectId field. +func (o *VolumeEncryptionParameter) SetKekProjectId(v string) { + o.KekProjectId = &v +} + +// GetKeyPayload returns the KeyPayload field value if set, zero value otherwise. +func (o *VolumeEncryptionParameter) GetKeyPayload() string { + if o == nil || IsNil(o.KeyPayload) { + var ret string + return ret + } + return *o.KeyPayload +} + +// GetKeyPayloadOk returns a tuple with the KeyPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKeyPayloadOk() (*string, bool) { + if o == nil || IsNil(o.KeyPayload) { + return nil, false + } + return o.KeyPayload, true +} + +// HasKeyPayload returns a boolean if a field has been set. +func (o *VolumeEncryptionParameter) HasKeyPayload() bool { + if o != nil && !IsNil(o.KeyPayload) { + return true + } + + return false +} + +// SetKeyPayload gets a reference to the given string and assigns it to the KeyPayload field. +func (o *VolumeEncryptionParameter) SetKeyPayload(v string) { + o.KeyPayload = &v +} + +// GetServiceAccount returns the ServiceAccount field value +func (o *VolumeEncryptionParameter) GetServiceAccount() string { + if o == nil { + var ret string + return ret + } + + return o.ServiceAccount +} + +// GetServiceAccountOk returns a tuple with the ServiceAccount field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetServiceAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServiceAccount, true +} + +// SetServiceAccount sets field value +func (o *VolumeEncryptionParameter) SetServiceAccount(v string) { + o.ServiceAccount = v +} + +func (o VolumeEncryptionParameter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeEncryptionParameter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["kekKeyId"] = o.KekKeyId + toSerialize["kekKeyVersion"] = o.KekKeyVersion + toSerialize["kekKeyringId"] = o.KekKeyringId + if !IsNil(o.KekProjectId) { + toSerialize["kekProjectId"] = o.KekProjectId + } + if !IsNil(o.KeyPayload) { + toSerialize["keyPayload"] = o.KeyPayload + } + toSerialize["serviceAccount"] = o.ServiceAccount + return toSerialize, nil +} + +func (o *VolumeEncryptionParameter) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "kekKeyId", + "kekKeyVersion", + "kekKeyringId", + "serviceAccount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeEncryptionParameter := _VolumeEncryptionParameter{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeEncryptionParameter) + + if err != nil { + return err + } + + *o = VolumeEncryptionParameter(varVolumeEncryptionParameter) + + return err +} + +type NullableVolumeEncryptionParameter struct { + value *VolumeEncryptionParameter + isSet bool +} + +func (v NullableVolumeEncryptionParameter) Get() *VolumeEncryptionParameter { + return v.value +} + +func (v *NullableVolumeEncryptionParameter) Set(val *VolumeEncryptionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeEncryptionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeEncryptionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeEncryptionParameter(val *VolumeEncryptionParameter) *NullableVolumeEncryptionParameter { + return &NullableVolumeEncryptionParameter{value: val, isSet: true} +} + +func (v NullableVolumeEncryptionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeEncryptionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_volume_list_response.go b/services/iaas/v1api/model_volume_list_response.go new file mode 100644 index 000000000..93f6bfab6 --- /dev/null +++ b/services/iaas/v1api/model_volume_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeListResponse{} + +// VolumeListResponse Volume list response. +type VolumeListResponse struct { + // A list containing volume objects. + Items []Volume `json:"items"` +} + +type _VolumeListResponse VolumeListResponse + +// NewVolumeListResponse instantiates a new VolumeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeListResponse(items []Volume) *VolumeListResponse { + this := VolumeListResponse{} + this.Items = items + return &this +} + +// NewVolumeListResponseWithDefaults instantiates a new VolumeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeListResponseWithDefaults() *VolumeListResponse { + this := VolumeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumeListResponse) GetItems() []Volume { + if o == nil { + var ret []Volume + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumeListResponse) GetItemsOk() ([]Volume, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumeListResponse) SetItems(v []Volume) { + o.Items = v +} + +func (o VolumeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeListResponse := _VolumeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeListResponse) + + if err != nil { + return err + } + + *o = VolumeListResponse(varVolumeListResponse) + + return err +} + +type NullableVolumeListResponse struct { + value *VolumeListResponse + isSet bool +} + +func (v NullableVolumeListResponse) Get() *VolumeListResponse { + return v.value +} + +func (v *NullableVolumeListResponse) Set(val *VolumeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeListResponse(val *VolumeListResponse) *NullableVolumeListResponse { + return &NullableVolumeListResponse{value: val, isSet: true} +} + +func (v NullableVolumeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_volume_performance_class.go b/services/iaas/v1api/model_volume_performance_class.go new file mode 100644 index 000000000..23a63b1dd --- /dev/null +++ b/services/iaas/v1api/model_volume_performance_class.go @@ -0,0 +1,306 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumePerformanceClass type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumePerformanceClass{} + +// VolumePerformanceClass Object that represents a Volume performance class. +type VolumePerformanceClass struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Input/Output Operations per second. + Iops *int64 `json:"iops,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Throughput in Megabyte per second. + Throughput *int64 `json:"throughput,omitempty"` +} + +type _VolumePerformanceClass VolumePerformanceClass + +// NewVolumePerformanceClass instantiates a new VolumePerformanceClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumePerformanceClass(name string) *VolumePerformanceClass { + this := VolumePerformanceClass{} + this.Name = name + return &this +} + +// NewVolumePerformanceClassWithDefaults instantiates a new VolumePerformanceClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumePerformanceClassWithDefaults() *VolumePerformanceClass { + this := VolumePerformanceClass{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VolumePerformanceClass) SetDescription(v string) { + o.Description = &v +} + +// GetIops returns the Iops field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetIops() int64 { + if o == nil || IsNil(o.Iops) { + var ret int64 + return ret + } + return *o.Iops +} + +// GetIopsOk returns a tuple with the Iops field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetIopsOk() (*int64, bool) { + if o == nil || IsNil(o.Iops) { + return nil, false + } + return o.Iops, true +} + +// HasIops returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasIops() bool { + if o != nil && !IsNil(o.Iops) { + return true + } + + return false +} + +// SetIops gets a reference to the given int64 and assigns it to the Iops field. +func (o *VolumePerformanceClass) SetIops(v int64) { + o.Iops = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *VolumePerformanceClass) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *VolumePerformanceClass) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VolumePerformanceClass) SetName(v string) { + o.Name = v +} + +// GetThroughput returns the Throughput field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetThroughput() int64 { + if o == nil || IsNil(o.Throughput) { + var ret int64 + return ret + } + return *o.Throughput +} + +// GetThroughputOk returns a tuple with the Throughput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetThroughputOk() (*int64, bool) { + if o == nil || IsNil(o.Throughput) { + return nil, false + } + return o.Throughput, true +} + +// HasThroughput returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasThroughput() bool { + if o != nil && !IsNil(o.Throughput) { + return true + } + + return false +} + +// SetThroughput gets a reference to the given int64 and assigns it to the Throughput field. +func (o *VolumePerformanceClass) SetThroughput(v int64) { + o.Throughput = &v +} + +func (o VolumePerformanceClass) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumePerformanceClass) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Iops) { + toSerialize["iops"] = o.Iops + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Throughput) { + toSerialize["throughput"] = o.Throughput + } + return toSerialize, nil +} + +func (o *VolumePerformanceClass) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumePerformanceClass := _VolumePerformanceClass{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumePerformanceClass) + + if err != nil { + return err + } + + *o = VolumePerformanceClass(varVolumePerformanceClass) + + return err +} + +type NullableVolumePerformanceClass struct { + value *VolumePerformanceClass + isSet bool +} + +func (v NullableVolumePerformanceClass) Get() *VolumePerformanceClass { + return v.value +} + +func (v *NullableVolumePerformanceClass) Set(val *VolumePerformanceClass) { + v.value = val + v.isSet = true +} + +func (v NullableVolumePerformanceClass) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumePerformanceClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumePerformanceClass(val *VolumePerformanceClass) *NullableVolumePerformanceClass { + return &NullableVolumePerformanceClass{value: val, isSet: true} +} + +func (v NullableVolumePerformanceClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumePerformanceClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_volume_performance_class_list_response.go b/services/iaas/v1api/model_volume_performance_class_list_response.go new file mode 100644 index 000000000..a715de0ac --- /dev/null +++ b/services/iaas/v1api/model_volume_performance_class_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumePerformanceClassListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumePerformanceClassListResponse{} + +// VolumePerformanceClassListResponse Volume performance class list response. +type VolumePerformanceClassListResponse struct { + // A list containing Volume performance classes. + Items []VolumePerformanceClass `json:"items"` +} + +type _VolumePerformanceClassListResponse VolumePerformanceClassListResponse + +// NewVolumePerformanceClassListResponse instantiates a new VolumePerformanceClassListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumePerformanceClassListResponse(items []VolumePerformanceClass) *VolumePerformanceClassListResponse { + this := VolumePerformanceClassListResponse{} + this.Items = items + return &this +} + +// NewVolumePerformanceClassListResponseWithDefaults instantiates a new VolumePerformanceClassListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumePerformanceClassListResponseWithDefaults() *VolumePerformanceClassListResponse { + this := VolumePerformanceClassListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumePerformanceClassListResponse) GetItems() []VolumePerformanceClass { + if o == nil { + var ret []VolumePerformanceClass + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClassListResponse) GetItemsOk() ([]VolumePerformanceClass, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumePerformanceClassListResponse) SetItems(v []VolumePerformanceClass) { + o.Items = v +} + +func (o VolumePerformanceClassListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumePerformanceClassListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumePerformanceClassListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumePerformanceClassListResponse := _VolumePerformanceClassListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumePerformanceClassListResponse) + + if err != nil { + return err + } + + *o = VolumePerformanceClassListResponse(varVolumePerformanceClassListResponse) + + return err +} + +type NullableVolumePerformanceClassListResponse struct { + value *VolumePerformanceClassListResponse + isSet bool +} + +func (v NullableVolumePerformanceClassListResponse) Get() *VolumePerformanceClassListResponse { + return v.value +} + +func (v *NullableVolumePerformanceClassListResponse) Set(val *VolumePerformanceClassListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumePerformanceClassListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumePerformanceClassListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumePerformanceClassListResponse(val *VolumePerformanceClassListResponse) *NullableVolumePerformanceClassListResponse { + return &NullableVolumePerformanceClassListResponse{value: val, isSet: true} +} + +func (v NullableVolumePerformanceClassListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumePerformanceClassListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/model_volume_source.go b/services/iaas/v1api/model_volume_source.go new file mode 100644 index 000000000..f4ab85795 --- /dev/null +++ b/services/iaas/v1api/model_volume_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeSource{} + +// VolumeSource The source object of a volume. +type VolumeSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a volume. Possible values: `image`, `volume`, `snapshot`, `backup`. + Type string `json:"type"` +} + +type _VolumeSource VolumeSource + +// NewVolumeSource instantiates a new VolumeSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeSource(id string, types string) *VolumeSource { + this := VolumeSource{} + this.Id = id + this.Type = types + return &this +} + +// NewVolumeSourceWithDefaults instantiates a new VolumeSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeSourceWithDefaults() *VolumeSource { + this := VolumeSource{} + return &this +} + +// GetId returns the Id field value +func (o *VolumeSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VolumeSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VolumeSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *VolumeSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *VolumeSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *VolumeSource) SetType(v string) { + o.Type = v +} + +func (o VolumeSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *VolumeSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeSource := _VolumeSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeSource) + + if err != nil { + return err + } + + *o = VolumeSource(varVolumeSource) + + return err +} + +type NullableVolumeSource struct { + value *VolumeSource + isSet bool +} + +func (v NullableVolumeSource) Get() *VolumeSource { + return v.value +} + +func (v *NullableVolumeSource) Set(val *VolumeSource) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeSource) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeSource(val *VolumeSource) *NullableVolumeSource { + return &NullableVolumeSource{value: val, isSet: true} +} + +func (v NullableVolumeSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v1api/response.go b/services/iaas/v1api/response.go new file mode 100644 index 000000000..313827f96 --- /dev/null +++ b/services/iaas/v1api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/iaas/v1api/utils.go b/services/iaas/v1api/utils.go new file mode 100644 index 000000000..1314b36dd --- /dev/null +++ b/services/iaas/v1api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT IaaS API + +This API is deprecated. It will be retired on 01.03.2027. Please use the STACKIT IaaS API V2 instead. + +API version: 1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/iaas/v2alpha1api/api_default.go b/services/iaas/v2alpha1api/api_default.go new file mode 100644 index 000000000..ecb082a9e --- /dev/null +++ b/services/iaas/v2alpha1api/api_default.go @@ -0,0 +1,3609 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2alpha1api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + AddRoutesToRoutingTable Create new routes in a routing table. + + Create new routes in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiAddRoutesToRoutingTableRequest + */ + AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest + + // AddRoutesToRoutingTableExecute executes the request + // @return RouteListResponse + AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) + + /* + AddRoutingTableToArea Create new routing table in a network area. + + Create a new routing table in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiAddRoutingTableToAreaRequest + */ + AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest + + // AddRoutingTableToAreaExecute executes the request + // @return RoutingTable + AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) + + /* + CreateNetwork Create new network. + + Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest + */ + CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest + + // CreateNetworkExecute executes the request + // @return Network + CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) + + /* + DeleteNetwork Delete network. + + Delete a network. If the network is still in use, the deletion will fail. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest + */ + DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest + + // DeleteNetworkExecute executes the request + DeleteNetworkExecute(r ApiDeleteNetworkRequest) error + + /* + DeleteRouteFromRoutingTable Delete a route in a routing table. + + Delete a route in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest + */ + DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest + + // DeleteRouteFromRoutingTableExecute executes the request + DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error + + /* + DeleteRoutingTableFromArea Delete a routing table. + + Delete a routing table of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest + */ + DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest + + // DeleteRoutingTableFromAreaExecute executes the request + DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error + + /* + GetNetwork Get network details. + + Get details about a network of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest + */ + GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest + + // GetNetworkExecute executes the request + // @return Network + GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) + + /* + GetRouteOfRoutingTable Get details about a route of a routing table. + + Get details about a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetRouteOfRoutingTableRequest + */ + GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest + + // GetRouteOfRoutingTableExecute executes the request + // @return Route + GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) + + /* + GetRoutingTableOfArea Get details about a routing table. + + Get details about a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiGetRoutingTableOfAreaRequest + */ + GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest + + // GetRoutingTableOfAreaExecute executes the request + // @return RoutingTable + GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) + + /* + ListNetworks List all networks inside a project. + + Get a list of all networks inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest + */ + ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest + + // ListNetworksExecute executes the request + // @return NetworkListResponse + ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) + + /* + ListNetworksOfRoutingTable List all networks in a routing table. + + Get a list of all networks in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListNetworksOfRoutingTableRequest + */ + ListNetworksOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListNetworksOfRoutingTableRequest + + // ListNetworksOfRoutingTableExecute executes the request + // @return NetworkListResponse + ListNetworksOfRoutingTableExecute(r ApiListNetworksOfRoutingTableRequest) (*NetworkListResponse, error) + + /* + ListRoutesOfRoutingTable List all routes in a routing table. + + Get a list of all routes in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest + */ + ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest + + // ListRoutesOfRoutingTableExecute executes the request + // @return RouteListResponse + ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) + + /* + ListRoutingTablesOfArea List all routing tables in a network area. + + Get a list of all routing tables in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest + */ + ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest + + // ListRoutingTablesOfAreaExecute executes the request + // @return RoutingTableListResponse + ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) + + /* + PartialUpdateNetwork Update network settings. + + Update the settings of a network inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest + */ + PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest + + // PartialUpdateNetworkExecute executes the request + PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error + + /* + UpdateRouteOfRoutingTable Update a route of a routing table. + + Update a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest + */ + UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest + + // UpdateRouteOfRoutingTableExecute executes the request + // @return Route + UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) + + /* + UpdateRoutingTableOfArea Update a routing table. + + Update a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest + */ + UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest + + // UpdateRoutingTableOfAreaExecute executes the request + // @return RoutingTable + UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiAddRoutesToRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + addRoutesToRoutingTablePayload *AddRoutesToRoutingTablePayload +} + +// Request an addition of routes to a routing table. +func (r ApiAddRoutesToRoutingTableRequest) AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest { + r.addRoutesToRoutingTablePayload = &addRoutesToRoutingTablePayload + return r +} + +func (r ApiAddRoutesToRoutingTableRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.AddRoutesToRoutingTableExecute(r) +} + +/* +AddRoutesToRoutingTable Create new routes in a routing table. + +Create new routes in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiAddRoutesToRoutingTableRequest +*/ +func (a *DefaultAPIService) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { + return ApiAddRoutesToRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddRoutesToRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if r.addRoutesToRoutingTablePayload == nil { + return localVarReturnValue, reportError("addRoutesToRoutingTablePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addRoutesToRoutingTablePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiAddRoutingTableToAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + addRoutingTableToAreaPayload *AddRoutingTableToAreaPayload +} + +// Request an addition of a routing table to an area. +func (r ApiAddRoutingTableToAreaRequest) AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest { + r.addRoutingTableToAreaPayload = &addRoutingTableToAreaPayload + return r +} + +func (r ApiAddRoutingTableToAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.AddRoutingTableToAreaExecute(r) +} + +/* +AddRoutingTableToArea Create new routing table in a network area. + +Create a new routing table in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiAddRoutingTableToAreaRequest +*/ +func (a *DefaultAPIService) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { + return ApiAddRoutingTableToAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddRoutingTableToArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.addRoutingTableToAreaPayload == nil { + return localVarReturnValue, reportError("addRoutingTableToAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addRoutingTableToAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createNetworkPayload *CreateNetworkPayload +} + +// Request a network creation. +func (r ApiCreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { + r.createNetworkPayload = &createNetworkPayload + return r +} + +func (r ApiCreateNetworkRequest) Execute() (*Network, error) { + return r.ApiService.CreateNetworkExecute(r) +} + +/* +CreateNetwork Create new network. + +Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest +*/ +func (a *DefaultAPIService) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Network +func (a *DefaultAPIService) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createNetworkPayload == nil { + return localVarReturnValue, reportError("createNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string +} + +func (r ApiDeleteNetworkRequest) Execute() error { + return r.ApiService.DeleteNetworkExecute(r) +} + +/* +DeleteNetwork Delete network. + +Delete a network. If the network is still in use, the deletion will fail. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest +*/ +func (a *DefaultAPIService) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteRouteFromRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string +} + +func (r ApiDeleteRouteFromRoutingTableRequest) Execute() error { + return r.ApiService.DeleteRouteFromRoutingTableExecute(r) +} + +/* +DeleteRouteFromRoutingTable Delete a route in a routing table. + +Delete a route in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest +*/ +func (a *DefaultAPIService) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { + return ApiDeleteRouteFromRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRouteFromRoutingTable") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteRoutingTableFromAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string +} + +func (r ApiDeleteRoutingTableFromAreaRequest) Execute() error { + return r.ApiService.DeleteRoutingTableFromAreaExecute(r) +} + +/* +DeleteRoutingTableFromArea Delete a routing table. + +Delete a routing table of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest +*/ +func (a *DefaultAPIService) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { + return ApiDeleteRoutingTableFromAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRoutingTableFromArea") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return reportError("routingTableId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiGetNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string +} + +func (r ApiGetNetworkRequest) Execute() (*Network, error) { + return r.ApiService.GetNetworkExecute(r) +} + +/* +GetNetwork Get network details. + +Get details about a network of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest +*/ +func (a *DefaultAPIService) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return Network +func (a *DefaultAPIService) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetRouteOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string +} + +func (r ApiGetRouteOfRoutingTableRequest) Execute() (*Route, error) { + return r.ApiService.GetRouteOfRoutingTableExecute(r) +} + +/* +GetRouteOfRoutingTable Get details about a route of a routing table. + +Get details about a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetRouteOfRoutingTableRequest +*/ +func (a *DefaultAPIService) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { + return ApiGetRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRouteOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetRoutingTableOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string +} + +func (r ApiGetRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.GetRoutingTableOfAreaExecute(r) +} + +/* +GetRoutingTableOfArea Get details about a routing table. + +Get details about a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiGetRoutingTableOfAreaRequest +*/ +func (a *DefaultAPIService) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { + return ApiGetRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRoutingTableOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworksRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { + return r.ApiService.ListNetworksExecute(r) +} + +/* +ListNetworks List all networks inside a project. + +Get a list of all networks inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest +*/ +func (a *DefaultAPIService) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return NetworkListResponse +func (a *DefaultAPIService) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworks") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworksOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string +} + +func (r ApiListNetworksOfRoutingTableRequest) Execute() (*NetworkListResponse, error) { + return r.ApiService.ListNetworksOfRoutingTableExecute(r) +} + +/* +ListNetworksOfRoutingTable List all networks in a routing table. + +Get a list of all networks in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListNetworksOfRoutingTableRequest +*/ +func (a *DefaultAPIService) ListNetworksOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListNetworksOfRoutingTableRequest { + return ApiListNetworksOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return NetworkListResponse +func (a *DefaultAPIService) ListNetworksOfRoutingTableExecute(r ApiListNetworksOfRoutingTableRequest) (*NetworkListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworksOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRoutesOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListRoutesOfRoutingTableRequest) LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListRoutesOfRoutingTableRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.ListRoutesOfRoutingTableExecute(r) +} + +/* +ListRoutesOfRoutingTable List all routes in a routing table. + +Get a list of all routes in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest +*/ +func (a *DefaultAPIService) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { + return ApiListRoutesOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoutesOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRoutingTablesOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListRoutingTablesOfAreaRequest) LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListRoutingTablesOfAreaRequest) Execute() (*RoutingTableListResponse, error) { + return r.ApiService.ListRoutingTablesOfAreaExecute(r) +} + +/* +ListRoutingTablesOfArea List all routing tables in a network area. + +Get a list of all routing tables in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest +*/ +func (a *DefaultAPIService) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { + return ApiListRoutingTablesOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RoutingTableListResponse +func (a *DefaultAPIService) ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTableListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoutingTablesOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + partialUpdateNetworkPayload *PartialUpdateNetworkPayload +} + +// Request an update of a network. +func (r ApiPartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { + r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload + return r +} + +func (r ApiPartialUpdateNetworkRequest) Execute() error { + return r.ApiService.PartialUpdateNetworkExecute(r) +} + +/* +PartialUpdateNetwork Update network settings. + +Update the settings of a network inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest +*/ +func (a *DefaultAPIService) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + if r.partialUpdateNetworkPayload == nil { + return reportError("partialUpdateNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiUpdateRouteOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string + updateRouteOfRoutingTablePayload *UpdateRouteOfRoutingTablePayload +} + +// Request an update of a route in a routing table. +func (r ApiUpdateRouteOfRoutingTableRequest) UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest { + r.updateRouteOfRoutingTablePayload = &updateRouteOfRoutingTablePayload + return r +} + +func (r ApiUpdateRouteOfRoutingTableRequest) Execute() (*Route, error) { + return r.ApiService.UpdateRouteOfRoutingTableExecute(r) +} + +/* +UpdateRouteOfRoutingTable Update a route of a routing table. + +Update a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest +*/ +func (a *DefaultAPIService) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { + return ApiUpdateRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRouteOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + if r.updateRouteOfRoutingTablePayload == nil { + return localVarReturnValue, reportError("updateRouteOfRoutingTablePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRouteOfRoutingTablePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateRoutingTableOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + updateRoutingTableOfAreaPayload *UpdateRoutingTableOfAreaPayload +} + +// Request an update of a routing table. +func (r ApiUpdateRoutingTableOfAreaRequest) UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest { + r.updateRoutingTableOfAreaPayload = &updateRoutingTableOfAreaPayload + return r +} + +func (r ApiUpdateRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.UpdateRoutingTableOfAreaExecute(r) +} + +/* +UpdateRoutingTableOfArea Update a routing table. + +Update a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest +*/ +func (a *DefaultAPIService) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { + return ApiUpdateRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRoutingTableOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2alpha1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if r.updateRoutingTableOfAreaPayload == nil { + return localVarReturnValue, reportError("updateRoutingTableOfAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRoutingTableOfAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/iaas/v2alpha1api/api_default_mock.go b/services/iaas/v2alpha1api/api_default_mock.go new file mode 100644 index 000000000..42123e615 --- /dev/null +++ b/services/iaas/v2alpha1api/api_default_mock.go @@ -0,0 +1,382 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // AddRoutesToRoutingTableExecuteMock can be populated to implement the behavior of the AddRoutesToRoutingTableExecute function of this mock + AddRoutesToRoutingTableExecuteMock *func(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) + // AddRoutingTableToAreaExecuteMock can be populated to implement the behavior of the AddRoutingTableToAreaExecute function of this mock + AddRoutingTableToAreaExecuteMock *func(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) + // CreateNetworkExecuteMock can be populated to implement the behavior of the CreateNetworkExecute function of this mock + CreateNetworkExecuteMock *func(r ApiCreateNetworkRequest) (*Network, error) + // DeleteNetworkExecuteMock can be populated to implement the behavior of the DeleteNetworkExecute function of this mock + DeleteNetworkExecuteMock *func(r ApiDeleteNetworkRequest) error + // DeleteRouteFromRoutingTableExecuteMock can be populated to implement the behavior of the DeleteRouteFromRoutingTableExecute function of this mock + DeleteRouteFromRoutingTableExecuteMock *func(r ApiDeleteRouteFromRoutingTableRequest) error + // DeleteRoutingTableFromAreaExecuteMock can be populated to implement the behavior of the DeleteRoutingTableFromAreaExecute function of this mock + DeleteRoutingTableFromAreaExecuteMock *func(r ApiDeleteRoutingTableFromAreaRequest) error + // GetNetworkExecuteMock can be populated to implement the behavior of the GetNetworkExecute function of this mock + GetNetworkExecuteMock *func(r ApiGetNetworkRequest) (*Network, error) + // GetRouteOfRoutingTableExecuteMock can be populated to implement the behavior of the GetRouteOfRoutingTableExecute function of this mock + GetRouteOfRoutingTableExecuteMock *func(r ApiGetRouteOfRoutingTableRequest) (*Route, error) + // GetRoutingTableOfAreaExecuteMock can be populated to implement the behavior of the GetRoutingTableOfAreaExecute function of this mock + GetRoutingTableOfAreaExecuteMock *func(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) + // ListNetworksExecuteMock can be populated to implement the behavior of the ListNetworksExecute function of this mock + ListNetworksExecuteMock *func(r ApiListNetworksRequest) (*NetworkListResponse, error) + // ListNetworksOfRoutingTableExecuteMock can be populated to implement the behavior of the ListNetworksOfRoutingTableExecute function of this mock + ListNetworksOfRoutingTableExecuteMock *func(r ApiListNetworksOfRoutingTableRequest) (*NetworkListResponse, error) + // ListRoutesOfRoutingTableExecuteMock can be populated to implement the behavior of the ListRoutesOfRoutingTableExecute function of this mock + ListRoutesOfRoutingTableExecuteMock *func(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) + // ListRoutingTablesOfAreaExecuteMock can be populated to implement the behavior of the ListRoutingTablesOfAreaExecute function of this mock + ListRoutingTablesOfAreaExecuteMock *func(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) + // PartialUpdateNetworkExecuteMock can be populated to implement the behavior of the PartialUpdateNetworkExecute function of this mock + PartialUpdateNetworkExecuteMock *func(r ApiPartialUpdateNetworkRequest) error + // UpdateRouteOfRoutingTableExecuteMock can be populated to implement the behavior of the UpdateRouteOfRoutingTableExecute function of this mock + UpdateRouteOfRoutingTableExecuteMock *func(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) + // UpdateRoutingTableOfAreaExecuteMock can be populated to implement the behavior of the UpdateRoutingTableOfAreaExecute function of this mock + UpdateRoutingTableOfAreaExecuteMock *func(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) +} + +func (a DefaultAPIServiceMock) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { + return ApiAddRoutesToRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// AddRoutesToRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddRoutesToRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) { + if a.AddRoutesToRoutingTableExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.AddRoutesToRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { + return ApiAddRoutingTableToAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// AddRoutingTableToAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddRoutingTableToAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) { + if a.AddRoutingTableToAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.AddRoutingTableToAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { + if a.CreateNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.CreateNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// DeleteNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { + if a.DeleteNetworkExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { + return ApiDeleteRouteFromRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// DeleteRouteFromRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRouteFromRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error { + if a.DeleteRouteFromRoutingTableExecuteMock == nil { + return nil + } + + return (*a.DeleteRouteFromRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { + return ApiDeleteRoutingTableFromAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// DeleteRoutingTableFromAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRoutingTableFromAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error { + if a.DeleteRoutingTableFromAreaExecuteMock == nil { + return nil + } + + return (*a.DeleteRoutingTableFromAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// GetNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { + if a.GetNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.GetNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { + return ApiGetRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// GetRouteOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRouteOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) { + if a.GetRouteOfRoutingTableExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.GetRouteOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { + return ApiGetRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// GetRoutingTableOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRoutingTableOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) { + if a.GetRoutingTableOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.GetRoutingTableOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListNetworksExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworksExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { + if a.ListNetworksExecuteMock == nil { + var localVarReturnValue *NetworkListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworksExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworksOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListNetworksOfRoutingTableRequest { + return ApiListNetworksOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// ListNetworksOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworksOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworksOfRoutingTableExecute(r ApiListNetworksOfRoutingTableRequest) (*NetworkListResponse, error) { + if a.ListNetworksOfRoutingTableExecuteMock == nil { + var localVarReturnValue *NetworkListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworksOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { + return ApiListRoutesOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// ListRoutesOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRoutesOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) { + if a.ListRoutesOfRoutingTableExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.ListRoutesOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { + return ApiListRoutingTablesOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// ListRoutingTablesOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRoutingTablesOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) { + if a.ListRoutingTablesOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTableListResponse + return localVarReturnValue, nil + } + + return (*a.ListRoutingTablesOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// PartialUpdateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { + if a.PartialUpdateNetworkExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { + return ApiUpdateRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// UpdateRouteOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRouteOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) { + if a.UpdateRouteOfRoutingTableExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.UpdateRouteOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { + return ApiUpdateRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// UpdateRoutingTableOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRoutingTableOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) { + if a.UpdateRoutingTableOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.UpdateRoutingTableOfAreaExecuteMock)(r) +} diff --git a/services/iaas/v2alpha1api/client.go b/services/iaas/v2alpha1api/client.go new file mode 100644 index 000000000..2a21d9728 --- /dev/null +++ b/services/iaas/v2alpha1api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2alpha1api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT IaaS API API v2alpha1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/iaas/v2alpha1api/configuration.go b/services/iaas/v2alpha1api/configuration.go new file mode 100644 index 000000000..618fd7938 --- /dev/null +++ b/services/iaas/v2alpha1api/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2alpha1api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/iaas", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://iaas.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/iaas/v2alpha1api/model_add_routes_to_routing_table_payload.go b/services/iaas/v2alpha1api/model_add_routes_to_routing_table_payload.go new file mode 100644 index 000000000..78f2cb0c1 --- /dev/null +++ b/services/iaas/v2alpha1api/model_add_routes_to_routing_table_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AddRoutesToRoutingTablePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRoutesToRoutingTablePayload{} + +// AddRoutesToRoutingTablePayload Object represents a request to add network routes. +type AddRoutesToRoutingTablePayload struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _AddRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload + +// NewAddRoutesToRoutingTablePayload instantiates a new AddRoutesToRoutingTablePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRoutesToRoutingTablePayload(items []Route) *AddRoutesToRoutingTablePayload { + this := AddRoutesToRoutingTablePayload{} + this.Items = items + return &this +} + +// NewAddRoutesToRoutingTablePayloadWithDefaults instantiates a new AddRoutesToRoutingTablePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRoutesToRoutingTablePayloadWithDefaults() *AddRoutesToRoutingTablePayload { + this := AddRoutesToRoutingTablePayload{} + return &this +} + +// GetItems returns the Items field value +func (o *AddRoutesToRoutingTablePayload) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AddRoutesToRoutingTablePayload) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AddRoutesToRoutingTablePayload) SetItems(v []Route) { + o.Items = v +} + +func (o AddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddRoutesToRoutingTablePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AddRoutesToRoutingTablePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddRoutesToRoutingTablePayload := _AddRoutesToRoutingTablePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAddRoutesToRoutingTablePayload) + + if err != nil { + return err + } + + *o = AddRoutesToRoutingTablePayload(varAddRoutesToRoutingTablePayload) + + return err +} + +type NullableAddRoutesToRoutingTablePayload struct { + value *AddRoutesToRoutingTablePayload + isSet bool +} + +func (v NullableAddRoutesToRoutingTablePayload) Get() *AddRoutesToRoutingTablePayload { + return v.value +} + +func (v *NullableAddRoutesToRoutingTablePayload) Set(val *AddRoutesToRoutingTablePayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddRoutesToRoutingTablePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRoutesToRoutingTablePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRoutesToRoutingTablePayload(val *AddRoutesToRoutingTablePayload) *NullableAddRoutesToRoutingTablePayload { + return &NullableAddRoutesToRoutingTablePayload{value: val, isSet: true} +} + +func (v NullableAddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRoutesToRoutingTablePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_add_routing_table_to_area_payload.go b/services/iaas/v2alpha1api/model_add_routing_table_to_area_payload.go new file mode 100644 index 000000000..2d7141260 --- /dev/null +++ b/services/iaas/v2alpha1api/model_add_routing_table_to_area_payload.go @@ -0,0 +1,463 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the AddRoutingTableToAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRoutingTableToAreaPayload{} + +// AddRoutingTableToAreaPayload An object representing a routing table. +type AddRoutingTableToAreaPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. + Default *bool `json:"default,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _AddRoutingTableToAreaPayload AddRoutingTableToAreaPayload + +// NewAddRoutingTableToAreaPayload instantiates a new AddRoutingTableToAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRoutingTableToAreaPayload(name string) *AddRoutingTableToAreaPayload { + this := AddRoutingTableToAreaPayload{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + this.Name = name + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// NewAddRoutingTableToAreaPayloadWithDefaults instantiates a new AddRoutingTableToAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRoutingTableToAreaPayloadWithDefaults() *AddRoutingTableToAreaPayload { + this := AddRoutingTableToAreaPayload{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AddRoutingTableToAreaPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *AddRoutingTableToAreaPayload) SetDefault(v bool) { + o.Default = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AddRoutingTableToAreaPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *AddRoutingTableToAreaPayload) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AddRoutingTableToAreaPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *AddRoutingTableToAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *AddRoutingTableToAreaPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AddRoutingTableToAreaPayload) SetName(v string) { + o.Name = v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *AddRoutingTableToAreaPayload) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AddRoutingTableToAreaPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o AddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddRoutingTableToAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *AddRoutingTableToAreaPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddRoutingTableToAreaPayload := _AddRoutingTableToAreaPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAddRoutingTableToAreaPayload) + + if err != nil { + return err + } + + *o = AddRoutingTableToAreaPayload(varAddRoutingTableToAreaPayload) + + return err +} + +type NullableAddRoutingTableToAreaPayload struct { + value *AddRoutingTableToAreaPayload + isSet bool +} + +func (v NullableAddRoutingTableToAreaPayload) Get() *AddRoutingTableToAreaPayload { + return v.value +} + +func (v *NullableAddRoutingTableToAreaPayload) Set(val *AddRoutingTableToAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddRoutingTableToAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRoutingTableToAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRoutingTableToAreaPayload(val *AddRoutingTableToAreaPayload) *NullableAddRoutingTableToAreaPayload { + return &NullableAddRoutingTableToAreaPayload{value: val, isSet: true} +} + +func (v NullableAddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRoutingTableToAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv4.go b/services/iaas/v2alpha1api/model_create_network_ipv4.go new file mode 100644 index 000000000..b4a856b9c --- /dev/null +++ b/services/iaas/v2alpha1api/model_create_network_ipv4.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" + "fmt" +) + +// CreateNetworkIPv4 - The create request for an IPv4 network. +type CreateNetworkIPv4 struct { + CreateNetworkIPv4WithPrefix *CreateNetworkIPv4WithPrefix + CreateNetworkIPv4WithPrefixLength *CreateNetworkIPv4WithPrefixLength +} + +// CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefix wrapped in CreateNetworkIPv4 +func CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefix) CreateNetworkIPv4 { + return CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefix: v, + } +} + +// CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefixLength wrapped in CreateNetworkIPv4 +func CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefixLength) CreateNetworkIPv4 { + return CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefixLength: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateNetworkIPv4) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateNetworkIPv4WithPrefix + err = json.Unmarshal(data, &dst.CreateNetworkIPv4WithPrefix) + if err == nil { + jsonCreateNetworkIPv4WithPrefix, _ := json.Marshal(dst.CreateNetworkIPv4WithPrefix) + if string(jsonCreateNetworkIPv4WithPrefix) == "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefix = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv4WithPrefix = nil + } + + // try to unmarshal data into CreateNetworkIPv4WithPrefixLength + err = json.Unmarshal(data, &dst.CreateNetworkIPv4WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv4WithPrefixLength, _ := json.Marshal(dst.CreateNetworkIPv4WithPrefixLength) + if string(jsonCreateNetworkIPv4WithPrefixLength) == "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefixLength = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv4WithPrefixLength = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateNetworkIPv4WithPrefix = nil + dst.CreateNetworkIPv4WithPrefixLength = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateNetworkIPv4)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv4)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateNetworkIPv4) MarshalJSON() ([]byte, error) { + if src.CreateNetworkIPv4WithPrefix != nil { + return json.Marshal(&src.CreateNetworkIPv4WithPrefix) + } + + if src.CreateNetworkIPv4WithPrefixLength != nil { + return json.Marshal(&src.CreateNetworkIPv4WithPrefixLength) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateNetworkIPv4) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateNetworkIPv4WithPrefix != nil { + return obj.CreateNetworkIPv4WithPrefix + } + + if obj.CreateNetworkIPv4WithPrefixLength != nil { + return obj.CreateNetworkIPv4WithPrefixLength + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateNetworkIPv4) GetActualInstanceValue() interface{} { + if obj.CreateNetworkIPv4WithPrefix != nil { + return *obj.CreateNetworkIPv4WithPrefix + } + + if obj.CreateNetworkIPv4WithPrefixLength != nil { + return *obj.CreateNetworkIPv4WithPrefixLength + } + + // all schemas are nil + return nil +} + +type NullableCreateNetworkIPv4 struct { + value *CreateNetworkIPv4 + isSet bool +} + +func (v NullableCreateNetworkIPv4) Get() *CreateNetworkIPv4 { + return v.value +} + +func (v *NullableCreateNetworkIPv4) Set(val *CreateNetworkIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4(val *CreateNetworkIPv4) *NullableCreateNetworkIPv4 { + return &NullableCreateNetworkIPv4{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix.go b/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix.go new file mode 100644 index 000000000..80cbfe35c --- /dev/null +++ b/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix.go @@ -0,0 +1,243 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv4WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefix{} + +// CreateNetworkIPv4WithPrefix The create request for an IPv4 network with a specified prefix. +type CreateNetworkIPv4WithPrefix struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + // IPv4 Classless Inter-Domain Routing (CIDR). + Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` +} + +type _CreateNetworkIPv4WithPrefix CreateNetworkIPv4WithPrefix + +// NewCreateNetworkIPv4WithPrefix instantiates a new CreateNetworkIPv4WithPrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4WithPrefix(prefix string) *CreateNetworkIPv4WithPrefix { + this := CreateNetworkIPv4WithPrefix{} + this.Prefix = prefix + return &this +} + +// NewCreateNetworkIPv4WithPrefixWithDefaults instantiates a new CreateNetworkIPv4WithPrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4WithPrefixWithDefaults() *CreateNetworkIPv4WithPrefix { + this := CreateNetworkIPv4WithPrefix{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv4WithPrefix) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv4WithPrefix) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefix) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *CreateNetworkIPv4WithPrefix) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv4WithPrefix) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv4WithPrefix) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4WithPrefix) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefix) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefix) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4WithPrefix) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value +func (o *CreateNetworkIPv4WithPrefix) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefix) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *CreateNetworkIPv4WithPrefix) SetPrefix(v string) { + o.Prefix = v +} + +func (o CreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv4WithPrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefix"] = o.Prefix + return toSerialize, nil +} + +func (o *CreateNetworkIPv4WithPrefix) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv4WithPrefix := _CreateNetworkIPv4WithPrefix{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv4WithPrefix) + + if err != nil { + return err + } + + *o = CreateNetworkIPv4WithPrefix(varCreateNetworkIPv4WithPrefix) + + return err +} + +type NullableCreateNetworkIPv4WithPrefix struct { + value *CreateNetworkIPv4WithPrefix + isSet bool +} + +func (v NullableCreateNetworkIPv4WithPrefix) Get() *CreateNetworkIPv4WithPrefix { + return v.value +} + +func (v *NullableCreateNetworkIPv4WithPrefix) Set(val *CreateNetworkIPv4WithPrefix) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4WithPrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4WithPrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4WithPrefix(val *CreateNetworkIPv4WithPrefix) *NullableCreateNetworkIPv4WithPrefix { + return &NullableCreateNetworkIPv4WithPrefix{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4WithPrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix_length.go b/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix_length.go new file mode 100644 index 000000000..1d944e460 --- /dev/null +++ b/services/iaas/v2alpha1api/model_create_network_ipv4_with_prefix_length.go @@ -0,0 +1,194 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv4WithPrefixLength type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefixLength{} + +// CreateNetworkIPv4WithPrefixLength The create request for an IPv4 network with a wanted prefix length. +type CreateNetworkIPv4WithPrefixLength struct { + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + PrefixLength int64 `json:"prefixLength"` +} + +type _CreateNetworkIPv4WithPrefixLength CreateNetworkIPv4WithPrefixLength + +// NewCreateNetworkIPv4WithPrefixLength instantiates a new CreateNetworkIPv4WithPrefixLength object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4WithPrefixLength(prefixLength int64) *CreateNetworkIPv4WithPrefixLength { + this := CreateNetworkIPv4WithPrefixLength{} + this.PrefixLength = prefixLength + return &this +} + +// NewCreateNetworkIPv4WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv4WithPrefixLength object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4WithPrefixLengthWithDefaults() *CreateNetworkIPv4WithPrefixLength { + this := CreateNetworkIPv4WithPrefixLength{} + return &this +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4WithPrefixLength) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefixLength) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefixLength) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4WithPrefixLength) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixLength returns the PrefixLength field value +func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLength() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLengthOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.PrefixLength, true +} + +// SetPrefixLength sets field value +func (o *CreateNetworkIPv4WithPrefixLength) SetPrefixLength(v int64) { + o.PrefixLength = v +} + +func (o CreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv4WithPrefixLength) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixLength"] = o.PrefixLength + return toSerialize, nil +} + +func (o *CreateNetworkIPv4WithPrefixLength) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixLength", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv4WithPrefixLength := _CreateNetworkIPv4WithPrefixLength{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv4WithPrefixLength) + + if err != nil { + return err + } + + *o = CreateNetworkIPv4WithPrefixLength(varCreateNetworkIPv4WithPrefixLength) + + return err +} + +type NullableCreateNetworkIPv4WithPrefixLength struct { + value *CreateNetworkIPv4WithPrefixLength + isSet bool +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) Get() *CreateNetworkIPv4WithPrefixLength { + return v.value +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) Set(val *CreateNetworkIPv4WithPrefixLength) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4WithPrefixLength(val *CreateNetworkIPv4WithPrefixLength) *NullableCreateNetworkIPv4WithPrefixLength { + return &NullableCreateNetworkIPv4WithPrefixLength{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv6.go b/services/iaas/v2alpha1api/model_create_network_ipv6.go new file mode 100644 index 000000000..88f65bfff --- /dev/null +++ b/services/iaas/v2alpha1api/model_create_network_ipv6.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" + "fmt" +) + +// CreateNetworkIPv6 - The create request for an IPv6 network. +type CreateNetworkIPv6 struct { + CreateNetworkIPv6WithPrefix *CreateNetworkIPv6WithPrefix + CreateNetworkIPv6WithPrefixLength *CreateNetworkIPv6WithPrefixLength +} + +// CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefix wrapped in CreateNetworkIPv6 +func CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefix) CreateNetworkIPv6 { + return CreateNetworkIPv6{ + CreateNetworkIPv6WithPrefix: v, + } +} + +// CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefixLength wrapped in CreateNetworkIPv6 +func CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefixLength) CreateNetworkIPv6 { + return CreateNetworkIPv6{ + CreateNetworkIPv6WithPrefixLength: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateNetworkIPv6) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateNetworkIPv6WithPrefix + err = json.Unmarshal(data, &dst.CreateNetworkIPv6WithPrefix) + if err == nil { + jsonCreateNetworkIPv6WithPrefix, _ := json.Marshal(dst.CreateNetworkIPv6WithPrefix) + if string(jsonCreateNetworkIPv6WithPrefix) == "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefix = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv6WithPrefix = nil + } + + // try to unmarshal data into CreateNetworkIPv6WithPrefixLength + err = json.Unmarshal(data, &dst.CreateNetworkIPv6WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv6WithPrefixLength, _ := json.Marshal(dst.CreateNetworkIPv6WithPrefixLength) + if string(jsonCreateNetworkIPv6WithPrefixLength) == "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefixLength = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv6WithPrefixLength = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateNetworkIPv6WithPrefix = nil + dst.CreateNetworkIPv6WithPrefixLength = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateNetworkIPv6)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv6)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateNetworkIPv6) MarshalJSON() ([]byte, error) { + if src.CreateNetworkIPv6WithPrefix != nil { + return json.Marshal(&src.CreateNetworkIPv6WithPrefix) + } + + if src.CreateNetworkIPv6WithPrefixLength != nil { + return json.Marshal(&src.CreateNetworkIPv6WithPrefixLength) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateNetworkIPv6) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateNetworkIPv6WithPrefix != nil { + return obj.CreateNetworkIPv6WithPrefix + } + + if obj.CreateNetworkIPv6WithPrefixLength != nil { + return obj.CreateNetworkIPv6WithPrefixLength + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateNetworkIPv6) GetActualInstanceValue() interface{} { + if obj.CreateNetworkIPv6WithPrefix != nil { + return *obj.CreateNetworkIPv6WithPrefix + } + + if obj.CreateNetworkIPv6WithPrefixLength != nil { + return *obj.CreateNetworkIPv6WithPrefixLength + } + + // all schemas are nil + return nil +} + +type NullableCreateNetworkIPv6 struct { + value *CreateNetworkIPv6 + isSet bool +} + +func (v NullableCreateNetworkIPv6) Get() *CreateNetworkIPv6 { + return v.value +} + +func (v *NullableCreateNetworkIPv6) Set(val *CreateNetworkIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6(val *CreateNetworkIPv6) *NullableCreateNetworkIPv6 { + return &NullableCreateNetworkIPv6{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix.go b/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix.go new file mode 100644 index 000000000..334bda010 --- /dev/null +++ b/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix.go @@ -0,0 +1,243 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv6WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefix{} + +// CreateNetworkIPv6WithPrefix The create request for an IPv6 network with a specified prefix. +type CreateNetworkIPv6WithPrefix struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + // Classless Inter-Domain Routing (CIDR) for IPv6. + Prefix string `json:"prefix" validate:"regexp=^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +type _CreateNetworkIPv6WithPrefix CreateNetworkIPv6WithPrefix + +// NewCreateNetworkIPv6WithPrefix instantiates a new CreateNetworkIPv6WithPrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6WithPrefix(prefix string) *CreateNetworkIPv6WithPrefix { + this := CreateNetworkIPv6WithPrefix{} + this.Prefix = prefix + return &this +} + +// NewCreateNetworkIPv6WithPrefixWithDefaults instantiates a new CreateNetworkIPv6WithPrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6WithPrefixWithDefaults() *CreateNetworkIPv6WithPrefix { + this := CreateNetworkIPv6WithPrefix{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv6WithPrefix) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv6WithPrefix) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefix) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *CreateNetworkIPv6WithPrefix) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv6WithPrefix) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv6WithPrefix) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6WithPrefix) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefix) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefix) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6WithPrefix) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value +func (o *CreateNetworkIPv6WithPrefix) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefix) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *CreateNetworkIPv6WithPrefix) SetPrefix(v string) { + o.Prefix = v +} + +func (o CreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv6WithPrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefix"] = o.Prefix + return toSerialize, nil +} + +func (o *CreateNetworkIPv6WithPrefix) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv6WithPrefix := _CreateNetworkIPv6WithPrefix{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv6WithPrefix) + + if err != nil { + return err + } + + *o = CreateNetworkIPv6WithPrefix(varCreateNetworkIPv6WithPrefix) + + return err +} + +type NullableCreateNetworkIPv6WithPrefix struct { + value *CreateNetworkIPv6WithPrefix + isSet bool +} + +func (v NullableCreateNetworkIPv6WithPrefix) Get() *CreateNetworkIPv6WithPrefix { + return v.value +} + +func (v *NullableCreateNetworkIPv6WithPrefix) Set(val *CreateNetworkIPv6WithPrefix) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6WithPrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6WithPrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6WithPrefix(val *CreateNetworkIPv6WithPrefix) *NullableCreateNetworkIPv6WithPrefix { + return &NullableCreateNetworkIPv6WithPrefix{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6WithPrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix_length.go b/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix_length.go new file mode 100644 index 000000000..12007b3a3 --- /dev/null +++ b/services/iaas/v2alpha1api/model_create_network_ipv6_with_prefix_length.go @@ -0,0 +1,194 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv6WithPrefixLength type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefixLength{} + +// CreateNetworkIPv6WithPrefixLength The create request for an IPv6 network with a wanted prefix length. +type CreateNetworkIPv6WithPrefixLength struct { + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + PrefixLength int64 `json:"prefixLength"` +} + +type _CreateNetworkIPv6WithPrefixLength CreateNetworkIPv6WithPrefixLength + +// NewCreateNetworkIPv6WithPrefixLength instantiates a new CreateNetworkIPv6WithPrefixLength object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6WithPrefixLength(prefixLength int64) *CreateNetworkIPv6WithPrefixLength { + this := CreateNetworkIPv6WithPrefixLength{} + this.PrefixLength = prefixLength + return &this +} + +// NewCreateNetworkIPv6WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv6WithPrefixLength object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6WithPrefixLengthWithDefaults() *CreateNetworkIPv6WithPrefixLength { + this := CreateNetworkIPv6WithPrefixLength{} + return &this +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6WithPrefixLength) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefixLength) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefixLength) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6WithPrefixLength) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixLength returns the PrefixLength field value +func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLength() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLengthOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.PrefixLength, true +} + +// SetPrefixLength sets field value +func (o *CreateNetworkIPv6WithPrefixLength) SetPrefixLength(v int64) { + o.PrefixLength = v +} + +func (o CreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv6WithPrefixLength) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixLength"] = o.PrefixLength + return toSerialize, nil +} + +func (o *CreateNetworkIPv6WithPrefixLength) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixLength", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv6WithPrefixLength := _CreateNetworkIPv6WithPrefixLength{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv6WithPrefixLength) + + if err != nil { + return err + } + + *o = CreateNetworkIPv6WithPrefixLength(varCreateNetworkIPv6WithPrefixLength) + + return err +} + +type NullableCreateNetworkIPv6WithPrefixLength struct { + value *CreateNetworkIPv6WithPrefixLength + isSet bool +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) Get() *CreateNetworkIPv6WithPrefixLength { + return v.value +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) Set(val *CreateNetworkIPv6WithPrefixLength) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6WithPrefixLength(val *CreateNetworkIPv6WithPrefixLength) *NullableCreateNetworkIPv6WithPrefixLength { + return &NullableCreateNetworkIPv6WithPrefixLength{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_create_network_payload.go b/services/iaas/v2alpha1api/model_create_network_payload.go new file mode 100644 index 000000000..9896dfe8a --- /dev/null +++ b/services/iaas/v2alpha1api/model_create_network_payload.go @@ -0,0 +1,382 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkPayload{} + +// CreateNetworkPayload Object that represents the request body for a network create. +type CreateNetworkPayload struct { + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + Ipv4 *CreateNetworkIPv4 `json:"ipv4,omitempty"` + Ipv6 *CreateNetworkIPv6 `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _CreateNetworkPayload CreateNetworkPayload + +// NewCreateNetworkPayload instantiates a new CreateNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkPayload(name string) *CreateNetworkPayload { + this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + this.Name = name + return &this +} + +// NewCreateNetworkPayloadWithDefaults instantiates a new CreateNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { + this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + return &this +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *CreateNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetIpv4() CreateNetworkIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret CreateNetworkIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetIpv4Ok() (*CreateNetworkIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. +func (o *CreateNetworkPayload) SetIpv4(v CreateNetworkIPv4) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetIpv6() CreateNetworkIPv6 { + if o == nil || IsNil(o.Ipv6) { + var ret CreateNetworkIPv6 + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetIpv6Ok() (*CreateNetworkIPv6, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given CreateNetworkIPv6 and assigns it to the Ipv6 field. +func (o *CreateNetworkPayload) SetIpv6(v CreateNetworkIPv6) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkPayload) SetName(v string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *CreateNetworkPayload) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *CreateNetworkPayload) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +func (o CreateNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + return toSerialize, nil +} + +func (o *CreateNetworkPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkPayload := _CreateNetworkPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkPayload) + + if err != nil { + return err + } + + *o = CreateNetworkPayload(varCreateNetworkPayload) + + return err +} + +type NullableCreateNetworkPayload struct { + value *CreateNetworkPayload + isSet bool +} + +func (v NullableCreateNetworkPayload) Get() *CreateNetworkPayload { + return v.value +} + +func (v *NullableCreateNetworkPayload) Set(val *CreateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkPayload(val *CreateNetworkPayload) *NullableCreateNetworkPayload { + return &NullableCreateNetworkPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_destination_cidrv4.go b/services/iaas/v2alpha1api/model_destination_cidrv4.go new file mode 100644 index 000000000..6e042baa3 --- /dev/null +++ b/services/iaas/v2alpha1api/model_destination_cidrv4.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DestinationCIDRv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DestinationCIDRv4{} + +// DestinationCIDRv4 IPv4 Classless Inter-Domain Routing (CIDR) Object. +type DestinationCIDRv4 struct { + Type string `json:"type"` + // An CIDRv4 string. + Value string `json:"value" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` +} + +type _DestinationCIDRv4 DestinationCIDRv4 + +// NewDestinationCIDRv4 instantiates a new DestinationCIDRv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDestinationCIDRv4(types string, value string) *DestinationCIDRv4 { + this := DestinationCIDRv4{} + this.Type = types + this.Value = value + return &this +} + +// NewDestinationCIDRv4WithDefaults instantiates a new DestinationCIDRv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDestinationCIDRv4WithDefaults() *DestinationCIDRv4 { + this := DestinationCIDRv4{} + return &this +} + +// GetType returns the Type field value +func (o *DestinationCIDRv4) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv4) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DestinationCIDRv4) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *DestinationCIDRv4) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv4) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *DestinationCIDRv4) SetValue(v string) { + o.Value = v +} + +func (o DestinationCIDRv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DestinationCIDRv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *DestinationCIDRv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDestinationCIDRv4 := _DestinationCIDRv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDestinationCIDRv4) + + if err != nil { + return err + } + + *o = DestinationCIDRv4(varDestinationCIDRv4) + + return err +} + +type NullableDestinationCIDRv4 struct { + value *DestinationCIDRv4 + isSet bool +} + +func (v NullableDestinationCIDRv4) Get() *DestinationCIDRv4 { + return v.value +} + +func (v *NullableDestinationCIDRv4) Set(val *DestinationCIDRv4) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationCIDRv4) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationCIDRv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationCIDRv4(val *DestinationCIDRv4) *NullableDestinationCIDRv4 { + return &NullableDestinationCIDRv4{value: val, isSet: true} +} + +func (v NullableDestinationCIDRv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationCIDRv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_destination_cidrv6.go b/services/iaas/v2alpha1api/model_destination_cidrv6.go new file mode 100644 index 000000000..e1e5cd346 --- /dev/null +++ b/services/iaas/v2alpha1api/model_destination_cidrv6.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DestinationCIDRv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DestinationCIDRv6{} + +// DestinationCIDRv6 IPv6 Classless Inter-Domain Routing (CIDR) Object. +type DestinationCIDRv6 struct { + Type string `json:"type"` + // An CIDRv6 string. + Value string `json:"value" validate:"regexp=^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +type _DestinationCIDRv6 DestinationCIDRv6 + +// NewDestinationCIDRv6 instantiates a new DestinationCIDRv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDestinationCIDRv6(types string, value string) *DestinationCIDRv6 { + this := DestinationCIDRv6{} + this.Type = types + this.Value = value + return &this +} + +// NewDestinationCIDRv6WithDefaults instantiates a new DestinationCIDRv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDestinationCIDRv6WithDefaults() *DestinationCIDRv6 { + this := DestinationCIDRv6{} + return &this +} + +// GetType returns the Type field value +func (o *DestinationCIDRv6) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv6) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DestinationCIDRv6) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *DestinationCIDRv6) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv6) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *DestinationCIDRv6) SetValue(v string) { + o.Value = v +} + +func (o DestinationCIDRv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DestinationCIDRv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *DestinationCIDRv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDestinationCIDRv6 := _DestinationCIDRv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDestinationCIDRv6) + + if err != nil { + return err + } + + *o = DestinationCIDRv6(varDestinationCIDRv6) + + return err +} + +type NullableDestinationCIDRv6 struct { + value *DestinationCIDRv6 + isSet bool +} + +func (v NullableDestinationCIDRv6) Get() *DestinationCIDRv6 { + return v.value +} + +func (v *NullableDestinationCIDRv6) Set(val *DestinationCIDRv6) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationCIDRv6) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationCIDRv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationCIDRv6(val *DestinationCIDRv6) *NullableDestinationCIDRv6 { + return &NullableDestinationCIDRv6{value: val, isSet: true} +} + +func (v NullableDestinationCIDRv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationCIDRv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_error.go b/services/iaas/v2alpha1api/model_error.go new file mode 100644 index 000000000..c5df69593 --- /dev/null +++ b/services/iaas/v2alpha1api/model_error.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error Error with HTTP error code and an error message. +type Error struct { + Code int64 `json:"code"` + // An error message. + Msg string `json:"msg"` +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(code int64, msg string) *Error { + this := Error{} + this.Code = code + this.Msg = msg + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetCode returns the Code field value +func (o *Error) GetCode() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *Error) GetCodeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *Error) SetCode(v int64) { + o.Code = v +} + +// GetMsg returns the Msg field value +func (o *Error) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *Error) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *Error) SetMsg(v string) { + o.Msg = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "msg", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varError) + + if err != nil { + return err + } + + *o = Error(varError) + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_network.go b/services/iaas/v2alpha1api/model_network.go new file mode 100644 index 000000000..99c0288aa --- /dev/null +++ b/services/iaas/v2alpha1api/model_network.go @@ -0,0 +1,510 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Network type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Network{} + +// Network Object that represents a network. If no routing table is specified, the default routing table is used. +type Network struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Ipv4 *NetworkIPv4 `json:"ipv4,omitempty"` + Ipv6 *NetworkIPv6 `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Network Network + +// NewNetwork instantiates a new Network object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetwork(id string, name string, status string) *Network { + this := Network{} + this.Id = id + this.Name = name + this.Status = status + return &this +} + +// NewNetworkWithDefaults instantiates a new Network object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkWithDefaults() *Network { + this := Network{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Network) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Network) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Network) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *Network) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *Network) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *Network) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetId returns the Id field value +func (o *Network) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Network) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Network) SetId(v string) { + o.Id = v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *Network) GetIpv4() NetworkIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret NetworkIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetIpv4Ok() (*NetworkIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *Network) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given NetworkIPv4 and assigns it to the Ipv4 field. +func (o *Network) SetIpv4(v NetworkIPv4) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *Network) GetIpv6() NetworkIPv6 { + if o == nil || IsNil(o.Ipv6) { + var ret NetworkIPv6 + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetIpv6Ok() (*NetworkIPv6, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *Network) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given NetworkIPv6 and assigns it to the Ipv6 field. +func (o *Network) SetIpv6(v NetworkIPv6) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Network) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Network) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Network) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *Network) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Network) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Network) SetName(v string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *Network) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *Network) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *Network) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *Network) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *Network) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *Network) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +// GetStatus returns the Status field value +func (o *Network) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Network) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Network) SetStatus(v string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Network) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Network) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Network) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Network) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Network) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + toSerialize["id"] = o.Id + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + toSerialize["status"] = o.Status + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Network) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetwork := _Network{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetwork) + + if err != nil { + return err + } + + *o = Network(varNetwork) + + return err +} + +type NullableNetwork struct { + value *Network + isSet bool +} + +func (v NullableNetwork) Get() *Network { + return v.value +} + +func (v *NullableNetwork) Set(val *Network) { + v.value = val + v.isSet = true +} + +func (v NullableNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetwork(val *Network) *NullableNetwork { + return &NullableNetwork{value: val, isSet: true} +} + +func (v NullableNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_network_ipv4.go b/services/iaas/v2alpha1api/model_network_ipv4.go new file mode 100644 index 000000000..a832f8f2b --- /dev/null +++ b/services/iaas/v2alpha1api/model_network_ipv4.go @@ -0,0 +1,279 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv4{} + +// NetworkIPv4 Object that represents the IPv4 part of a network. +type NetworkIPv4 struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + Prefixes []string `json:"prefixes"` + // String that represents an IPv4 address. + PublicIp *string `json:"publicIp,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` +} + +type _NetworkIPv4 NetworkIPv4 + +// NewNetworkIPv4 instantiates a new NetworkIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkIPv4(prefixes []string) *NetworkIPv4 { + this := NetworkIPv4{} + this.Prefixes = prefixes + return &this +} + +// NewNetworkIPv4WithDefaults instantiates a new NetworkIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkIPv4WithDefaults() *NetworkIPv4 { + this := NetworkIPv4{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NetworkIPv4) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkIPv4) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkIPv4) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *NetworkIPv4) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *NetworkIPv4) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *NetworkIPv4) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *NetworkIPv4) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *NetworkIPv4) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *NetworkIPv4) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixes returns the Prefixes field value +func (o *NetworkIPv4) GetPrefixes() []string { + if o == nil { + var ret []string + return ret + } + + return o.Prefixes +} + +// GetPrefixesOk returns a tuple with the Prefixes field value +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetPrefixesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Prefixes, true +} + +// SetPrefixes sets field value +func (o *NetworkIPv4) SetPrefixes(v []string) { + o.Prefixes = v +} + +// GetPublicIp returns the PublicIp field value if set, zero value otherwise. +func (o *NetworkIPv4) GetPublicIp() string { + if o == nil || IsNil(o.PublicIp) { + var ret string + return ret + } + return *o.PublicIp +} + +// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetPublicIpOk() (*string, bool) { + if o == nil || IsNil(o.PublicIp) { + return nil, false + } + return o.PublicIp, true +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *NetworkIPv4) HasPublicIp() bool { + if o != nil && !IsNil(o.PublicIp) { + return true + } + + return false +} + +// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +func (o *NetworkIPv4) SetPublicIp(v string) { + o.PublicIp = &v +} + +func (o NetworkIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixes"] = o.Prefixes + if !IsNil(o.PublicIp) { + toSerialize["publicIp"] = o.PublicIp + } + return toSerialize, nil +} + +func (o *NetworkIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkIPv4 := _NetworkIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkIPv4) + + if err != nil { + return err + } + + *o = NetworkIPv4(varNetworkIPv4) + + return err +} + +type NullableNetworkIPv4 struct { + value *NetworkIPv4 + isSet bool +} + +func (v NullableNetworkIPv4) Get() *NetworkIPv4 { + return v.value +} + +func (v *NullableNetworkIPv4) Set(val *NetworkIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkIPv4(val *NetworkIPv4) *NullableNetworkIPv4 { + return &NullableNetworkIPv4{value: val, isSet: true} +} + +func (v NullableNetworkIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_network_ipv6.go b/services/iaas/v2alpha1api/model_network_ipv6.go new file mode 100644 index 000000000..402690383 --- /dev/null +++ b/services/iaas/v2alpha1api/model_network_ipv6.go @@ -0,0 +1,242 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv6{} + +// NetworkIPv6 Object that represents the IPv6 part of a network. +type NetworkIPv6 struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + Prefixes []string `json:"prefixes"` +} + +type _NetworkIPv6 NetworkIPv6 + +// NewNetworkIPv6 instantiates a new NetworkIPv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkIPv6(prefixes []string) *NetworkIPv6 { + this := NetworkIPv6{} + this.Prefixes = prefixes + return &this +} + +// NewNetworkIPv6WithDefaults instantiates a new NetworkIPv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkIPv6WithDefaults() *NetworkIPv6 { + this := NetworkIPv6{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NetworkIPv6) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkIPv6) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkIPv6) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *NetworkIPv6) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *NetworkIPv6) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *NetworkIPv6) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *NetworkIPv6) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv6) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *NetworkIPv6) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *NetworkIPv6) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixes returns the Prefixes field value +func (o *NetworkIPv6) GetPrefixes() []string { + if o == nil { + var ret []string + return ret + } + + return o.Prefixes +} + +// GetPrefixesOk returns a tuple with the Prefixes field value +// and a boolean to check if the value has been set. +func (o *NetworkIPv6) GetPrefixesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Prefixes, true +} + +// SetPrefixes sets field value +func (o *NetworkIPv6) SetPrefixes(v []string) { + o.Prefixes = v +} + +func (o NetworkIPv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixes"] = o.Prefixes + return toSerialize, nil +} + +func (o *NetworkIPv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkIPv6 := _NetworkIPv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkIPv6) + + if err != nil { + return err + } + + *o = NetworkIPv6(varNetworkIPv6) + + return err +} + +type NullableNetworkIPv6 struct { + value *NetworkIPv6 + isSet bool +} + +func (v NullableNetworkIPv6) Get() *NetworkIPv6 { + return v.value +} + +func (v *NullableNetworkIPv6) Set(val *NetworkIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkIPv6(val *NetworkIPv6) *NullableNetworkIPv6 { + return &NullableNetworkIPv6{value: val, isSet: true} +} + +func (v NullableNetworkIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_network_list_response.go b/services/iaas/v2alpha1api/model_network_list_response.go new file mode 100644 index 000000000..0364fc05d --- /dev/null +++ b/services/iaas/v2alpha1api/model_network_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkListResponse{} + +// NetworkListResponse Network list response. +type NetworkListResponse struct { + // A list of networks. + Items []Network `json:"items"` +} + +type _NetworkListResponse NetworkListResponse + +// NewNetworkListResponse instantiates a new NetworkListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkListResponse(items []Network) *NetworkListResponse { + this := NetworkListResponse{} + this.Items = items + return &this +} + +// NewNetworkListResponseWithDefaults instantiates a new NetworkListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkListResponseWithDefaults() *NetworkListResponse { + this := NetworkListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkListResponse) GetItems() []Network { + if o == nil { + var ret []Network + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkListResponse) GetItemsOk() ([]Network, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkListResponse) SetItems(v []Network) { + o.Items = v +} + +func (o NetworkListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkListResponse := _NetworkListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkListResponse) + + if err != nil { + return err + } + + *o = NetworkListResponse(varNetworkListResponse) + + return err +} + +type NullableNetworkListResponse struct { + value *NetworkListResponse + isSet bool +} + +func (v NullableNetworkListResponse) Get() *NetworkListResponse { + return v.value +} + +func (v *NullableNetworkListResponse) Set(val *NetworkListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkListResponse(val *NetworkListResponse) *NullableNetworkListResponse { + return &NullableNetworkListResponse{value: val, isSet: true} +} + +func (v NullableNetworkListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_nexthop_blackhole.go b/services/iaas/v2alpha1api/model_nexthop_blackhole.go new file mode 100644 index 000000000..9f5f36dd6 --- /dev/null +++ b/services/iaas/v2alpha1api/model_nexthop_blackhole.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopBlackhole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopBlackhole{} + +// NexthopBlackhole Object that represents a blackhole route. +type NexthopBlackhole struct { + Type string `json:"type"` +} + +type _NexthopBlackhole NexthopBlackhole + +// NewNexthopBlackhole instantiates a new NexthopBlackhole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopBlackhole(types string) *NexthopBlackhole { + this := NexthopBlackhole{} + this.Type = types + return &this +} + +// NewNexthopBlackholeWithDefaults instantiates a new NexthopBlackhole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopBlackholeWithDefaults() *NexthopBlackhole { + this := NexthopBlackhole{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopBlackhole) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopBlackhole) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopBlackhole) SetType(v string) { + o.Type = v +} + +func (o NexthopBlackhole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopBlackhole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *NexthopBlackhole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopBlackhole := _NexthopBlackhole{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopBlackhole) + + if err != nil { + return err + } + + *o = NexthopBlackhole(varNexthopBlackhole) + + return err +} + +type NullableNexthopBlackhole struct { + value *NexthopBlackhole + isSet bool +} + +func (v NullableNexthopBlackhole) Get() *NexthopBlackhole { + return v.value +} + +func (v *NullableNexthopBlackhole) Set(val *NexthopBlackhole) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopBlackhole) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopBlackhole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopBlackhole(val *NexthopBlackhole) *NullableNexthopBlackhole { + return &NullableNexthopBlackhole{value: val, isSet: true} +} + +func (v NullableNexthopBlackhole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopBlackhole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_nexthop_internet.go b/services/iaas/v2alpha1api/model_nexthop_internet.go new file mode 100644 index 000000000..3662ac00a --- /dev/null +++ b/services/iaas/v2alpha1api/model_nexthop_internet.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopInternet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopInternet{} + +// NexthopInternet Object that represents a route to the internet. +type NexthopInternet struct { + Type string `json:"type"` +} + +type _NexthopInternet NexthopInternet + +// NewNexthopInternet instantiates a new NexthopInternet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopInternet(types string) *NexthopInternet { + this := NexthopInternet{} + this.Type = types + return &this +} + +// NewNexthopInternetWithDefaults instantiates a new NexthopInternet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopInternetWithDefaults() *NexthopInternet { + this := NexthopInternet{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopInternet) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopInternet) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopInternet) SetType(v string) { + o.Type = v +} + +func (o NexthopInternet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopInternet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *NexthopInternet) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopInternet := _NexthopInternet{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopInternet) + + if err != nil { + return err + } + + *o = NexthopInternet(varNexthopInternet) + + return err +} + +type NullableNexthopInternet struct { + value *NexthopInternet + isSet bool +} + +func (v NullableNexthopInternet) Get() *NexthopInternet { + return v.value +} + +func (v *NullableNexthopInternet) Set(val *NexthopInternet) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopInternet) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopInternet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopInternet(val *NexthopInternet) *NullableNexthopInternet { + return &NullableNexthopInternet{value: val, isSet: true} +} + +func (v NullableNexthopInternet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopInternet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_nexthop_ipv4.go b/services/iaas/v2alpha1api/model_nexthop_ipv4.go new file mode 100644 index 000000000..087b407c1 --- /dev/null +++ b/services/iaas/v2alpha1api/model_nexthop_ipv4.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopIPv4{} + +// NexthopIPv4 Object that represents an IPv4 address. +type NexthopIPv4 struct { + Type string `json:"type"` + // An IPv4 address. + Value string `json:"value" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` +} + +type _NexthopIPv4 NexthopIPv4 + +// NewNexthopIPv4 instantiates a new NexthopIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopIPv4(types string, value string) *NexthopIPv4 { + this := NexthopIPv4{} + this.Type = types + this.Value = value + return &this +} + +// NewNexthopIPv4WithDefaults instantiates a new NexthopIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopIPv4WithDefaults() *NexthopIPv4 { + this := NexthopIPv4{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopIPv4) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv4) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopIPv4) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *NexthopIPv4) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv4) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *NexthopIPv4) SetValue(v string) { + o.Value = v +} + +func (o NexthopIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *NexthopIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopIPv4 := _NexthopIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopIPv4) + + if err != nil { + return err + } + + *o = NexthopIPv4(varNexthopIPv4) + + return err +} + +type NullableNexthopIPv4 struct { + value *NexthopIPv4 + isSet bool +} + +func (v NullableNexthopIPv4) Get() *NexthopIPv4 { + return v.value +} + +func (v *NullableNexthopIPv4) Set(val *NexthopIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopIPv4(val *NexthopIPv4) *NullableNexthopIPv4 { + return &NullableNexthopIPv4{value: val, isSet: true} +} + +func (v NullableNexthopIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_nexthop_ipv6.go b/services/iaas/v2alpha1api/model_nexthop_ipv6.go new file mode 100644 index 000000000..39c8c40c5 --- /dev/null +++ b/services/iaas/v2alpha1api/model_nexthop_ipv6.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopIPv6{} + +// NexthopIPv6 Object that represents an IPv6 address. +type NexthopIPv6 struct { + Type string `json:"type"` + // An IPv6 address. + Value string `json:"value" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` +} + +type _NexthopIPv6 NexthopIPv6 + +// NewNexthopIPv6 instantiates a new NexthopIPv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopIPv6(types string, value string) *NexthopIPv6 { + this := NexthopIPv6{} + this.Type = types + this.Value = value + return &this +} + +// NewNexthopIPv6WithDefaults instantiates a new NexthopIPv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopIPv6WithDefaults() *NexthopIPv6 { + this := NexthopIPv6{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopIPv6) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv6) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopIPv6) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *NexthopIPv6) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv6) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *NexthopIPv6) SetValue(v string) { + o.Value = v +} + +func (o NexthopIPv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *NexthopIPv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopIPv6 := _NexthopIPv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopIPv6) + + if err != nil { + return err + } + + *o = NexthopIPv6(varNexthopIPv6) + + return err +} + +type NullableNexthopIPv6 struct { + value *NexthopIPv6 + isSet bool +} + +func (v NullableNexthopIPv6) Get() *NexthopIPv6 { + return v.value +} + +func (v *NullableNexthopIPv6) Set(val *NexthopIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopIPv6(val *NexthopIPv6) *NullableNexthopIPv6 { + return &NullableNexthopIPv6{value: val, isSet: true} +} + +func (v NullableNexthopIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_partial_update_network_payload.go b/services/iaas/v2alpha1api/model_partial_update_network_payload.go new file mode 100644 index 000000000..6f768760a --- /dev/null +++ b/services/iaas/v2alpha1api/model_partial_update_network_payload.go @@ -0,0 +1,346 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkPayload{} + +// PartialUpdateNetworkPayload Object that represents the request body for a network update. +type PartialUpdateNetworkPayload struct { + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + Ipv4 *UpdateNetworkIPv4Body `json:"ipv4,omitempty"` + Ipv6 *UpdateNetworkIPv6Body `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewPartialUpdateNetworkPayload instantiates a new PartialUpdateNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateNetworkPayload() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// NewPartialUpdateNetworkPayloadWithDefaults instantiates a new PartialUpdateNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *PartialUpdateNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetIpv4() UpdateNetworkIPv4Body { + if o == nil || IsNil(o.Ipv4) { + var ret UpdateNetworkIPv4Body + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetIpv4Ok() (*UpdateNetworkIPv4Body, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. +func (o *PartialUpdateNetworkPayload) SetIpv4(v UpdateNetworkIPv4Body) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetIpv6() UpdateNetworkIPv6Body { + if o == nil || IsNil(o.Ipv6) { + var ret UpdateNetworkIPv6Body + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetIpv6Ok() (*UpdateNetworkIPv6Body, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. +func (o *PartialUpdateNetworkPayload) SetIpv6(v UpdateNetworkIPv6Body) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkPayload) SetName(v string) { + o.Name = &v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *PartialUpdateNetworkPayload) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *PartialUpdateNetworkPayload) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +func (o PartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkPayload struct { + value *PartialUpdateNetworkPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkPayload) Get() *PartialUpdateNetworkPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkPayload) Set(val *PartialUpdateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkPayload(val *PartialUpdateNetworkPayload) *NullablePartialUpdateNetworkPayload { + return &NullablePartialUpdateNetworkPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_route.go b/services/iaas/v2alpha1api/model_route.go new file mode 100644 index 000000000..9e683c465 --- /dev/null +++ b/services/iaas/v2alpha1api/model_route.go @@ -0,0 +1,334 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Route type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Route{} + +// Route Object represents a network route. +type Route struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + Destination RouteDestination `json:"destination"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Nexthop RouteNexthop `json:"nexthop"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Route Route + +// NewRoute instantiates a new Route object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoute(destination RouteDestination, nexthop RouteNexthop) *Route { + this := Route{} + this.Destination = destination + this.Nexthop = nexthop + return &this +} + +// NewRouteWithDefaults instantiates a new Route object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteWithDefaults() *Route { + this := Route{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Route) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Route) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Route) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDestination returns the Destination field value +func (o *Route) GetDestination() RouteDestination { + if o == nil { + var ret RouteDestination + return ret + } + + return o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value +// and a boolean to check if the value has been set. +func (o *Route) GetDestinationOk() (*RouteDestination, bool) { + if o == nil { + return nil, false + } + return &o.Destination, true +} + +// SetDestination sets field value +func (o *Route) SetDestination(v RouteDestination) { + o.Destination = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Route) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Route) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Route) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Route) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Route) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Route) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNexthop returns the Nexthop field value +func (o *Route) GetNexthop() RouteNexthop { + if o == nil { + var ret RouteNexthop + return ret + } + + return o.Nexthop +} + +// GetNexthopOk returns a tuple with the Nexthop field value +// and a boolean to check if the value has been set. +func (o *Route) GetNexthopOk() (*RouteNexthop, bool) { + if o == nil { + return nil, false + } + return &o.Nexthop, true +} + +// SetNexthop sets field value +func (o *Route) SetNexthop(v RouteNexthop) { + o.Nexthop = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Route) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Route) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Route) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Route) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Route) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["destination"] = o.Destination + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["nexthop"] = o.Nexthop + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Route) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "destination", + "nexthop", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoute := _Route{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoute) + + if err != nil { + return err + } + + *o = Route(varRoute) + + return err +} + +type NullableRoute struct { + value *Route + isSet bool +} + +func (v NullableRoute) Get() *Route { + return v.value +} + +func (v *NullableRoute) Set(val *Route) { + v.value = val + v.isSet = true +} + +func (v NullableRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoute(val *Route) *NullableRoute { + return &NullableRoute{value: val, isSet: true} +} + +func (v NullableRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_route_destination.go b/services/iaas/v2alpha1api/model_route_destination.go new file mode 100644 index 000000000..abafa1f18 --- /dev/null +++ b/services/iaas/v2alpha1api/model_route_destination.go @@ -0,0 +1,154 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" + "fmt" +) + +// RouteDestination - struct for RouteDestination +type RouteDestination struct { + DestinationCIDRv4 *DestinationCIDRv4 + DestinationCIDRv6 *DestinationCIDRv6 +} + +// DestinationCIDRv4AsRouteDestination is a convenience function that returns DestinationCIDRv4 wrapped in RouteDestination +func DestinationCIDRv4AsRouteDestination(v *DestinationCIDRv4) RouteDestination { + return RouteDestination{ + DestinationCIDRv4: v, + } +} + +// DestinationCIDRv6AsRouteDestination is a convenience function that returns DestinationCIDRv6 wrapped in RouteDestination +func DestinationCIDRv6AsRouteDestination(v *DestinationCIDRv6) RouteDestination { + return RouteDestination{ + DestinationCIDRv6: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RouteDestination) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'cidrv4' + if jsonDict["type"] == "cidrv4" { + // try to unmarshal JSON data into DestinationCIDRv4 + err = json.Unmarshal(data, &dst.DestinationCIDRv4) + if err == nil { + return nil // data stored in dst.DestinationCIDRv4, return on the first match + } else { + dst.DestinationCIDRv4 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'cidrv6' + if jsonDict["type"] == "cidrv6" { + // try to unmarshal JSON data into DestinationCIDRv6 + err = json.Unmarshal(data, &dst.DestinationCIDRv6) + if err == nil { + return nil // data stored in dst.DestinationCIDRv6, return on the first match + } else { + dst.DestinationCIDRv6 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv6: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RouteDestination) MarshalJSON() ([]byte, error) { + if src.DestinationCIDRv4 != nil { + return json.Marshal(&src.DestinationCIDRv4) + } + + if src.DestinationCIDRv6 != nil { + return json.Marshal(&src.DestinationCIDRv6) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RouteDestination) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.DestinationCIDRv4 != nil { + return obj.DestinationCIDRv4 + } + + if obj.DestinationCIDRv6 != nil { + return obj.DestinationCIDRv6 + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj RouteDestination) GetActualInstanceValue() interface{} { + if obj.DestinationCIDRv4 != nil { + return *obj.DestinationCIDRv4 + } + + if obj.DestinationCIDRv6 != nil { + return *obj.DestinationCIDRv6 + } + + // all schemas are nil + return nil +} + +type NullableRouteDestination struct { + value *RouteDestination + isSet bool +} + +func (v NullableRouteDestination) Get() *RouteDestination { + return v.value +} + +func (v *NullableRouteDestination) Set(val *RouteDestination) { + v.value = val + v.isSet = true +} + +func (v NullableRouteDestination) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteDestination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteDestination(val *RouteDestination) *NullableRouteDestination { + return &NullableRouteDestination{value: val, isSet: true} +} + +func (v NullableRouteDestination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteDestination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_route_list_response.go b/services/iaas/v2alpha1api/model_route_list_response.go new file mode 100644 index 000000000..216e401ce --- /dev/null +++ b/services/iaas/v2alpha1api/model_route_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RouteListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RouteListResponse{} + +// RouteListResponse Route list response. +type RouteListResponse struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _RouteListResponse RouteListResponse + +// NewRouteListResponse instantiates a new RouteListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRouteListResponse(items []Route) *RouteListResponse { + this := RouteListResponse{} + this.Items = items + return &this +} + +// NewRouteListResponseWithDefaults instantiates a new RouteListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteListResponseWithDefaults() *RouteListResponse { + this := RouteListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RouteListResponse) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RouteListResponse) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RouteListResponse) SetItems(v []Route) { + o.Items = v +} + +func (o RouteListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RouteListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RouteListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRouteListResponse := _RouteListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRouteListResponse) + + if err != nil { + return err + } + + *o = RouteListResponse(varRouteListResponse) + + return err +} + +type NullableRouteListResponse struct { + value *RouteListResponse + isSet bool +} + +func (v NullableRouteListResponse) Get() *RouteListResponse { + return v.value +} + +func (v *NullableRouteListResponse) Set(val *RouteListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRouteListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteListResponse(val *RouteListResponse) *NullableRouteListResponse { + return &NullableRouteListResponse{value: val, isSet: true} +} + +func (v NullableRouteListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_route_nexthop.go b/services/iaas/v2alpha1api/model_route_nexthop.go new file mode 100644 index 000000000..5dd8f6798 --- /dev/null +++ b/services/iaas/v2alpha1api/model_route_nexthop.go @@ -0,0 +1,218 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" + "fmt" +) + +// RouteNexthop - struct for RouteNexthop +type RouteNexthop struct { + NexthopBlackhole *NexthopBlackhole + NexthopIPv4 *NexthopIPv4 + NexthopIPv6 *NexthopIPv6 + NexthopInternet *NexthopInternet +} + +// NexthopBlackholeAsRouteNexthop is a convenience function that returns NexthopBlackhole wrapped in RouteNexthop +func NexthopBlackholeAsRouteNexthop(v *NexthopBlackhole) RouteNexthop { + return RouteNexthop{ + NexthopBlackhole: v, + } +} + +// NexthopIPv4AsRouteNexthop is a convenience function that returns NexthopIPv4 wrapped in RouteNexthop +func NexthopIPv4AsRouteNexthop(v *NexthopIPv4) RouteNexthop { + return RouteNexthop{ + NexthopIPv4: v, + } +} + +// NexthopIPv6AsRouteNexthop is a convenience function that returns NexthopIPv6 wrapped in RouteNexthop +func NexthopIPv6AsRouteNexthop(v *NexthopIPv6) RouteNexthop { + return RouteNexthop{ + NexthopIPv6: v, + } +} + +// NexthopInternetAsRouteNexthop is a convenience function that returns NexthopInternet wrapped in RouteNexthop +func NexthopInternetAsRouteNexthop(v *NexthopInternet) RouteNexthop { + return RouteNexthop{ + NexthopInternet: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RouteNexthop) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'blackhole' + if jsonDict["type"] == "blackhole" { + // try to unmarshal JSON data into NexthopBlackhole + err = json.Unmarshal(data, &dst.NexthopBlackhole) + if err == nil { + return nil // data stored in dst.NexthopBlackhole, return on the first match + } else { + dst.NexthopBlackhole = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopBlackhole: %s", err.Error()) + } + } + + // check if the discriminator value is 'internet' + if jsonDict["type"] == "internet" { + // try to unmarshal JSON data into NexthopInternet + err = json.Unmarshal(data, &dst.NexthopInternet) + if err == nil { + return nil // data stored in dst.NexthopInternet, return on the first match + } else { + dst.NexthopInternet = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopInternet: %s", err.Error()) + } + } + + // check if the discriminator value is 'ipv4' + if jsonDict["type"] == "ipv4" { + // try to unmarshal JSON data into NexthopIPv4 + err = json.Unmarshal(data, &dst.NexthopIPv4) + if err == nil { + return nil // data stored in dst.NexthopIPv4, return on the first match + } else { + dst.NexthopIPv4 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'ipv6' + if jsonDict["type"] == "ipv6" { + // try to unmarshal JSON data into NexthopIPv6 + err = json.Unmarshal(data, &dst.NexthopIPv6) + if err == nil { + return nil // data stored in dst.NexthopIPv6, return on the first match + } else { + dst.NexthopIPv6 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv6: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RouteNexthop) MarshalJSON() ([]byte, error) { + if src.NexthopBlackhole != nil { + return json.Marshal(&src.NexthopBlackhole) + } + + if src.NexthopIPv4 != nil { + return json.Marshal(&src.NexthopIPv4) + } + + if src.NexthopIPv6 != nil { + return json.Marshal(&src.NexthopIPv6) + } + + if src.NexthopInternet != nil { + return json.Marshal(&src.NexthopInternet) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RouteNexthop) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.NexthopBlackhole != nil { + return obj.NexthopBlackhole + } + + if obj.NexthopIPv4 != nil { + return obj.NexthopIPv4 + } + + if obj.NexthopIPv6 != nil { + return obj.NexthopIPv6 + } + + if obj.NexthopInternet != nil { + return obj.NexthopInternet + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj RouteNexthop) GetActualInstanceValue() interface{} { + if obj.NexthopBlackhole != nil { + return *obj.NexthopBlackhole + } + + if obj.NexthopIPv4 != nil { + return *obj.NexthopIPv4 + } + + if obj.NexthopIPv6 != nil { + return *obj.NexthopIPv6 + } + + if obj.NexthopInternet != nil { + return *obj.NexthopInternet + } + + // all schemas are nil + return nil +} + +type NullableRouteNexthop struct { + value *RouteNexthop + isSet bool +} + +func (v NullableRouteNexthop) Get() *RouteNexthop { + return v.value +} + +func (v *NullableRouteNexthop) Set(val *RouteNexthop) { + v.value = val + v.isSet = true +} + +func (v NullableRouteNexthop) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteNexthop) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteNexthop(val *RouteNexthop) *NullableRouteNexthop { + return &NullableRouteNexthop{value: val, isSet: true} +} + +func (v NullableRouteNexthop) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteNexthop) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_routing_table.go b/services/iaas/v2alpha1api/model_routing_table.go new file mode 100644 index 000000000..34e011c47 --- /dev/null +++ b/services/iaas/v2alpha1api/model_routing_table.go @@ -0,0 +1,463 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the RoutingTable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoutingTable{} + +// RoutingTable An object representing a routing table. +type RoutingTable struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. + Default *bool `json:"default,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _RoutingTable RoutingTable + +// NewRoutingTable instantiates a new RoutingTable object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoutingTable(name string) *RoutingTable { + this := RoutingTable{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + this.Name = name + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// NewRoutingTableWithDefaults instantiates a new RoutingTable object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoutingTableWithDefaults() *RoutingTable { + this := RoutingTable{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *RoutingTable) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *RoutingTable) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *RoutingTable) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *RoutingTable) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *RoutingTable) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *RoutingTable) SetDefault(v bool) { + o.Default = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RoutingTable) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RoutingTable) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RoutingTable) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *RoutingTable) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *RoutingTable) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *RoutingTable) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RoutingTable) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *RoutingTable) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RoutingTable) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *RoutingTable) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *RoutingTable) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *RoutingTable) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *RoutingTable) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RoutingTable) SetName(v string) { + o.Name = v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *RoutingTable) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *RoutingTable) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *RoutingTable) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *RoutingTable) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *RoutingTable) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *RoutingTable) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o RoutingTable) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoutingTable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *RoutingTable) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoutingTable := _RoutingTable{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoutingTable) + + if err != nil { + return err + } + + *o = RoutingTable(varRoutingTable) + + return err +} + +type NullableRoutingTable struct { + value *RoutingTable + isSet bool +} + +func (v NullableRoutingTable) Get() *RoutingTable { + return v.value +} + +func (v *NullableRoutingTable) Set(val *RoutingTable) { + v.value = val + v.isSet = true +} + +func (v NullableRoutingTable) IsSet() bool { + return v.isSet +} + +func (v *NullableRoutingTable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoutingTable(val *RoutingTable) *NullableRoutingTable { + return &NullableRoutingTable{value: val, isSet: true} +} + +func (v NullableRoutingTable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoutingTable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_routing_table_list_response.go b/services/iaas/v2alpha1api/model_routing_table_list_response.go new file mode 100644 index 000000000..9c50017a0 --- /dev/null +++ b/services/iaas/v2alpha1api/model_routing_table_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RoutingTableListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoutingTableListResponse{} + +// RoutingTableListResponse Routing table response. +type RoutingTableListResponse struct { + // A list of routing tables. + Items []RoutingTable `json:"items"` +} + +type _RoutingTableListResponse RoutingTableListResponse + +// NewRoutingTableListResponse instantiates a new RoutingTableListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoutingTableListResponse(items []RoutingTable) *RoutingTableListResponse { + this := RoutingTableListResponse{} + this.Items = items + return &this +} + +// NewRoutingTableListResponseWithDefaults instantiates a new RoutingTableListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoutingTableListResponseWithDefaults() *RoutingTableListResponse { + this := RoutingTableListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RoutingTableListResponse) GetItems() []RoutingTable { + if o == nil { + var ret []RoutingTable + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RoutingTableListResponse) GetItemsOk() ([]RoutingTable, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RoutingTableListResponse) SetItems(v []RoutingTable) { + o.Items = v +} + +func (o RoutingTableListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoutingTableListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RoutingTableListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoutingTableListResponse := _RoutingTableListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoutingTableListResponse) + + if err != nil { + return err + } + + *o = RoutingTableListResponse(varRoutingTableListResponse) + + return err +} + +type NullableRoutingTableListResponse struct { + value *RoutingTableListResponse + isSet bool +} + +func (v NullableRoutingTableListResponse) Get() *RoutingTableListResponse { + return v.value +} + +func (v *NullableRoutingTableListResponse) Set(val *RoutingTableListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRoutingTableListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRoutingTableListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoutingTableListResponse(val *RoutingTableListResponse) *NullableRoutingTableListResponse { + return &NullableRoutingTableListResponse{value: val, isSet: true} +} + +func (v NullableRoutingTableListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoutingTableListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_update_network_ipv4_body.go b/services/iaas/v2alpha1api/model_update_network_ipv4_body.go new file mode 100644 index 000000000..0e196253c --- /dev/null +++ b/services/iaas/v2alpha1api/model_update_network_ipv4_body.go @@ -0,0 +1,174 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkIPv4Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv4Body{} + +// UpdateNetworkIPv4Body The config object for a IPv4 network update. +type UpdateNetworkIPv4Body struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv4Body instantiates a new UpdateNetworkIPv4Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// NewUpdateNetworkIPv4BodyWithDefaults instantiates a new UpdateNetworkIPv4Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv4Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv4Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *UpdateNetworkIPv4Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *UpdateNetworkIPv4Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *UpdateNetworkIPv4Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv4Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv4Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv4Body) SetNameservers(v []string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv4Body struct { + value *UpdateNetworkIPv4Body + isSet bool +} + +func (v NullableUpdateNetworkIPv4Body) Get() *UpdateNetworkIPv4Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv4Body) Set(val *UpdateNetworkIPv4Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv4Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv4Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv4Body(val *UpdateNetworkIPv4Body) *NullableUpdateNetworkIPv4Body { + return &NullableUpdateNetworkIPv4Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv4Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_update_network_ipv6_body.go b/services/iaas/v2alpha1api/model_update_network_ipv6_body.go new file mode 100644 index 000000000..027377902 --- /dev/null +++ b/services/iaas/v2alpha1api/model_update_network_ipv6_body.go @@ -0,0 +1,174 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkIPv6Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv6Body{} + +// UpdateNetworkIPv6Body The config object for a IPv6 network update. +type UpdateNetworkIPv6Body struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv6Body instantiates a new UpdateNetworkIPv6Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkIPv6Body() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// NewUpdateNetworkIPv6BodyWithDefaults instantiates a new UpdateNetworkIPv6Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkIPv6BodyWithDefaults() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv6Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv6Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *UpdateNetworkIPv6Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *UpdateNetworkIPv6Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *UpdateNetworkIPv6Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv6Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv6Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv6Body) SetNameservers(v []string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv6Body struct { + value *UpdateNetworkIPv6Body + isSet bool +} + +func (v NullableUpdateNetworkIPv6Body) Get() *UpdateNetworkIPv6Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv6Body) Set(val *UpdateNetworkIPv6Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv6Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv6Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv6Body(val *UpdateNetworkIPv6Body) *NullableUpdateNetworkIPv6Body { + return &NullableUpdateNetworkIPv6Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv6Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_update_route_of_routing_table_payload.go b/services/iaas/v2alpha1api/model_update_route_of_routing_table_payload.go new file mode 100644 index 000000000..de61ed114 --- /dev/null +++ b/services/iaas/v2alpha1api/model_update_route_of_routing_table_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" +) + +// checks if the UpdateRouteOfRoutingTablePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRouteOfRoutingTablePayload{} + +// UpdateRouteOfRoutingTablePayload Object that represents the request body for a route update. +type UpdateRouteOfRoutingTablePayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewUpdateRouteOfRoutingTablePayload instantiates a new UpdateRouteOfRoutingTablePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRouteOfRoutingTablePayload() *UpdateRouteOfRoutingTablePayload { + this := UpdateRouteOfRoutingTablePayload{} + return &this +} + +// NewUpdateRouteOfRoutingTablePayloadWithDefaults instantiates a new UpdateRouteOfRoutingTablePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRouteOfRoutingTablePayloadWithDefaults() *UpdateRouteOfRoutingTablePayload { + this := UpdateRouteOfRoutingTablePayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateRouteOfRoutingTablePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRouteOfRoutingTablePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateRouteOfRoutingTablePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateRouteOfRoutingTablePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o UpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRouteOfRoutingTablePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableUpdateRouteOfRoutingTablePayload struct { + value *UpdateRouteOfRoutingTablePayload + isSet bool +} + +func (v NullableUpdateRouteOfRoutingTablePayload) Get() *UpdateRouteOfRoutingTablePayload { + return v.value +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) Set(val *UpdateRouteOfRoutingTablePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRouteOfRoutingTablePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRouteOfRoutingTablePayload(val *UpdateRouteOfRoutingTablePayload) *NullableUpdateRouteOfRoutingTablePayload { + return &NullableUpdateRouteOfRoutingTablePayload{value: val, isSet: true} +} + +func (v NullableUpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/model_update_routing_table_of_area_payload.go b/services/iaas/v2alpha1api/model_update_routing_table_of_area_payload.go new file mode 100644 index 000000000..5ce99e3dc --- /dev/null +++ b/services/iaas/v2alpha1api/model_update_routing_table_of_area_payload.go @@ -0,0 +1,274 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "encoding/json" +) + +// checks if the UpdateRoutingTableOfAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRoutingTableOfAreaPayload{} + +// UpdateRoutingTableOfAreaPayload Object that represents the request body for a routing table update. +type UpdateRoutingTableOfAreaPayload struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The update config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The update config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` +} + +// NewUpdateRoutingTableOfAreaPayload instantiates a new UpdateRoutingTableOfAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRoutingTableOfAreaPayload() *UpdateRoutingTableOfAreaPayload { + this := UpdateRoutingTableOfAreaPayload{} + return &this +} + +// NewUpdateRoutingTableOfAreaPayloadWithDefaults instantiates a new UpdateRoutingTableOfAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRoutingTableOfAreaPayloadWithDefaults() *UpdateRoutingTableOfAreaPayload { + this := UpdateRoutingTableOfAreaPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateRoutingTableOfAreaPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *UpdateRoutingTableOfAreaPayload) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateRoutingTableOfAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateRoutingTableOfAreaPayload) SetName(v string) { + o.Name = &v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *UpdateRoutingTableOfAreaPayload) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +func (o UpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRoutingTableOfAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + return toSerialize, nil +} + +type NullableUpdateRoutingTableOfAreaPayload struct { + value *UpdateRoutingTableOfAreaPayload + isSet bool +} + +func (v NullableUpdateRoutingTableOfAreaPayload) Get() *UpdateRoutingTableOfAreaPayload { + return v.value +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) Set(val *UpdateRoutingTableOfAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRoutingTableOfAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRoutingTableOfAreaPayload(val *UpdateRoutingTableOfAreaPayload) *NullableUpdateRoutingTableOfAreaPayload { + return &NullableUpdateRoutingTableOfAreaPayload{value: val, isSet: true} +} + +func (v NullableUpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2alpha1api/response.go b/services/iaas/v2alpha1api/response.go new file mode 100644 index 000000000..457491fdd --- /dev/null +++ b/services/iaas/v2alpha1api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/iaas/v2alpha1api/utils.go b/services/iaas/v2alpha1api/utils.go new file mode 100644 index 000000000..9be25988e --- /dev/null +++ b/services/iaas/v2alpha1api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2alpha1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2alpha1api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/iaas/v2api/api_default.go b/services/iaas/v2api/api_default.go new file mode 100644 index 000000000..dc4f1ae78 --- /dev/null +++ b/services/iaas/v2api/api_default.go @@ -0,0 +1,29300 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + AddNetworkToServer Create and attach a network interface from the specified network. + + Create and attach a network interface from the specified network to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiAddNetworkToServerRequest + */ + AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest + + // AddNetworkToServerExecute executes the request + AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error + + /* + AddNicToServer Attach an existing network interface. + + Attach an existing network interface to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiAddNicToServerRequest + */ + AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest + + // AddNicToServerExecute executes the request + AddNicToServerExecute(r ApiAddNicToServerRequest) error + + /* + AddPublicIpToServer Associate a public IP to the server. + + Associate a public IP to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiAddPublicIpToServerRequest + */ + AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest + + // AddPublicIpToServerExecute executes the request + AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error + + /* + AddRoutesToRoutingTable Create new routes in a routing table. + + Create new routes in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiAddRoutesToRoutingTableRequest + */ + AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest + + // AddRoutesToRoutingTableExecute executes the request + // @return RouteListResponse + AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) + + /* + AddRoutingTableToArea Create new routing table in a network area. + + Create a new routing table in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiAddRoutingTableToAreaRequest + */ + AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest + + // AddRoutingTableToAreaExecute executes the request + // @return RoutingTable + AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) + + /* + AddSecurityGroupToServer Add a server to a security group. + + Add an existing server to an existing security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiAddSecurityGroupToServerRequest + */ + AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest + + // AddSecurityGroupToServerExecute executes the request + AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error + + /* + AddServiceAccountToServer Attach service account to a server. + + Attach an additional service account to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiAddServiceAccountToServerRequest + */ + AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest + + // AddServiceAccountToServerExecute executes the request + // @return ServiceAccountMailListResponse + AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) + + /* + AddVolumeToServer Attach a volume to a server. + + Attach an existing volume to an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiAddVolumeToServerRequest + */ + AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest + + // AddVolumeToServerExecute executes the request + // @return VolumeAttachment + AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) + + /* + CreateAffinityGroup Create a new affinity group in a project. + + Create a new server affinity group in the given project ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateAffinityGroupRequest + */ + CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest + + // CreateAffinityGroupExecute executes the request + // @return AffinityGroup + CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) + + /* + CreateBackup Create new Backup. + + Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return Backup + CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) + + /* + CreateImage Create new Image. + + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateImageRequest + */ + CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest + + // CreateImageExecute executes the request + // @return ImageCreateResponse + CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) + + /* + CreateIsolatedNetwork Create a single isolated network. + + Creates an isolated network which is not connected to other networks in this project. We recommend using this endpoint only if you are fully aware of its purpose and the consequences of its execution. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateIsolatedNetworkRequest + */ + CreateIsolatedNetwork(ctx context.Context, projectId string, region string) ApiCreateIsolatedNetworkRequest + + // CreateIsolatedNetworkExecute executes the request + // @return Network + CreateIsolatedNetworkExecute(r ApiCreateIsolatedNetworkRequest) (*Network, error) + + /* + CreateKeyPair Import a public key. + + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateKeyPairRequest + */ + CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest + + // CreateKeyPairExecute executes the request + // @return Keypair + CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) + + /* + CreateNetwork Create new network. + + Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest + */ + CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest + + // CreateNetworkExecute executes the request + // @return Network + CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) + + /* + CreateNetworkArea Create new network area in an organization. + + Create a new network area in an organization. You can specify `"preview/routingtables"="true"` as a label to enable the preview routing tables feature. This feature cannot be enabled or disabled afterwards. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiCreateNetworkAreaRequest + */ + CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest + + // CreateNetworkAreaExecute executes the request + // @return NetworkArea + CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) + + /* + CreateNetworkAreaRange Create new network range in a network area. + + Create a new network range in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRangeRequest + */ + CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest + + // CreateNetworkAreaRangeExecute executes the request + // @return NetworkRangeListResponse + CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) + + /* + CreateNetworkAreaRegion Configure a region for a network area. + + Configure a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRegionRequest + */ + CreateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRegionRequest + + // CreateNetworkAreaRegionExecute executes the request + // @return RegionalArea + CreateNetworkAreaRegionExecute(r ApiCreateNetworkAreaRegionRequest) (*RegionalArea, error) + + /* + CreateNetworkAreaRoute Create new network routes. + + Create one or several new network routes in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRouteRequest + */ + CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest + + // CreateNetworkAreaRouteExecute executes the request + // @return RouteListResponse + CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) + + /* + CreateNic Create new network interface. + + Create a new network interface in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiCreateNicRequest + */ + CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest + + // CreateNicExecute executes the request + // @return NIC + CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) + + /* + CreatePublicIP Create new public IP. + + Create a new public IP in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreatePublicIPRequest + */ + CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest + + // CreatePublicIPExecute executes the request + // @return PublicIp + CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) + + /* + CreateSecurityGroup Create new security group. + + Create a new security group in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateSecurityGroupRequest + */ + CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest + + // CreateSecurityGroupExecute executes the request + // @return SecurityGroup + CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) + + /* + CreateSecurityGroupRule Create new security group rule. + + Create a new security group rule in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiCreateSecurityGroupRuleRequest + */ + CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest + + // CreateSecurityGroupRuleExecute executes the request + // @return SecurityGroupRule + CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) + + /* + CreateServer Create new server. + + Create a new server in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateServerRequest + */ + CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest + + // CreateServerExecute executes the request + // @return Server + CreateServerExecute(r ApiCreateServerRequest) (*Server, error) + + /* + CreateSnapshot Create new Snapshot. + + Create a new Snapshot from a Volume in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateSnapshotRequest + */ + CreateSnapshot(ctx context.Context, projectId string, region string) ApiCreateSnapshotRequest + + // CreateSnapshotExecute executes the request + // @return Snapshot + CreateSnapshotExecute(r ApiCreateSnapshotRequest) (*Snapshot, error) + + /* + CreateVolume Create new volume. + + Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateVolumeRequest + */ + CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest + + // CreateVolumeExecute executes the request + // @return Volume + CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) + + /* + DeallocateServer Deallocate an existing server. + + Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest + */ + DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest + + // DeallocateServerExecute executes the request + DeallocateServerExecute(r ApiDeallocateServerRequest) error + + /* + DeleteAffinityGroup Delete a affinity group in a project. + + Delete a affinity group in the given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiDeleteAffinityGroupRequest + */ + DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest + + // DeleteAffinityGroupExecute executes the request + DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error + + /* + DeleteBackup Delete a backup. + + Delete a backup that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiDeleteBackupRequest + */ + DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest + + // DeleteBackupExecute executes the request + DeleteBackupExecute(r ApiDeleteBackupRequest) error + + /* + DeleteImage Delete an Image. + + Delete an image that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageRequest + */ + DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest + + // DeleteImageExecute executes the request + DeleteImageExecute(r ApiDeleteImageRequest) error + + /* + DeleteImageShare Remove image share. + + Remove the image share. New scope will be local. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest + */ + DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest + + // DeleteImageShareExecute executes the request + DeleteImageShareExecute(r ApiDeleteImageShareRequest) error + + /* + DeleteImageShareConsumer Remove an image share consumer. + + Remove consumer from a shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiDeleteImageShareConsumerRequest + */ + DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest + + // DeleteImageShareConsumerExecute executes the request + DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error + + /* + DeleteKeyPair Delete an SSH keypair. + + Delete an SSH keypair from a user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest + */ + DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest + + // DeleteKeyPairExecute executes the request + DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error + + /* + DeleteNetwork Delete network. + + Delete a network. If the network is still in use, the deletion will fail. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest + */ + DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest + + // DeleteNetworkExecute executes the request + DeleteNetworkExecute(r ApiDeleteNetworkRequest) error + + /* + DeleteNetworkArea Delete a network area. + + Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiDeleteNetworkAreaRequest + */ + DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest + + // DeleteNetworkAreaExecute executes the request + DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error + + /* + DeleteNetworkAreaRange Delete a network range. + + Delete a network range of a network area. The deletion will fail if the network range is still used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiDeleteNetworkAreaRangeRequest + */ + DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest + + // DeleteNetworkAreaRangeExecute executes the request + DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error + + /* + DeleteNetworkAreaRegion Delete a configuration of region for a network area. + + Delete a current configuration of region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiDeleteNetworkAreaRegionRequest + */ + DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiDeleteNetworkAreaRegionRequest + + // DeleteNetworkAreaRegionExecute executes the request + DeleteNetworkAreaRegionExecute(r ApiDeleteNetworkAreaRegionRequest) error + + /* + DeleteNetworkAreaRoute Delete a network route. + + Delete a network route of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteNetworkAreaRouteRequest + */ + DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest + + // DeleteNetworkAreaRouteExecute executes the request + DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error + + /* + DeleteNic Delete a network interface. + + Delete a network interface that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest + */ + DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest + + // DeleteNicExecute executes the request + DeleteNicExecute(r ApiDeleteNicRequest) error + + /* + DeletePublicIP Delete a public IP. + + Delete a public IP that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest + */ + DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest + + // DeletePublicIPExecute executes the request + DeletePublicIPExecute(r ApiDeletePublicIPRequest) error + + /* + DeleteRouteFromRoutingTable Delete a route in a routing table. + + Delete a route in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest + */ + DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest + + // DeleteRouteFromRoutingTableExecute executes the request + DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error + + /* + DeleteRoutingTableFromArea Delete a routing table. + + Delete a routing table of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest + */ + DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest + + // DeleteRoutingTableFromAreaExecute executes the request + DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error + + /* + DeleteSecurityGroup Delete security group. + + Delete a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest + */ + DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest + + // DeleteSecurityGroupExecute executes the request + DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error + + /* + DeleteSecurityGroupRule Delete security group rule. + + Delete a security group rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest + */ + DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest + + // DeleteSecurityGroupRuleExecute executes the request + DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error + + /* + DeleteServer Delete a server. + + Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest + */ + DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest + + // DeleteServerExecute executes the request + DeleteServerExecute(r ApiDeleteServerRequest) error + + /* + DeleteSnapshot Delete a snapshot. + + Delete a snapshot that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiDeleteSnapshotRequest + */ + DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiDeleteSnapshotRequest + + // DeleteSnapshotExecute executes the request + DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) error + + /* + DeleteVolume Delete a volume. + + Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest + */ + DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest + + // DeleteVolumeExecute executes the request + DeleteVolumeExecute(r ApiDeleteVolumeRequest) error + + /* + GetAffinityGroup Get the affinity group. + + Get the affinity group created in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiGetAffinityGroupRequest + */ + GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest + + // GetAffinityGroupExecute executes the request + // @return AffinityGroup + GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) + + /* + GetAttachedVolume Get Volume Attachment details. + + Get the details of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest + */ + GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest + + // GetAttachedVolumeExecute executes the request + // @return VolumeAttachment + GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) + + /* + GetBackup Get details about a backup. + + Get details about a block device backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiGetBackupRequest + */ + GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return Backup + GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) + + /* + GetImage Get details about an image. + + Get details about a specific Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageRequest + */ + GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest + + // GetImageExecute executes the request + // @return Image + GetImageExecute(r ApiGetImageRequest) (*Image, error) + + /* + GetImageShare Get share details of an image. + + Get share details about an shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest + */ + GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest + + // GetImageShareExecute executes the request + // @return ImageShare + GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) + + /* + GetImageShareConsumer Get image share consumer. + + Get details about an image share consumer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest + */ + GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest + + // GetImageShareConsumerExecute executes the request + // @return ImageShareConsumer + GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) + + /* + GetKeyPair Get SSH keypair details. + + Get details about an SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiGetKeyPairRequest + */ + GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest + + // GetKeyPairExecute executes the request + // @return Keypair + GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) + + /* + GetMachineType Get details about a machine type. + + Get details about a specific machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param machineType STACKIT machine type Name. + @return ApiGetMachineTypeRequest + */ + GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest + + // GetMachineTypeExecute executes the request + // @return MachineType + GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) + + /* + GetNetwork Get network details. + + Get details about a network of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest + */ + GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest + + // GetNetworkExecute executes the request + // @return Network + GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) + + /* + GetNetworkArea Get details about a network area. + + Get details about a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest + */ + GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest + + // GetNetworkAreaExecute executes the request + // @return NetworkArea + GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) + + /* + GetNetworkAreaRange Get details about a network range. + + Get details about a network range in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiGetNetworkAreaRangeRequest + */ + GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest + + // GetNetworkAreaRangeExecute executes the request + // @return NetworkRange + GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) + + /* + GetNetworkAreaRegion Get details about a configured region. + + Get details about a configured region in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiGetNetworkAreaRegionRequest + */ + GetNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiGetNetworkAreaRegionRequest + + // GetNetworkAreaRegionExecute executes the request + // @return RegionalArea + GetNetworkAreaRegionExecute(r ApiGetNetworkAreaRegionRequest) (*RegionalArea, error) + + /* + GetNetworkAreaRoute Get details about a network route. + + Get details about a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetNetworkAreaRouteRequest + */ + GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest + + // GetNetworkAreaRouteExecute executes the request + // @return Route + GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) + + /* + GetNic Get details about a network interface. + + Get details about a network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiGetNicRequest + */ + GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest + + // GetNicExecute executes the request + // @return NIC + GetNicExecute(r ApiGetNicRequest) (*NIC, error) + + /* + GetOrganizationRequest Lookup an organization request ID. + + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest + */ + GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest + + // GetOrganizationRequestExecute executes the request + // @return Request + GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) + + /* + GetProjectDetails Get project details. + + Get details about a STACKIT project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiGetProjectDetailsRequest + */ + GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest + + // GetProjectDetailsExecute executes the request + // @return Project + GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) + + /* + GetProjectNIC Get details about a network interface of a project. + + Get details about a network interface inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param nicId The identifier (ID) of a network interface. + @return ApiGetProjectNICRequest + */ + GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest + + // GetProjectNICExecute executes the request + // @return NIC + GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) + + /* + GetProjectRequest Lookup a project request ID. + + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest + */ + GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest + + // GetProjectRequestExecute executes the request + // @return Request + GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) + + /* + GetPublicIP Get details about a public IP. + + Get details about a public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest + */ + GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest + + // GetPublicIPExecute executes the request + // @return PublicIp + GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) + + /* + GetRouteOfRoutingTable Get details about a route of a routing table. + + Get details about a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetRouteOfRoutingTableRequest + */ + GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest + + // GetRouteOfRoutingTableExecute executes the request + // @return Route + GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) + + /* + GetRoutingTableOfArea Get details about a routing table. + + Get details about a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiGetRoutingTableOfAreaRequest + */ + GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest + + // GetRoutingTableOfAreaExecute executes the request + // @return RoutingTable + GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) + + /* + GetSecurityGroup Get security group details. + + Get details about a security group of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest + */ + GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest + + // GetSecurityGroupExecute executes the request + // @return SecurityGroup + GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) + + /* + GetSecurityGroupRule Get security group rule details. + + Get details about a security group rule of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest + */ + GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest + + // GetSecurityGroupRuleExecute executes the request + // @return SecurityGroupRule + GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) + + /* + GetServer Get server details. + + Get details about a server by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest + */ + GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest + + // GetServerExecute executes the request + // @return Server + GetServerExecute(r ApiGetServerRequest) (*Server, error) + + /* + GetServerConsole Get server console. + + Get a URL for server remote console. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest + */ + GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest + + // GetServerConsoleExecute executes the request + // @return ServerConsoleUrl + GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) + + /* + GetServerLog Get server log. + + Get server console log. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerLogRequest + */ + GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest + + // GetServerLogExecute executes the request + // @return GetServerLog200Response + GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) + + /* + GetSnapshot Get details about a snapshot. + + Get details about a block device snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiGetSnapshotRequest + */ + GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiGetSnapshotRequest + + // GetSnapshotExecute executes the request + // @return Snapshot + GetSnapshotExecute(r ApiGetSnapshotRequest) (*Snapshot, error) + + /* + GetVolume Get details about a volume. + + Get details about a block device volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest + */ + GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest + + // GetVolumeExecute executes the request + // @return Volume + GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) + + /* + GetVolumePerformanceClass Get details about a volume performance class. + + Get details about a specific volume performance class. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest + */ + GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest + + // GetVolumePerformanceClassExecute executes the request + // @return VolumePerformanceClass + GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) + + /* + ImageFromVolume Create an image out of a volume. + + Create an image out a a volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @param region The STACKIT Region of the resources. + @return ApiImageFromVolumeRequest + */ + ImageFromVolume(ctx context.Context, projectId string, volumeId string, region string) ApiImageFromVolumeRequest + + // ImageFromVolumeExecute executes the request + // @return Image + ImageFromVolumeExecute(r ApiImageFromVolumeRequest) (*Image, error) + + /* + ListAffinityGroups Get the affinity groups setup for a project. + + Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListAffinityGroupsRequest + */ + ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest + + // ListAffinityGroupsExecute executes the request + // @return AffinityGroupListResponse + ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) + + /* + ListAttachedVolumes List all volume attachments of a server. + + Get a list of all volume attachments of a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest + */ + ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest + + // ListAttachedVolumesExecute executes the request + // @return VolumeAttachmentListResponse + ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) + + /* + ListAvailabilityZones List all availability zones. + + Get a list of all availability zones. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region The STACKIT Region of the resources. + @return ApiListAvailabilityZonesRequest + */ + ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest + + // ListAvailabilityZonesExecute executes the request + // @return AvailabilityZoneListResponse + ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) + + /* + ListBackups List all backups inside a project. + + Get a list of all backups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return BackupListResponse + ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) + + /* + ListImages List all Images inside a project. + + Get a list of all images inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListImagesRequest + */ + ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest + + // ListImagesExecute executes the request + // @return ImageListResponse + ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) + + /* + ListKeyPairs List all SSH keypairs for the requesting user. + + Get a list of all SSH keypairs assigned to the requesting user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListKeyPairsRequest + */ + ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest + + // ListKeyPairsExecute executes the request + // @return KeyPairListResponse + ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) + + /* + ListMachineTypes List all machine types available for a project. + + Get a list of all machine type available in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListMachineTypesRequest + */ + ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest + + // ListMachineTypesExecute executes the request + // @return MachineTypeListResponse + ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) + + /* + ListNetworkAreaProjects List all projects using a network area. + + Get a list of all projects using a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest + */ + ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest + + // ListNetworkAreaProjectsExecute executes the request + // @return ProjectListResponse + ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) + + /* + ListNetworkAreaRanges List all network ranges in a network area. + + Get a list of all network ranges in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRangesRequest + */ + ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest + + // ListNetworkAreaRangesExecute executes the request + // @return NetworkRangeListResponse + ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) + + /* + ListNetworkAreaRegions List all configured regions in a network area. + + Get a list of all configured regions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRegionsRequest + */ + ListNetworkAreaRegions(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRegionsRequest + + // ListNetworkAreaRegionsExecute executes the request + // @return RegionalAreaListResponse + ListNetworkAreaRegionsExecute(r ApiListNetworkAreaRegionsRequest) (*RegionalAreaListResponse, error) + + /* + ListNetworkAreaRoutes List all network routes in a network area. + + Get a list of all network routes defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRoutesRequest + */ + ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest + + // ListNetworkAreaRoutesExecute executes the request + // @return RouteListResponse + ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) + + /* + ListNetworkAreas List all network areas in an organization. + + Get a list of all visible network areas defined in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiListNetworkAreasRequest + */ + ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest + + // ListNetworkAreasExecute executes the request + // @return NetworkAreaListResponse + ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) + + /* + ListNetworks List all networks inside a project. + + Get a list of all networks inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest + */ + ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest + + // ListNetworksExecute executes the request + // @return NetworkListResponse + ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) + + /* + ListNics List all network interfaces inside a network. + + Get a list of all network interfaces inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListNicsRequest + */ + ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest + + // ListNicsExecute executes the request + // @return NICListResponse + ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) + + /* + ListProjectNICs List all network interfaces inside a project. + + Get a list of all network interfaces inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListProjectNICsRequest + */ + ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest + + // ListProjectNICsExecute executes the request + // @return NICListResponse + ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) + + /* + ListPublicIPRanges List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPublicIPRangesRequest + */ + ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest + + // ListPublicIPRangesExecute executes the request + // @return PublicNetworkListResponse + ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) + + /* + ListPublicIPs List all public IPs inside a project. + + Get a list of all public IPs inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListPublicIPsRequest + */ + ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest + + // ListPublicIPsExecute executes the request + // @return PublicIpListResponse + ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) + + /* + ListQuotas List project quotas. + + List quota limits and usage for project resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListQuotasRequest + */ + ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest + + // ListQuotasExecute executes the request + // @return QuotaListResponse + ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) + + /* + ListRoutesOfRoutingTable List all routes in a routing table. + + Get a list of all routes in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest + */ + ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest + + // ListRoutesOfRoutingTableExecute executes the request + // @return RouteListResponse + ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) + + /* + ListRoutingTablesOfArea List all routing tables in a network area. + + Get a list of all routing tables in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest + */ + ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest + + // ListRoutingTablesOfAreaExecute executes the request + // @return RoutingTableListResponse + ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) + + /* + ListSecurityGroupRules List all rules for a security group. + + Get a list of all rules inside a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiListSecurityGroupRulesRequest + */ + ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest + + // ListSecurityGroupRulesExecute executes the request + // @return SecurityGroupRuleListResponse + ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) + + /* + ListSecurityGroups List all security groups inside a project. + + Get a list of all security groups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListSecurityGroupsRequest + */ + ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest + + // ListSecurityGroupsExecute executes the request + // @return SecurityGroupListResponse + ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) + + /* + ListServerNICs Get all network interfaces. + + Get all network interfaces attached to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerNICsRequest + */ + ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest + + // ListServerNICsExecute executes the request + // @return NICListResponse + ListServerNICsExecute(r ApiListServerNICsRequest) (*NICListResponse, error) + + /* + ListServerServiceAccounts List all service accounts of the Server. + + Get the list of the service accounts of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerServiceAccountsRequest + */ + ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest + + // ListServerServiceAccountsExecute executes the request + // @return ServiceAccountMailListResponse + ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) + + /* + ListServers List all servers inside a project. + + Get a list of all servers inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListServersRequest + */ + ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest + + // ListServersExecute executes the request + // @return ServerListResponse + ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) + + /* + ListSnapshotsInProject List all snapshots inside a project. + + Get a list of all snapshots inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListSnapshotsInProjectRequest + */ + ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiListSnapshotsInProjectRequest + + // ListSnapshotsInProjectExecute executes the request + // @return SnapshotListResponse + ListSnapshotsInProjectExecute(r ApiListSnapshotsInProjectRequest) (*SnapshotListResponse, error) + + /* + ListVolumePerformanceClasses List all volume performance classes available for a project. + + Get a list of all volume performance classes available inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListVolumePerformanceClassesRequest + */ + ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest + + // ListVolumePerformanceClassesExecute executes the request + // @return VolumePerformanceClassListResponse + ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) + + /* + ListVolumes List all volumes inside a project. + + Get a list of all volumes inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListVolumesRequest + */ + ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest + + // ListVolumesExecute executes the request + // @return VolumeListResponse + ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) + + /* + PartialUpdateNetwork Update network settings. + + Update the settings of a network inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest + */ + PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest + + // PartialUpdateNetworkExecute executes the request + PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error + + /* + PartialUpdateNetworkArea Update network area settings. + + Update the settings of a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiPartialUpdateNetworkAreaRequest + */ + PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest + + // PartialUpdateNetworkAreaExecute executes the request + // @return NetworkArea + PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) + + /* + RebootServer Reboot the server. + + Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRebootServerRequest + */ + RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest + + // RebootServerExecute executes the request + RebootServerExecute(r ApiRebootServerRequest) error + + /* + RemoveNetworkFromServer Detach and delete all network interfaces associated with the specified network. + + Detach and delete all network interfaces associated with the specified network from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiRemoveNetworkFromServerRequest + */ + RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest + + // RemoveNetworkFromServerExecute executes the request + RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error + + /* + RemoveNicFromServer Detach a network interface. + + Detach a network interface from a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiRemoveNicFromServerRequest + */ + RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest + + // RemoveNicFromServerExecute executes the request + RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error + + /* + RemovePublicIpFromServer Dissociate a public IP from a server. + + Dissociate a public IP on an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiRemovePublicIpFromServerRequest + */ + RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest + + // RemovePublicIpFromServerExecute executes the request + RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error + + /* + RemoveSecurityGroupFromServer Remove a server from a security group. + + Remove a server from a attached security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiRemoveSecurityGroupFromServerRequest + */ + RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest + + // RemoveSecurityGroupFromServerExecute executes the request + RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error + + /* + RemoveServiceAccountFromServer Detach a service account from a server. + + Detach an additional service account from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiRemoveServiceAccountFromServerRequest + */ + RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest + + // RemoveServiceAccountFromServerExecute executes the request + // @return ServiceAccountMailListResponse + RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) + + /* + RemoveVolumeFromServer Detach a volume from a server. + + Detach an existing volume from an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiRemoveVolumeFromServerRequest + */ + RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest + + // RemoveVolumeFromServerExecute executes the request + RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error + + /* + RescueServer Rescue an existing server. + + Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRescueServerRequest + */ + RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest + + // RescueServerExecute executes the request + RescueServerExecute(r ApiRescueServerRequest) error + + /* + ResizeServer Resize a server. + + Resize the server to the given machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiResizeServerRequest + */ + ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest + + // ResizeServerExecute executes the request + ResizeServerExecute(r ApiResizeServerRequest) error + + /* + ResizeVolume Update the size of a volume. + + Update the size of a block device volume. The new volume size must be larger than the current size. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiResizeVolumeRequest + */ + ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest + + // ResizeVolumeExecute executes the request + ResizeVolumeExecute(r ApiResizeVolumeRequest) error + + /* + RestoreBackup Restore Backup to the referenced source Volume. + + Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiRestoreBackupRequest + */ + RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest + + // RestoreBackupExecute executes the request + RestoreBackupExecute(r ApiRestoreBackupRequest) error + + /* + SetImageShare Set image share. + + Set share of an Image. New Options will replace existing settings. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiSetImageShareRequest + */ + SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest + + // SetImageShareExecute executes the request + // @return ImageShare + SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) + + /* + StartServer Boot up a server. + + Start an existing server or allocates the server if deallocated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStartServerRequest + */ + StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest + + // StartServerExecute executes the request + StartServerExecute(r ApiStartServerRequest) error + + /* + StopServer Stop an existing server. + + Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStopServerRequest + */ + StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest + + // StopServerExecute executes the request + StopServerExecute(r ApiStopServerRequest) error + + /* + UnrescueServer Unrescue an existing server. + + Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUnrescueServerRequest + */ + UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest + + // UnrescueServerExecute executes the request + UnrescueServerExecute(r ApiUnrescueServerRequest) error + + /* + UpdateAttachedVolume Update Volume Attachment Parameters. + + Update the properties of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateAttachedVolumeRequest + */ + UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest + + // UpdateAttachedVolumeExecute executes the request + // @return VolumeAttachment + UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) + + /* + UpdateBackup Update information of a backup. + + Update name or labels of the backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiUpdateBackupRequest + */ + UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiUpdateBackupRequest + + // UpdateBackupExecute executes the request + // @return Backup + UpdateBackupExecute(r ApiUpdateBackupRequest) (*Backup, error) + + /* + UpdateImage Update Image Parameters. + + Update the properties of an existing Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageRequest + */ + UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest + + // UpdateImageExecute executes the request + // @return Image + UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) + + /* + UpdateImageShare Update image share. + + Update share of an Image. Projects will be appended to existing list. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageShareRequest + */ + UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest + + // UpdateImageShareExecute executes the request + // @return ImageShare + UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) + + /* + UpdateKeyPair Update information of an SSH keypair. + + Update labels of the SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiUpdateKeyPairRequest + */ + UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest + + // UpdateKeyPairExecute executes the request + // @return Keypair + UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) + + /* + UpdateNetworkAreaRegion Update a region for a network area. + + Update a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiUpdateNetworkAreaRegionRequest + */ + UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiUpdateNetworkAreaRegionRequest + + // UpdateNetworkAreaRegionExecute executes the request + // @return RegionalArea + UpdateNetworkAreaRegionExecute(r ApiUpdateNetworkAreaRegionRequest) (*RegionalArea, error) + + /* + UpdateNetworkAreaRoute Update a network route. + + Update a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateNetworkAreaRouteRequest + */ + UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiUpdateNetworkAreaRouteRequest + + // UpdateNetworkAreaRouteExecute executes the request + // @return Route + UpdateNetworkAreaRouteExecute(r ApiUpdateNetworkAreaRouteRequest) (*Route, error) + + /* + UpdateNic Update a network interface. + + Update the properties of an existing network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiUpdateNicRequest + */ + UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest + + // UpdateNicExecute executes the request + // @return NIC + UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) + + /* + UpdatePublicIP Update a public IP. + + Update the properties of an existing public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiUpdatePublicIPRequest + */ + UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest + + // UpdatePublicIPExecute executes the request + // @return PublicIp + UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) + + /* + UpdateRouteOfRoutingTable Update a route of a routing table. + + Update a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest + */ + UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest + + // UpdateRouteOfRoutingTableExecute executes the request + // @return Route + UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) + + /* + UpdateRoutingTableOfArea Update a routing table. + + Update a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest + */ + UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest + + // UpdateRoutingTableOfAreaExecute executes the request + // @return RoutingTable + UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) + + /* + UpdateSecurityGroup Update information of a security group. + + Update labels of the security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiUpdateSecurityGroupRequest + */ + UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiUpdateSecurityGroupRequest + + // UpdateSecurityGroupExecute executes the request + // @return SecurityGroup + UpdateSecurityGroupExecute(r ApiUpdateSecurityGroupRequest) (*SecurityGroup, error) + + /* + UpdateServer Update information of a server. + + Update name or labels of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUpdateServerRequest + */ + UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest + + // UpdateServerExecute executes the request + // @return Server + UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) + + /* + UpdateSnapshot Update information of the snapshot. + + Update information like name or labels of the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiUpdateSnapshotRequest + */ + UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiUpdateSnapshotRequest + + // UpdateSnapshotExecute executes the request + // @return Snapshot + UpdateSnapshotExecute(r ApiUpdateSnapshotRequest) (*Snapshot, error) + + /* + UpdateVolume Update information of a volume. + + Update name, description or labels of the volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateVolumeRequest + */ + UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest + + // UpdateVolumeExecute executes the request + // @return Volume + UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiAddNetworkToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + networkId string +} + +func (r ApiAddNetworkToServerRequest) Execute() error { + return r.ApiService.AddNetworkToServerExecute(r) +} + +/* +AddNetworkToServer Create and attach a network interface from the specified network. + +Create and attach a network interface from the specified network to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiAddNetworkToServerRequest +*/ +func (a *DefaultAPIService) AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest { + return ApiAddNetworkToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddNetworkToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddNicToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + nicId string +} + +func (r ApiAddNicToServerRequest) Execute() error { + return r.ApiService.AddNicToServerExecute(r) +} + +/* +AddNicToServer Attach an existing network interface. + +Attach an existing network interface to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiAddNicToServerRequest +*/ +func (a *DefaultAPIService) AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest { + return ApiAddNicToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + nicId: nicId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) AddNicToServerExecute(r ApiAddNicToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddNicToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddPublicIpToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + publicIpId string +} + +func (r ApiAddPublicIpToServerRequest) Execute() error { + return r.ApiService.AddPublicIpToServerExecute(r) +} + +/* +AddPublicIpToServer Associate a public IP to the server. + +Associate a public IP to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiAddPublicIpToServerRequest +*/ +func (a *DefaultAPIService) AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest { + return ApiAddPublicIpToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddPublicIpToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddRoutesToRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + addRoutesToRoutingTablePayload *AddRoutesToRoutingTablePayload +} + +// Request an addition of routes to a routing table. +func (r ApiAddRoutesToRoutingTableRequest) AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest { + r.addRoutesToRoutingTablePayload = &addRoutesToRoutingTablePayload + return r +} + +func (r ApiAddRoutesToRoutingTableRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.AddRoutesToRoutingTableExecute(r) +} + +/* +AddRoutesToRoutingTable Create new routes in a routing table. + +Create new routes in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiAddRoutesToRoutingTableRequest +*/ +func (a *DefaultAPIService) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { + return ApiAddRoutesToRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddRoutesToRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if r.addRoutesToRoutingTablePayload == nil { + return localVarReturnValue, reportError("addRoutesToRoutingTablePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addRoutesToRoutingTablePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiAddRoutingTableToAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + addRoutingTableToAreaPayload *AddRoutingTableToAreaPayload +} + +// Request an addition of a routing table to an area. +func (r ApiAddRoutingTableToAreaRequest) AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest { + r.addRoutingTableToAreaPayload = &addRoutingTableToAreaPayload + return r +} + +func (r ApiAddRoutingTableToAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.AddRoutingTableToAreaExecute(r) +} + +/* +AddRoutingTableToArea Create new routing table in a network area. + +Create a new routing table in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiAddRoutingTableToAreaRequest +*/ +func (a *DefaultAPIService) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { + return ApiAddRoutingTableToAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddRoutingTableToArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.addRoutingTableToAreaPayload == nil { + return localVarReturnValue, reportError("addRoutingTableToAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addRoutingTableToAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiAddSecurityGroupToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + securityGroupId string +} + +func (r ApiAddSecurityGroupToServerRequest) Execute() error { + return r.ApiService.AddSecurityGroupToServerExecute(r) +} + +/* +AddSecurityGroupToServer Add a server to a security group. + +Add an existing server to an existing security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiAddSecurityGroupToServerRequest +*/ +func (a *DefaultAPIService) AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest { + return ApiAddSecurityGroupToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddSecurityGroupToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddServiceAccountToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + serviceAccountMail string +} + +func (r ApiAddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.AddServiceAccountToServerExecute(r) +} + +/* +AddServiceAccountToServer Attach service account to a server. + +Attach an additional service account to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiAddServiceAccountToServerRequest +*/ +func (a *DefaultAPIService) AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest { + return ApiAddServiceAccountToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +func (a *DefaultAPIService) AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddServiceAccountToServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(parameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, reportError("serviceAccountMail must have less than 255 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiAddVolumeToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + volumeId string + addVolumeToServerPayload *AddVolumeToServerPayload +} + +// Request a volume attachment creation. +func (r ApiAddVolumeToServerRequest) AddVolumeToServerPayload(addVolumeToServerPayload AddVolumeToServerPayload) ApiAddVolumeToServerRequest { + r.addVolumeToServerPayload = &addVolumeToServerPayload + return r +} + +func (r ApiAddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.AddVolumeToServerExecute(r) +} + +/* +AddVolumeToServer Attach a volume to a server. + +Attach an existing volume to an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiAddVolumeToServerRequest +*/ +func (a *DefaultAPIService) AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest { + return ApiAddVolumeToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +func (a *DefaultAPIService) AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddVolumeToServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addVolumeToServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createAffinityGroupPayload *CreateAffinityGroupPayload +} + +// Request a affinity group creation. +func (r ApiCreateAffinityGroupRequest) CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest { + r.createAffinityGroupPayload = &createAffinityGroupPayload + return r +} + +func (r ApiCreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { + return r.ApiService.CreateAffinityGroupExecute(r) +} + +/* +CreateAffinityGroup Create a new affinity group in a project. + +Create a new server affinity group in the given project ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateAffinityGroupRequest +*/ +func (a *DefaultAPIService) CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest { + return ApiCreateAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return AffinityGroup +func (a *DefaultAPIService) CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateAffinityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/affinity-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createAffinityGroupPayload == nil { + return localVarReturnValue, reportError("createAffinityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAffinityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createBackupPayload *CreateBackupPayload +} + +// Request a backup creation. +func (r ApiCreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { + r.createBackupPayload = &createBackupPayload + return r +} + +func (r ApiCreateBackupRequest) Execute() (*Backup, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup Create new Backup. + +Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Backup +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createBackupPayload == nil { + return localVarReturnValue, reportError("createBackupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createImagePayload *CreateImagePayload +} + +// Request an image creation. +func (r ApiCreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { + r.createImagePayload = &createImagePayload + return r +} + +func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { + return r.ApiService.CreateImageExecute(r) +} + +/* +CreateImage Create new Image. + +Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateImageRequest +*/ +func (a *DefaultAPIService) CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest { + return ApiCreateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ImageCreateResponse +func (a *DefaultAPIService) CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageCreateResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createImagePayload == nil { + return localVarReturnValue, reportError("createImagePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createImagePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateIsolatedNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createIsolatedNetworkPayload *CreateIsolatedNetworkPayload +} + +// Request a single isolated network creation. +func (r ApiCreateIsolatedNetworkRequest) CreateIsolatedNetworkPayload(createIsolatedNetworkPayload CreateIsolatedNetworkPayload) ApiCreateIsolatedNetworkRequest { + r.createIsolatedNetworkPayload = &createIsolatedNetworkPayload + return r +} + +func (r ApiCreateIsolatedNetworkRequest) Execute() (*Network, error) { + return r.ApiService.CreateIsolatedNetworkExecute(r) +} + +/* +CreateIsolatedNetwork Create a single isolated network. + +Creates an isolated network which is not connected to other networks in this project. We recommend using this endpoint only if you are fully aware of its purpose and the consequences of its execution. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateIsolatedNetworkRequest +*/ +func (a *DefaultAPIService) CreateIsolatedNetwork(ctx context.Context, projectId string, region string) ApiCreateIsolatedNetworkRequest { + return ApiCreateIsolatedNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Network +func (a *DefaultAPIService) CreateIsolatedNetworkExecute(r ApiCreateIsolatedNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateIsolatedNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/isolated-network" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createIsolatedNetworkPayload == nil { + return localVarReturnValue, reportError("createIsolatedNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createIsolatedNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + createKeyPairPayload *CreateKeyPairPayload +} + +// Request a public key import. +func (r ApiCreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { + r.createKeyPairPayload = &createKeyPairPayload + return r +} + +func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.CreateKeyPairExecute(r) +} + +/* +CreateKeyPair Import a public key. + +Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateKeyPairRequest +*/ +func (a *DefaultAPIService) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return ApiCreateKeyPairRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Keypair +func (a *DefaultAPIService) CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/keypairs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createKeyPairPayload == nil { + return localVarReturnValue, reportError("createKeyPairPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createKeyPairPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createNetworkPayload *CreateNetworkPayload +} + +// Request a network creation. +func (r ApiCreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { + r.createNetworkPayload = &createNetworkPayload + return r +} + +func (r ApiCreateNetworkRequest) Execute() (*Network, error) { + return r.ApiService.CreateNetworkExecute(r) +} + +/* +CreateNetwork Create new network. + +Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest +*/ +func (a *DefaultAPIService) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Network +func (a *DefaultAPIService) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createNetworkPayload == nil { + return localVarReturnValue, reportError("createNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + createNetworkAreaPayload *CreateNetworkAreaPayload +} + +// Request an Area creation. +func (r ApiCreateNetworkAreaRequest) CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest { + r.createNetworkAreaPayload = &createNetworkAreaPayload + return r +} + +func (r ApiCreateNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.CreateNetworkAreaExecute(r) +} + +/* +CreateNetworkArea Create new network area in an organization. + +Create a new network area in an organization. You can specify `"preview/routingtables"="true"` as a label to enable the preview routing tables feature. This feature cannot be enabled or disabled afterwards. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiCreateNetworkAreaRequest +*/ +func (a *DefaultAPIService) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { + return ApiCreateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Execute executes the request +// +// @return NetworkArea +func (a *DefaultAPIService) CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if r.createNetworkAreaPayload == nil { + return localVarReturnValue, reportError("createNetworkAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + createNetworkAreaRangePayload *CreateNetworkAreaRangePayload +} + +// Request an addition of network ranges to an area. +func (r ApiCreateNetworkAreaRangeRequest) CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest { + r.createNetworkAreaRangePayload = &createNetworkAreaRangePayload + return r +} + +func (r ApiCreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, error) { + return r.ApiService.CreateNetworkAreaRangeExecute(r) +} + +/* +CreateNetworkAreaRange Create new network range in a network area. + +Create a new network range in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRangeRequest +*/ +func (a *DefaultAPIService) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest { + return ApiCreateNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return NetworkRangeListResponse +func (a *DefaultAPIService) CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRangeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkAreaRange") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.createNetworkAreaRangePayload == nil { + return localVarReturnValue, reportError("createNetworkAreaRangePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaRangePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRegionRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + createNetworkAreaRegionPayload *CreateNetworkAreaRegionPayload +} + +// Request to add a new regional network area configuration. +func (r ApiCreateNetworkAreaRegionRequest) CreateNetworkAreaRegionPayload(createNetworkAreaRegionPayload CreateNetworkAreaRegionPayload) ApiCreateNetworkAreaRegionRequest { + r.createNetworkAreaRegionPayload = &createNetworkAreaRegionPayload + return r +} + +func (r ApiCreateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { + return r.ApiService.CreateNetworkAreaRegionExecute(r) +} + +/* +CreateNetworkAreaRegion Configure a region for a network area. + +Configure a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRegionRequest +*/ +func (a *DefaultAPIService) CreateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRegionRequest { + return ApiCreateNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RegionalArea +func (a *DefaultAPIService) CreateNetworkAreaRegionExecute(r ApiCreateNetworkAreaRegionRequest) (*RegionalArea, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegionalArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkAreaRegion") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.createNetworkAreaRegionPayload == nil { + return localVarReturnValue, reportError("createNetworkAreaRegionPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaRegionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + createNetworkAreaRoutePayload *CreateNetworkAreaRoutePayload +} + +// Request an addition of routes to an area. +func (r ApiCreateNetworkAreaRouteRequest) CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest { + r.createNetworkAreaRoutePayload = &createNetworkAreaRoutePayload + return r +} + +func (r ApiCreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.CreateNetworkAreaRouteExecute(r) +} + +/* +CreateNetworkAreaRoute Create new network routes. + +Create one or several new network routes in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRouteRequest +*/ +func (a *DefaultAPIService) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest { + return ApiCreateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.createNetworkAreaRoutePayload == nil { + return localVarReturnValue, reportError("createNetworkAreaRoutePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaRoutePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + createNicPayload *CreateNicPayload +} + +// Request a network interface creation. +func (r ApiCreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { + r.createNicPayload = &createNicPayload + return r +} + +func (r ApiCreateNicRequest) Execute() (*NIC, error) { + return r.ApiService.CreateNicExecute(r) +} + +/* +CreateNic Create new network interface. + +Create a new network interface in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiCreateNicRequest +*/ +func (a *DefaultAPIService) CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest { + return ApiCreateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return NIC +func (a *DefaultAPIService) CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if r.createNicPayload == nil { + return localVarReturnValue, reportError("createNicPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNicPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreatePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createPublicIPPayload *CreatePublicIPPayload +} + +// Request a public IP creation. +func (r ApiCreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { + r.createPublicIPPayload = &createPublicIPPayload + return r +} + +func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.CreatePublicIPExecute(r) +} + +/* +CreatePublicIP Create new public IP. + +Create a new public IP in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreatePublicIPRequest +*/ +func (a *DefaultAPIService) CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest { + return ApiCreatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return PublicIp +func (a *DefaultAPIService) CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreatePublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createPublicIPPayload == nil { + return localVarReturnValue, reportError("createPublicIPPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createPublicIPPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createSecurityGroupPayload *CreateSecurityGroupPayload +} + +// Request a security group creation. +func (r ApiCreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { + r.createSecurityGroupPayload = &createSecurityGroupPayload + return r +} + +func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.CreateSecurityGroupExecute(r) +} + +/* +CreateSecurityGroup Create new security group. + +Create a new security group in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateSecurityGroupRequest +*/ +func (a *DefaultAPIService) CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest { + return ApiCreateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return SecurityGroup +func (a *DefaultAPIService) CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createSecurityGroupPayload == nil { + return localVarReturnValue, reportError("createSecurityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSecurityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string + createSecurityGroupRulePayload *CreateSecurityGroupRulePayload +} + +// Request for a security group rule creation. +func (r ApiCreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { + r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload + return r +} + +func (r ApiCreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { + return r.ApiService.CreateSecurityGroupRuleExecute(r) +} + +/* +CreateSecurityGroupRule Create new security group rule. + +Create a new security group rule in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiCreateSecurityGroupRuleRequest +*/ +func (a *DefaultAPIService) CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { + return ApiCreateSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRule +func (a *DefaultAPIService) CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateSecurityGroupRule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if r.createSecurityGroupRulePayload == nil { + return localVarReturnValue, reportError("createSecurityGroupRulePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSecurityGroupRulePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createServerPayload *CreateServerPayload +} + +// Request a server creation. +func (r ApiCreateServerRequest) CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest { + r.createServerPayload = &createServerPayload + return r +} + +func (r ApiCreateServerRequest) Execute() (*Server, error) { + return r.ApiService.CreateServerExecute(r) +} + +/* +CreateServer Create new server. + +Create a new server in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateServerRequest +*/ +func (a *DefaultAPIService) CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest { + return ApiCreateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Server +func (a *DefaultAPIService) CreateServerExecute(r ApiCreateServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createServerPayload == nil { + return localVarReturnValue, reportError("createServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createSnapshotPayload *CreateSnapshotPayload +} + +// Request a snapshot creation. +func (r ApiCreateSnapshotRequest) CreateSnapshotPayload(createSnapshotPayload CreateSnapshotPayload) ApiCreateSnapshotRequest { + r.createSnapshotPayload = &createSnapshotPayload + return r +} + +func (r ApiCreateSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.CreateSnapshotExecute(r) +} + +/* +CreateSnapshot Create new Snapshot. + +Create a new Snapshot from a Volume in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateSnapshotRequest +*/ +func (a *DefaultAPIService) CreateSnapshot(ctx context.Context, projectId string, region string) ApiCreateSnapshotRequest { + return ApiCreateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Snapshot +func (a *DefaultAPIService) CreateSnapshotExecute(r ApiCreateSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createSnapshotPayload == nil { + return localVarReturnValue, reportError("createSnapshotPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSnapshotPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createVolumePayload *CreateVolumePayload +} + +// Request a volume creation. +func (r ApiCreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { + r.createVolumePayload = &createVolumePayload + return r +} + +func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.CreateVolumeExecute(r) +} + +/* +CreateVolume Create new volume. + +Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateVolumeRequest +*/ +func (a *DefaultAPIService) CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest { + return ApiCreateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Volume +func (a *DefaultAPIService) CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createVolumePayload == nil { + return localVarReturnValue, reportError("createVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeallocateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiDeallocateServerRequest) Execute() error { + return r.ApiService.DeallocateServerExecute(r) +} + +/* +DeallocateServer Deallocate an existing server. + +Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest +*/ +func (a *DefaultAPIService) DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest { + return ApiDeallocateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeallocateServerExecute(r ApiDeallocateServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeallocateServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/deallocate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + affinityGroupId string +} + +func (r ApiDeleteAffinityGroupRequest) Execute() error { + return r.ApiService.DeleteAffinityGroupExecute(r) +} + +/* +DeleteAffinityGroup Delete a affinity group in a project. + +Delete a affinity group in the given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiDeleteAffinityGroupRequest +*/ +func (a *DefaultAPIService) DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest { + return ApiDeleteAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteAffinityGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(parameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.affinityGroupId) < 36 { + return reportError("affinityGroupId must have at least 36 elements") + } + if strlen(r.affinityGroupId) > 36 { + return reportError("affinityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + backupId string + force *bool +} + +// Force action. +func (r ApiDeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { + r.force = &force + return r +} + +func (r ApiDeleteBackupRequest) Execute() error { + return r.ApiService.DeleteBackupExecute(r) +} + +/* +DeleteBackup Delete a backup. + +Delete a backup that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiDeleteBackupRequest +*/ +func (a *DefaultAPIService) DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return reportError("backupId must have less than 36 elements") + } + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "force", defaultValue, "form", "") + r.force = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string +} + +func (r ApiDeleteImageRequest) Execute() error { + return r.ApiService.DeleteImageExecute(r) +} + +/* +DeleteImage Delete an Image. + +Delete an image that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageRequest +*/ +func (a *DefaultAPIService) DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest { + return ApiDeleteImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteImageExecute(r ApiDeleteImageRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImage") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string +} + +func (r ApiDeleteImageShareRequest) Execute() error { + return r.ApiService.DeleteImageShareExecute(r) +} + +/* +DeleteImageShare Remove image share. + +Remove the image share. New scope will be local. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest +*/ +func (a *DefaultAPIService) DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest { + return ApiDeleteImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteImageShareExecute(r ApiDeleteImageShareRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImageShare") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageShareConsumerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + consumerProjectId string +} + +func (r ApiDeleteImageShareConsumerRequest) Execute() error { + return r.ApiService.DeleteImageShareConsumerExecute(r) +} + +/* +DeleteImageShareConsumer Remove an image share consumer. + +Remove consumer from a shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiDeleteImageShareConsumerRequest +*/ +func (a *DefaultAPIService) DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { + return ApiDeleteImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImageShareConsumer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(parameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + if strlen(r.consumerProjectId) < 36 { + return reportError("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return reportError("consumerProjectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string +} + +func (r ApiDeleteKeyPairRequest) Execute() error { + return r.ApiService.DeleteKeyPairExecute(r) +} + +/* +DeleteKeyPair Delete an SSH keypair. + +Delete an SSH keypair from a user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest +*/ +func (a *DefaultAPIService) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteKeyPair") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return reportError("keypairName must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string +} + +func (r ApiDeleteNetworkRequest) Execute() error { + return r.ApiService.DeleteNetworkExecute(r) +} + +/* +DeleteNetwork Delete network. + +Delete a network. If the network is still in use, the deletion will fail. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest +*/ +func (a *DefaultAPIService) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiDeleteNetworkAreaRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaExecute(r) +} + +/* +DeleteNetworkArea Delete a network area. + +Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiDeleteNetworkAreaRequest +*/ +func (a *DefaultAPIService) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { + return ApiDeleteNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkArea") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + networkRangeId string +} + +func (r ApiDeleteNetworkAreaRangeRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaRangeExecute(r) +} + +/* +DeleteNetworkAreaRange Delete a network range. + +Delete a network range of a network area. The deletion will fail if the network range is still used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiDeleteNetworkAreaRangeRequest +*/ +func (a *DefaultAPIService) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { + return ApiDeleteNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkAreaRange") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.networkRangeId) < 36 { + return reportError("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return reportError("networkRangeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRegionRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string +} + +func (r ApiDeleteNetworkAreaRegionRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaRegionExecute(r) +} + +/* +DeleteNetworkAreaRegion Delete a configuration of region for a network area. + +Delete a current configuration of region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiDeleteNetworkAreaRegionRequest +*/ +func (a *DefaultAPIService) DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiDeleteNetworkAreaRegionRequest { + return ApiDeleteNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkAreaRegionExecute(r ApiDeleteNetworkAreaRegionRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkAreaRegion") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routeId string +} + +func (r ApiDeleteNetworkAreaRouteRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaRouteExecute(r) +} + +/* +DeleteNetworkAreaRoute Delete a network route. + +Delete a network route of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteNetworkAreaRouteRequest +*/ +func (a *DefaultAPIService) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest { + return ApiDeleteNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkAreaRoute") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + nicId string +} + +func (r ApiDeleteNicRequest) Execute() error { + return r.ApiService.DeleteNicExecute(r) +} + +/* +DeleteNic Delete a network interface. + +Delete a network interface that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest +*/ +func (a *DefaultAPIService) DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest { + return ApiDeleteNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNicExecute(r ApiDeleteNicRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNic") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeletePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + publicIpId string +} + +func (r ApiDeletePublicIPRequest) Execute() error { + return r.ApiService.DeletePublicIPExecute(r) +} + +/* +DeletePublicIP Delete a public IP. + +Delete a public IP that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest +*/ +func (a *DefaultAPIService) DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest { + return ApiDeletePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeletePublicIPExecute(r ApiDeletePublicIPRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeletePublicIP") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteRouteFromRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string +} + +func (r ApiDeleteRouteFromRoutingTableRequest) Execute() error { + return r.ApiService.DeleteRouteFromRoutingTableExecute(r) +} + +/* +DeleteRouteFromRoutingTable Delete a route in a routing table. + +Delete a route in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest +*/ +func (a *DefaultAPIService) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { + return ApiDeleteRouteFromRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRouteFromRoutingTable") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteRoutingTableFromAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string +} + +func (r ApiDeleteRoutingTableFromAreaRequest) Execute() error { + return r.ApiService.DeleteRoutingTableFromAreaExecute(r) +} + +/* +DeleteRoutingTableFromArea Delete a routing table. + +Delete a routing table of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest +*/ +func (a *DefaultAPIService) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { + return ApiDeleteRoutingTableFromAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRoutingTableFromArea") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return reportError("routingTableId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string +} + +func (r ApiDeleteSecurityGroupRequest) Execute() error { + return r.ApiService.DeleteSecurityGroupExecute(r) +} + +/* +DeleteSecurityGroup Delete security group. + +Delete a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest +*/ +func (a *DefaultAPIService) DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return ApiDeleteSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteSecurityGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string + securityGroupRuleId string +} + +func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { + return r.ApiService.DeleteSecurityGroupRuleExecute(r) +} + +/* +DeleteSecurityGroupRule Delete security group rule. + +Delete a security group rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest +*/ +func (a *DefaultAPIService) DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return ApiDeleteSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteSecurityGroupRule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(parameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return reportError("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return reportError("securityGroupRuleId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiDeleteServerRequest) Execute() error { + return r.ApiService.DeleteServerExecute(r) +} + +/* +DeleteServer Delete a server. + +Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest +*/ +func (a *DefaultAPIService) DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteServerExecute(r ApiDeleteServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + snapshotId string +} + +func (r ApiDeleteSnapshotRequest) Execute() error { + return r.ApiService.DeleteSnapshotExecute(r) +} + +/* +DeleteSnapshot Delete a snapshot. + +Delete a snapshot that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiDeleteSnapshotRequest +*/ +func (a *DefaultAPIService) DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiDeleteSnapshotRequest { + return ApiDeleteSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteSnapshot") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return reportError("snapshotId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumeId string +} + +func (r ApiDeleteVolumeRequest) Execute() error { + return r.ApiService.DeleteVolumeExecute(r) +} + +/* +DeleteVolume Delete a volume. + +Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest +*/ +func (a *DefaultAPIService) DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest { + return ApiDeleteVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteVolumeExecute(r ApiDeleteVolumeRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiGetAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + affinityGroupId string +} + +func (r ApiGetAffinityGroupRequest) Execute() (*AffinityGroup, error) { + return r.ApiService.GetAffinityGroupExecute(r) +} + +/* +GetAffinityGroup Get the affinity group. + +Get the affinity group created in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiGetAffinityGroupRequest +*/ +func (a *DefaultAPIService) GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest { + return ApiGetAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +// Execute executes the request +// +// @return AffinityGroup +func (a *DefaultAPIService) GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAffinityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(parameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.affinityGroupId) < 36 { + return localVarReturnValue, reportError("affinityGroupId must have at least 36 elements") + } + if strlen(r.affinityGroupId) > 36 { + return localVarReturnValue, reportError("affinityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetAttachedVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + volumeId string +} + +func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.GetAttachedVolumeExecute(r) +} + +/* +GetAttachedVolume Get Volume Attachment details. + +Get the details of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest +*/ +func (a *DefaultAPIService) GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return ApiGetAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +func (a *DefaultAPIService) GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*Backup, error) { + return r.ApiService.GetBackupExecute(r) +} + +/* +GetBackup Get details about a backup. + +Get details about a block device backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiGetBackupRequest +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return Backup +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return localVarReturnValue, reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return localVarReturnValue, reportError("backupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string +} + +func (r ApiGetImageRequest) Execute() (*Image, error) { + return r.ApiService.GetImageExecute(r) +} + +/* +GetImage Get details about an image. + +Get details about a specific Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageRequest +*/ +func (a *DefaultAPIService) GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest { + return ApiGetImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return Image +func (a *DefaultAPIService) GetImageExecute(r ApiGetImageRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string +} + +func (r ApiGetImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.GetImageShareExecute(r) +} + +/* +GetImageShare Get share details of an image. + +Get share details about an shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest +*/ +func (a *DefaultAPIService) GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest { + return ApiGetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +func (a *DefaultAPIService) GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageShareConsumerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + consumerProjectId string +} + +func (r ApiGetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { + return r.ApiService.GetImageShareConsumerExecute(r) +} + +/* +GetImageShareConsumer Get image share consumer. + +Get details about an image share consumer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest +*/ +func (a *DefaultAPIService) GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { + return ApiGetImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// Execute executes the request +// +// @return ImageShareConsumer +func (a *DefaultAPIService) GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShareConsumer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImageShareConsumer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(parameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if strlen(r.consumerProjectId) < 36 { + return localVarReturnValue, reportError("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return localVarReturnValue, reportError("consumerProjectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string +} + +func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.GetKeyPairExecute(r) +} + +/* +GetKeyPair Get SSH keypair details. + +Get details about an SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiGetKeyPairRequest +*/ +func (a *DefaultAPIService) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return ApiGetKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +// +// @return Keypair +func (a *DefaultAPIService) GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return localVarReturnValue, reportError("keypairName must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetMachineTypeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + machineType string +} + +func (r ApiGetMachineTypeRequest) Execute() (*MachineType, error) { + return r.ApiService.GetMachineTypeExecute(r) +} + +/* +GetMachineType Get details about a machine type. + +Get details about a specific machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param machineType STACKIT machine type Name. + @return ApiGetMachineTypeRequest +*/ +func (a *DefaultAPIService) GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest { + return ApiGetMachineTypeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + machineType: machineType, + } +} + +// Execute executes the request +// +// @return MachineType +func (a *DefaultAPIService) GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MachineType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMachineType") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/machine-types/{machineType}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"machineType"+"}", url.PathEscape(parameterValueToString(r.machineType, "machineType")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.machineType) > 127 { + return localVarReturnValue, reportError("machineType must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string +} + +func (r ApiGetNetworkRequest) Execute() (*Network, error) { + return r.ApiService.GetNetworkExecute(r) +} + +/* +GetNetwork Get network details. + +Get details about a network of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest +*/ +func (a *DefaultAPIService) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return Network +func (a *DefaultAPIService) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.GetNetworkAreaExecute(r) +} + +/* +GetNetworkArea Get details about a network area. + +Get details about a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest +*/ +func (a *DefaultAPIService) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return ApiGetNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return NetworkArea +func (a *DefaultAPIService) GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + networkRangeId string +} + +func (r ApiGetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { + return r.ApiService.GetNetworkAreaRangeExecute(r) +} + +/* +GetNetworkAreaRange Get details about a network range. + +Get details about a network range in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiGetNetworkAreaRangeRequest +*/ +func (a *DefaultAPIService) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest { + return ApiGetNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, + } +} + +// Execute executes the request +// +// @return NetworkRange +func (a *DefaultAPIService) GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkAreaRange") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.networkRangeId) < 36 { + return localVarReturnValue, reportError("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return localVarReturnValue, reportError("networkRangeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRegionRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string +} + +func (r ApiGetNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { + return r.ApiService.GetNetworkAreaRegionExecute(r) +} + +/* +GetNetworkAreaRegion Get details about a configured region. + +Get details about a configured region in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiGetNetworkAreaRegionRequest +*/ +func (a *DefaultAPIService) GetNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiGetNetworkAreaRegionRequest { + return ApiGetNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RegionalArea +func (a *DefaultAPIService) GetNetworkAreaRegionExecute(r ApiGetNetworkAreaRegionRequest) (*RegionalArea, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegionalArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkAreaRegion") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routeId string +} + +func (r ApiGetNetworkAreaRouteRequest) Execute() (*Route, error) { + return r.ApiService.GetNetworkAreaRouteExecute(r) +} + +/* +GetNetworkAreaRoute Get details about a network route. + +Get details about a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetNetworkAreaRouteRequest +*/ +func (a *DefaultAPIService) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest { + return ApiGetNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + nicId string +} + +func (r ApiGetNicRequest) Execute() (*NIC, error) { + return r.ApiService.GetNicExecute(r) +} + +/* +GetNic Get details about a network interface. + +Get details about a network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiGetNicRequest +*/ +func (a *DefaultAPIService) GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest { + return ApiGetNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +func (a *DefaultAPIService) GetNicExecute(r ApiGetNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetOrganizationRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + requestId string +} + +func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { + return r.ApiService.GetOrganizationRequestExecute(r) +} + +/* +GetOrganizationRequest Lookup an organization request ID. + +Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest +*/ +func (a *DefaultAPIService) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return ApiGetOrganizationRequestRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, + } +} + +// Execute executes the request +// +// @return Request +func (a *DefaultAPIService) GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Request + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetOrganizationRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.requestId) < 36 { + return localVarReturnValue, reportError("requestId must have at least 36 elements") + } + if strlen(r.requestId) > 36 { + return localVarReturnValue, reportError("requestId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectDetailsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { + return r.ApiService.GetProjectDetailsExecute(r) +} + +/* +GetProjectDetails Get project details. + +Get details about a STACKIT project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiGetProjectDetailsRequest +*/ +func (a *DefaultAPIService) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return ApiGetProjectDetailsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Project +func (a *DefaultAPIService) GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Project + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectDetails") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectNICRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + nicId string +} + +func (r ApiGetProjectNICRequest) Execute() (*NIC, error) { + return r.ApiService.GetProjectNICExecute(r) +} + +/* +GetProjectNIC Get details about a network interface of a project. + +Get details about a network interface inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param nicId The identifier (ID) of a network interface. + @return ApiGetProjectNICRequest +*/ +func (a *DefaultAPIService) GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest { + return ApiGetProjectNICRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +func (a *DefaultAPIService) GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectNIC") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + requestId string +} + +func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { + return r.ApiService.GetProjectRequestExecute(r) +} + +/* +GetProjectRequest Lookup a project request ID. + +Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest +*/ +func (a *DefaultAPIService) GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest { + return ApiGetProjectRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + requestId: requestId, + } +} + +// Execute executes the request +// +// @return Request +func (a *DefaultAPIService) GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Request + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.requestId) < 36 { + return localVarReturnValue, reportError("requestId must have at least 36 elements") + } + if strlen(r.requestId) > 36 { + return localVarReturnValue, reportError("requestId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetPublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + publicIpId string +} + +func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.GetPublicIPExecute(r) +} + +/* +GetPublicIP Get details about a public IP. + +Get details about a public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest +*/ +func (a *DefaultAPIService) GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest { + return ApiGetPublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// +// @return PublicIp +func (a *DefaultAPIService) GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetPublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetRouteOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string +} + +func (r ApiGetRouteOfRoutingTableRequest) Execute() (*Route, error) { + return r.ApiService.GetRouteOfRoutingTableExecute(r) +} + +/* +GetRouteOfRoutingTable Get details about a route of a routing table. + +Get details about a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetRouteOfRoutingTableRequest +*/ +func (a *DefaultAPIService) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { + return ApiGetRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRouteOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetRoutingTableOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string +} + +func (r ApiGetRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.GetRoutingTableOfAreaExecute(r) +} + +/* +GetRoutingTableOfArea Get details about a routing table. + +Get details about a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiGetRoutingTableOfAreaRequest +*/ +func (a *DefaultAPIService) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { + return ApiGetRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRoutingTableOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string +} + +func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.GetSecurityGroupExecute(r) +} + +/* +GetSecurityGroup Get security group details. + +Get details about a security group of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest +*/ +func (a *DefaultAPIService) GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest { + return ApiGetSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroup +func (a *DefaultAPIService) GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string + securityGroupRuleId string +} + +func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { + return r.ApiService.GetSecurityGroupRuleExecute(r) +} + +/* +GetSecurityGroupRule Get security group rule details. + +Get details about a security group rule of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest +*/ +func (a *DefaultAPIService) GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return ApiGetSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRule +func (a *DefaultAPIService) GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSecurityGroupRule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(parameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return localVarReturnValue, reportError("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return localVarReturnValue, reportError("securityGroupRuleId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + details *bool +} + +// Show detailed information about server. +func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { + r.details = &details + return r +} + +func (r ApiGetServerRequest) Execute() (*Server, error) { + return r.ApiService.GetServerExecute(r) +} + +/* +GetServer Get server details. + +Get details about a server by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest +*/ +func (a *DefaultAPIService) GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return Server +func (a *DefaultAPIService) GetServerExecute(r ApiGetServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "details", defaultValue, "form", "") + r.details = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerConsoleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { + return r.ApiService.GetServerConsoleExecute(r) +} + +/* +GetServerConsole Get server console. + +Get a URL for server remote console. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest +*/ +func (a *DefaultAPIService) GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return ServerConsoleUrl +func (a *DefaultAPIService) GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServerConsoleUrl + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServerConsole") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/console" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerLogRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + length *int64 +} + +// Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. +func (r ApiGetServerLogRequest) Length(length int64) ApiGetServerLogRequest { + r.length = &length + return r +} + +func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { + return r.ApiService.GetServerLogExecute(r) +} + +/* +GetServerLog Get server log. + +Get server console log. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerLogRequest +*/ +func (a *DefaultAPIService) GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest { + return ApiGetServerLogRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return GetServerLog200Response +func (a *DefaultAPIService) GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetServerLog200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServerLog") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/log" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + if r.length != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length", r.length, "form", "") + } else { + var defaultValue int64 = 2000 + parameterAddToHeaderOrQuery(localVarQueryParams, "length", defaultValue, "form", "") + r.length = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + snapshotId string +} + +func (r ApiGetSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.GetSnapshotExecute(r) +} + +/* +GetSnapshot Get details about a snapshot. + +Get details about a block device snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiGetSnapshotRequest +*/ +func (a *DefaultAPIService) GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiGetSnapshotRequest { + return ApiGetSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// Execute executes the request +// +// @return Snapshot +func (a *DefaultAPIService) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return localVarReturnValue, reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return localVarReturnValue, reportError("snapshotId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumeId string +} + +func (r ApiGetVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.GetVolumeExecute(r) +} + +/* +GetVolume Get details about a volume. + +Get details about a block device volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest +*/ +func (a *DefaultAPIService) GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest { + return ApiGetVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return Volume +func (a *DefaultAPIService) GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetVolumePerformanceClassRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumePerformanceClass string +} + +func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { + return r.ApiService.GetVolumePerformanceClassExecute(r) +} + +/* +GetVolumePerformanceClass Get details about a volume performance class. + +Get details about a specific volume performance class. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest +*/ +func (a *DefaultAPIService) GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return ApiGetVolumePerformanceClassRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumePerformanceClass: volumePerformanceClass, + } +} + +// Execute executes the request +// +// @return VolumePerformanceClass +func (a *DefaultAPIService) GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumePerformanceClass + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVolumePerformanceClass") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volume-performance-classes/{volumePerformanceClass}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(parameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumePerformanceClass) > 127 { + return localVarReturnValue, reportError("volumePerformanceClass must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiImageFromVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + volumeId string + region string + imageFromVolumePayload *ImageFromVolumePayload +} + +// Create an image from a volume. +func (r ApiImageFromVolumeRequest) ImageFromVolumePayload(imageFromVolumePayload ImageFromVolumePayload) ApiImageFromVolumeRequest { + r.imageFromVolumePayload = &imageFromVolumePayload + return r +} + +func (r ApiImageFromVolumeRequest) Execute() (*Image, error) { + return r.ApiService.ImageFromVolumeExecute(r) +} + +/* +ImageFromVolume Create an image out of a volume. + +Create an image out a a volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param volumeId The identifier (ID) of a STACKIT Volume. + @param region The STACKIT Region of the resources. + @return ApiImageFromVolumeRequest +*/ +func (a *DefaultAPIService) ImageFromVolume(ctx context.Context, projectId string, volumeId string, region string) ApiImageFromVolumeRequest { + return ApiImageFromVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + region: region, + } +} + +// Execute executes the request +// +// @return Image +func (a *DefaultAPIService) ImageFromVolumeExecute(r ApiImageFromVolumeRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ImageFromVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}/upload" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.imageFromVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAffinityGroupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) { + return r.ApiService.ListAffinityGroupsExecute(r) +} + +/* +ListAffinityGroups Get the affinity groups setup for a project. + +Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListAffinityGroupsRequest +*/ +func (a *DefaultAPIService) ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest { + return ApiListAffinityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return AffinityGroupListResponse +func (a *DefaultAPIService) ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAffinityGroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/affinity-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAttachedVolumesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { + return r.ApiService.ListAttachedVolumesExecute(r) +} + +/* +ListAttachedVolumes List all volume attachments of a server. + +Get a list of all volume attachments of a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest +*/ +func (a *DefaultAPIService) ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest { + return ApiListAttachedVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return VolumeAttachmentListResponse +func (a *DefaultAPIService) ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachmentListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAttachedVolumes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAvailabilityZonesRequest struct { + ctx context.Context + ApiService DefaultAPI + region string +} + +func (r ApiListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { + return r.ApiService.ListAvailabilityZonesExecute(r) +} + +/* +ListAvailabilityZones List all availability zones. + +Get a list of all availability zones. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region The STACKIT Region of the resources. + @return ApiListAvailabilityZonesRequest +*/ +func (a *DefaultAPIService) ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest { + return ApiListAvailabilityZonesRequest{ + ApiService: a, + ctx: ctx, + region: region, + } +} + +// Execute executes the request +// +// @return AvailabilityZoneListResponse +func (a *DefaultAPIService) ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AvailabilityZoneListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAvailabilityZones") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/regions/{region}/availability-zones" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListBackupsRequest) LabelSelector(labelSelector string) ApiListBackupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListBackupsRequest) Execute() (*BackupListResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups List all backups inside a project. + +Get a list of all backups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return BackupListResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListImagesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + all *bool + labelSelector *string +} + +// List all Images. +func (r ApiListImagesRequest) All(all bool) ApiListImagesRequest { + r.all = &all + return r +} + +// Filter resources by labels. +func (r ApiListImagesRequest) LabelSelector(labelSelector string) ApiListImagesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListImagesRequest) Execute() (*ImageListResponse, error) { + return r.ApiService.ListImagesExecute(r) +} + +/* +ListImages List all Images inside a project. + +Get a list of all images inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListImagesRequest +*/ +func (a *DefaultAPIService) ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest { + return ApiListImagesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ImageListResponse +func (a *DefaultAPIService) ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListImages") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.all != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "all", r.all, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "all", defaultValue, "form", "") + r.all = &defaultValue + } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListKeyPairsRequest struct { + ctx context.Context + ApiService DefaultAPI + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { + return r.ApiService.ListKeyPairsExecute(r) +} + +/* +ListKeyPairs List all SSH keypairs for the requesting user. + +Get a list of all SSH keypairs assigned to the requesting user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListKeyPairsRequest +*/ +func (a *DefaultAPIService) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ApiListKeyPairsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KeyPairListResponse +func (a *DefaultAPIService) ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyPairListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListKeyPairs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/keypairs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListMachineTypesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + filter *string +} + +// Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. +func (r ApiListMachineTypesRequest) Filter(filter string) ApiListMachineTypesRequest { + r.filter = &filter + return r +} + +func (r ApiListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { + return r.ApiService.ListMachineTypesExecute(r) +} + +/* +ListMachineTypes List all machine types available for a project. + +Get a list of all machine type available in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListMachineTypesRequest +*/ +func (a *DefaultAPIService) ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest { + return ApiListMachineTypesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return MachineTypeListResponse +func (a *DefaultAPIService) ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MachineTypeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListMachineTypes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/machine-types" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaProjectsRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { + return r.ApiService.ListNetworkAreaProjectsExecute(r) +} + +/* +ListNetworkAreaProjects List all projects using a network area. + +Get a list of all projects using a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest +*/ +func (a *DefaultAPIService) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ApiListNetworkAreaProjectsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return ProjectListResponse +func (a *DefaultAPIService) ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProjectListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaProjects") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/projects" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaRangesRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string +} + +func (r ApiListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, error) { + return r.ApiService.ListNetworkAreaRangesExecute(r) +} + +/* +ListNetworkAreaRanges List all network ranges in a network area. + +Get a list of all network ranges in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRangesRequest +*/ +func (a *DefaultAPIService) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest { + return ApiListNetworkAreaRangesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return NetworkRangeListResponse +func (a *DefaultAPIService) ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRangeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaRanges") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaRegionsRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiListNetworkAreaRegionsRequest) Execute() (*RegionalAreaListResponse, error) { + return r.ApiService.ListNetworkAreaRegionsExecute(r) +} + +/* +ListNetworkAreaRegions List all configured regions in a network area. + +Get a list of all configured regions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaRegionsRequest +*/ +func (a *DefaultAPIService) ListNetworkAreaRegions(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRegionsRequest { + return ApiListNetworkAreaRegionsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return RegionalAreaListResponse +func (a *DefaultAPIService) ListNetworkAreaRegionsExecute(r ApiListNetworkAreaRegionsRequest) (*RegionalAreaListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegionalAreaListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaRegions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaRoutesRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworkAreaRoutesRequest) LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.ListNetworkAreaRoutesExecute(r) +} + +/* +ListNetworkAreaRoutes List all network routes in a network area. + +Get a list of all network routes defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRoutesRequest +*/ +func (a *DefaultAPIService) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest { + return ApiListNetworkAreaRoutesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaRoutes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreasRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { + return r.ApiService.ListNetworkAreasExecute(r) +} + +/* +ListNetworkAreas List all network areas in an organization. + +Get a list of all visible network areas defined in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiListNetworkAreasRequest +*/ +func (a *DefaultAPIService) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ApiListNetworkAreasRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Execute executes the request +// +// @return NetworkAreaListResponse +func (a *DefaultAPIService) ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkAreaListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreas") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworksRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { + return r.ApiService.ListNetworksExecute(r) +} + +/* +ListNetworks List all networks inside a project. + +Get a list of all networks inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest +*/ +func (a *DefaultAPIService) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return NetworkListResponse +func (a *DefaultAPIService) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworks") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNicsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNicsRequest) LabelSelector(labelSelector string) ApiListNicsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNicsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListNicsExecute(r) +} + +/* +ListNics List all network interfaces inside a network. + +Get a list of all network interfaces inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListNicsRequest +*/ +func (a *DefaultAPIService) ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest { + return ApiListNicsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return NICListResponse +func (a *DefaultAPIService) ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListProjectNICsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListProjectNICsRequest) LabelSelector(labelSelector string) ApiListProjectNICsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListProjectNICsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListProjectNICsExecute(r) +} + +/* +ListProjectNICs List all network interfaces inside a project. + +Get a list of all network interfaces inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListProjectNICsRequest +*/ +func (a *DefaultAPIService) ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest { + return ApiListProjectNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return NICListResponse +func (a *DefaultAPIService) ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListProjectNICs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListPublicIPRangesRequest struct { + ctx context.Context + ApiService DefaultAPI +} + +func (r ApiListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { + return r.ApiService.ListPublicIPRangesExecute(r) +} + +/* +ListPublicIPRanges List all public IP ranges. + +Get a list of all public IP ranges that STACKIT uses. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPublicIPRangesRequest +*/ +func (a *DefaultAPIService) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ApiListPublicIPRangesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PublicNetworkListResponse +func (a *DefaultAPIService) ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicNetworkListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListPublicIPRanges") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/networks/public-ip-ranges" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListPublicIPsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { + return r.ApiService.ListPublicIPsExecute(r) +} + +/* +ListPublicIPs List all public IPs inside a project. + +Get a list of all public IPs inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListPublicIPsRequest +*/ +func (a *DefaultAPIService) ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest { + return ApiListPublicIPsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return PublicIpListResponse +func (a *DefaultAPIService) ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIpListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListPublicIPs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListQuotasRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListQuotasRequest) Execute() (*QuotaListResponse, error) { + return r.ApiService.ListQuotasExecute(r) +} + +/* +ListQuotas List project quotas. + +List quota limits and usage for project resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListQuotasRequest +*/ +func (a *DefaultAPIService) ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest { + return ApiListQuotasRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return QuotaListResponse +func (a *DefaultAPIService) ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *QuotaListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListQuotas") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/quotas" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRoutesOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListRoutesOfRoutingTableRequest) LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListRoutesOfRoutingTableRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.ListRoutesOfRoutingTableExecute(r) +} + +/* +ListRoutesOfRoutingTable List all routes in a routing table. + +Get a list of all routes in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest +*/ +func (a *DefaultAPIService) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { + return ApiListRoutesOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoutesOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRoutingTablesOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListRoutingTablesOfAreaRequest) LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListRoutingTablesOfAreaRequest) Execute() (*RoutingTableListResponse, error) { + return r.ApiService.ListRoutingTablesOfAreaExecute(r) +} + +/* +ListRoutingTablesOfArea List all routing tables in a network area. + +Get a list of all routing tables in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest +*/ +func (a *DefaultAPIService) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { + return ApiListRoutingTablesOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RoutingTableListResponse +func (a *DefaultAPIService) ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTableListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoutingTablesOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListSecurityGroupRulesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string +} + +func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { + return r.ApiService.ListSecurityGroupRulesExecute(r) +} + +/* +ListSecurityGroupRules List all rules for a security group. + +Get a list of all rules inside a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiListSecurityGroupRulesRequest +*/ +func (a *DefaultAPIService) ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest { + return ApiListSecurityGroupRulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRuleListResponse +func (a *DefaultAPIService) ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRuleListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSecurityGroupRules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListSecurityGroupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { + return r.ApiService.ListSecurityGroupsExecute(r) +} + +/* +ListSecurityGroups List all security groups inside a project. + +Get a list of all security groups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListSecurityGroupsRequest +*/ +func (a *DefaultAPIService) ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest { + return ApiListSecurityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return SecurityGroupListResponse +func (a *DefaultAPIService) ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSecurityGroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServerNICsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiListServerNICsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListServerNICsExecute(r) +} + +/* +ListServerNICs Get all network interfaces. + +Get all network interfaces attached to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerNICsRequest +*/ +func (a *DefaultAPIService) ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest { + return ApiListServerNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return NICListResponse +func (a *DefaultAPIService) ListServerNICsExecute(r ApiListServerNICsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServerNICs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServerServiceAccountsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.ListServerServiceAccountsExecute(r) +} + +/* +ListServerServiceAccounts List all service accounts of the Server. + +Get the list of the service accounts of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerServiceAccountsRequest +*/ +func (a *DefaultAPIService) ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest { + return ApiListServerServiceAccountsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +func (a *DefaultAPIService) ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServerServiceAccounts") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + details *bool + labelSelector *string +} + +// Show detailed information about server. +func (r ApiListServersRequest) Details(details bool) ApiListServersRequest { + r.details = &details + return r +} + +// Filter resources by labels. +func (r ApiListServersRequest) LabelSelector(labelSelector string) ApiListServersRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListServersRequest) Execute() (*ServerListResponse, error) { + return r.ApiService.ListServersExecute(r) +} + +/* +ListServers List all servers inside a project. + +Get a list of all servers inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListServersRequest +*/ +func (a *DefaultAPIService) ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest { + return ApiListServersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ServerListResponse +func (a *DefaultAPIService) ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServerListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "details", defaultValue, "form", "") + r.details = &defaultValue + } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListSnapshotsInProjectRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListSnapshotsInProjectRequest) LabelSelector(labelSelector string) ApiListSnapshotsInProjectRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListSnapshotsInProjectRequest) Execute() (*SnapshotListResponse, error) { + return r.ApiService.ListSnapshotsInProjectExecute(r) +} + +/* +ListSnapshotsInProject List all snapshots inside a project. + +Get a list of all snapshots inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListSnapshotsInProjectRequest +*/ +func (a *DefaultAPIService) ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiListSnapshotsInProjectRequest { + return ApiListSnapshotsInProjectRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return SnapshotListResponse +func (a *DefaultAPIService) ListSnapshotsInProjectExecute(r ApiListSnapshotsInProjectRequest) (*SnapshotListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SnapshotListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSnapshotsInProject") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVolumePerformanceClassesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListVolumePerformanceClassesRequest) LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassListResponse, error) { + return r.ApiService.ListVolumePerformanceClassesExecute(r) +} + +/* +ListVolumePerformanceClasses List all volume performance classes available for a project. + +Get a list of all volume performance classes available inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListVolumePerformanceClassesRequest +*/ +func (a *DefaultAPIService) ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest { + return ApiListVolumePerformanceClassesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return VolumePerformanceClassListResponse +func (a *DefaultAPIService) ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumePerformanceClassListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVolumePerformanceClasses") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volume-performance-classes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVolumesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListVolumesRequest) LabelSelector(labelSelector string) ApiListVolumesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListVolumesRequest) Execute() (*VolumeListResponse, error) { + return r.ApiService.ListVolumesExecute(r) +} + +/* +ListVolumes List all volumes inside a project. + +Get a list of all volumes inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListVolumesRequest +*/ +func (a *DefaultAPIService) ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest { + return ApiListVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return VolumeListResponse +func (a *DefaultAPIService) ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVolumes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + partialUpdateNetworkPayload *PartialUpdateNetworkPayload +} + +// Request an update of a network. +func (r ApiPartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { + r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload + return r +} + +func (r ApiPartialUpdateNetworkRequest) Execute() error { + return r.ApiService.PartialUpdateNetworkExecute(r) +} + +/* +PartialUpdateNetwork Update network settings. + +Update the settings of a network inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest +*/ +func (a *DefaultAPIService) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + if r.partialUpdateNetworkPayload == nil { + return reportError("partialUpdateNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiPartialUpdateNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + partialUpdateNetworkAreaPayload *PartialUpdateNetworkAreaPayload +} + +// Request to update an Area. +func (r ApiPartialUpdateNetworkAreaRequest) PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest { + r.partialUpdateNetworkAreaPayload = &partialUpdateNetworkAreaPayload + return r +} + +func (r ApiPartialUpdateNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.PartialUpdateNetworkAreaExecute(r) +} + +/* +PartialUpdateNetworkArea Update network area settings. + +Update the settings of a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiPartialUpdateNetworkAreaRequest +*/ +func (a *DefaultAPIService) PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest { + return ApiPartialUpdateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return NetworkArea +func (a *DefaultAPIService) PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.partialUpdateNetworkAreaPayload == nil { + return localVarReturnValue, reportError("partialUpdateNetworkAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateNetworkAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiRebootServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + action *string +} + +// Defines if it is a soft or a hard reboot. +func (r ApiRebootServerRequest) Action(action string) ApiRebootServerRequest { + r.action = &action + return r +} + +func (r ApiRebootServerRequest) Execute() error { + return r.ApiService.RebootServerExecute(r) +} + +/* +RebootServer Reboot the server. + +Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRebootServerRequest +*/ +func (a *DefaultAPIService) RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest { + return ApiRebootServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RebootServerExecute(r ApiRebootServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RebootServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/reboot" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "form", "") + } else { + var defaultValue string = "soft" + parameterAddToHeaderOrQuery(localVarQueryParams, "action", defaultValue, "form", "") + r.action = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveNetworkFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + networkId string +} + +func (r ApiRemoveNetworkFromServerRequest) Execute() error { + return r.ApiService.RemoveNetworkFromServerExecute(r) +} + +/* +RemoveNetworkFromServer Detach and delete all network interfaces associated with the specified network. + +Detach and delete all network interfaces associated with the specified network from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiRemoveNetworkFromServerRequest +*/ +func (a *DefaultAPIService) RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { + return ApiRemoveNetworkFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveNetworkFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveNicFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + nicId string +} + +func (r ApiRemoveNicFromServerRequest) Execute() error { + return r.ApiService.RemoveNicFromServerExecute(r) +} + +/* +RemoveNicFromServer Detach a network interface. + +Detach a network interface from a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiRemoveNicFromServerRequest +*/ +func (a *DefaultAPIService) RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest { + return ApiRemoveNicFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + nicId: nicId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveNicFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemovePublicIpFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + publicIpId string +} + +func (r ApiRemovePublicIpFromServerRequest) Execute() error { + return r.ApiService.RemovePublicIpFromServerExecute(r) +} + +/* +RemovePublicIpFromServer Dissociate a public IP from a server. + +Dissociate a public IP on an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiRemovePublicIpFromServerRequest +*/ +func (a *DefaultAPIService) RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { + return ApiRemovePublicIpFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemovePublicIpFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveSecurityGroupFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + securityGroupId string +} + +func (r ApiRemoveSecurityGroupFromServerRequest) Execute() error { + return r.ApiService.RemoveSecurityGroupFromServerExecute(r) +} + +/* +RemoveSecurityGroupFromServer Remove a server from a security group. + +Remove a server from a attached security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiRemoveSecurityGroupFromServerRequest +*/ +func (a *DefaultAPIService) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { + return ApiRemoveSecurityGroupFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveSecurityGroupFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveServiceAccountFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + serviceAccountMail string +} + +func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.RemoveServiceAccountFromServerExecute(r) +} + +/* +RemoveServiceAccountFromServer Detach a service account from a server. + +Detach an additional service account from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiRemoveServiceAccountFromServerRequest +*/ +func (a *DefaultAPIService) RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { + return ApiRemoveServiceAccountFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +func (a *DefaultAPIService) RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveServiceAccountFromServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(parameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, reportError("serviceAccountMail must have less than 255 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiRemoveVolumeFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + volumeId string +} + +func (r ApiRemoveVolumeFromServerRequest) Execute() error { + return r.ApiService.RemoveVolumeFromServerExecute(r) +} + +/* +RemoveVolumeFromServer Detach a volume from a server. + +Detach an existing volume from an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiRemoveVolumeFromServerRequest +*/ +func (a *DefaultAPIService) RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { + return ApiRemoveVolumeFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveVolumeFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRescueServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + rescueServerPayload *RescueServerPayload +} + +// Request a server rescue. +func (r ApiRescueServerRequest) RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest { + r.rescueServerPayload = &rescueServerPayload + return r +} + +func (r ApiRescueServerRequest) Execute() error { + return r.ApiService.RescueServerExecute(r) +} + +/* +RescueServer Rescue an existing server. + +Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRescueServerRequest +*/ +func (a *DefaultAPIService) RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest { + return ApiRescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RescueServerExecute(r ApiRescueServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RescueServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/rescue" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if r.rescueServerPayload == nil { + return reportError("rescueServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rescueServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiResizeServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + resizeServerPayload *ResizeServerPayload +} + +// Request a resize of a server. +func (r ApiResizeServerRequest) ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest { + r.resizeServerPayload = &resizeServerPayload + return r +} + +func (r ApiResizeServerRequest) Execute() error { + return r.ApiService.ResizeServerExecute(r) +} + +/* +ResizeServer Resize a server. + +Resize the server to the given machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiResizeServerRequest +*/ +func (a *DefaultAPIService) ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest { + return ApiResizeServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) ResizeServerExecute(r ApiResizeServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResizeServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/resize" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if r.resizeServerPayload == nil { + return reportError("resizeServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.resizeServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiResizeVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumeId string + resizeVolumePayload *ResizeVolumePayload +} + +// Request a volume resize. +func (r ApiResizeVolumeRequest) ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest { + r.resizeVolumePayload = &resizeVolumePayload + return r +} + +func (r ApiResizeVolumeRequest) Execute() error { + return r.ApiService.ResizeVolumeExecute(r) +} + +/* +ResizeVolume Update the size of a volume. + +Update the size of a block device volume. The new volume size must be larger than the current size. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiResizeVolumeRequest +*/ +func (a *DefaultAPIService) ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest { + return ApiResizeVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) ResizeVolumeExecute(r ApiResizeVolumeRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResizeVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}/resize" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.resizeVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRestoreBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + backupId string +} + +func (r ApiRestoreBackupRequest) Execute() error { + return r.ApiService.RestoreBackupExecute(r) +} + +/* +RestoreBackup Restore Backup to the referenced source Volume. + +Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiRestoreBackupRequest +*/ +func (a *DefaultAPIService) RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return reportError("backupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiSetImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + setImageSharePayload *SetImageSharePayload +} + +// Settings for an Image Share. +func (r ApiSetImageShareRequest) SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest { + r.setImageSharePayload = &setImageSharePayload + return r +} + +func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.SetImageShareExecute(r) +} + +/* +SetImageShare Set image share. + +Set share of an Image. New Options will replace existing settings. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiSetImageShareRequest +*/ +func (a *DefaultAPIService) SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest { + return ApiSetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +func (a *DefaultAPIService) SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.SetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.setImageSharePayload == nil { + return localVarReturnValue, reportError("setImageSharePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setImageSharePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiStartServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiStartServerRequest) Execute() error { + return r.ApiService.StartServerExecute(r) +} + +/* +StartServer Boot up a server. + +Start an existing server or allocates the server if deallocated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStartServerRequest +*/ +func (a *DefaultAPIService) StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest { + return ApiStartServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) StartServerExecute(r ApiStartServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.StartServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/start" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiStopServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiStopServerRequest) Execute() error { + return r.ApiService.StopServerExecute(r) +} + +/* +StopServer Stop an existing server. + +Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStopServerRequest +*/ +func (a *DefaultAPIService) StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest { + return ApiStopServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) StopServerExecute(r ApiStopServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.StopServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/stop" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiUnrescueServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiUnrescueServerRequest) Execute() error { + return r.ApiService.UnrescueServerExecute(r) +} + +/* +UnrescueServer Unrescue an existing server. + +Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUnrescueServerRequest +*/ +func (a *DefaultAPIService) UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest { + return ApiUnrescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UnrescueServerExecute(r ApiUnrescueServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UnrescueServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/unrescue" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiUpdateAttachedVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + volumeId string + updateAttachedVolumePayload *UpdateAttachedVolumePayload +} + +// Request a volume attachment update. +func (r ApiUpdateAttachedVolumeRequest) UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest { + r.updateAttachedVolumePayload = &updateAttachedVolumePayload + return r +} + +func (r ApiUpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.UpdateAttachedVolumeExecute(r) +} + +/* +UpdateAttachedVolume Update Volume Attachment Parameters. + +Update the properties of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateAttachedVolumeRequest +*/ +func (a *DefaultAPIService) UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { + return ApiUpdateAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +func (a *DefaultAPIService) UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + if r.updateAttachedVolumePayload == nil { + return localVarReturnValue, reportError("updateAttachedVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateAttachedVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + backupId string + updateBackupPayload *UpdateBackupPayload +} + +// Request an update of a backup. +func (r ApiUpdateBackupRequest) UpdateBackupPayload(updateBackupPayload UpdateBackupPayload) ApiUpdateBackupRequest { + r.updateBackupPayload = &updateBackupPayload + return r +} + +func (r ApiUpdateBackupRequest) Execute() (*Backup, error) { + return r.ApiService.UpdateBackupExecute(r) +} + +/* +UpdateBackup Update information of a backup. + +Update name or labels of the backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiUpdateBackupRequest +*/ +func (a *DefaultAPIService) UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiUpdateBackupRequest { + return ApiUpdateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return Backup +func (a *DefaultAPIService) UpdateBackupExecute(r ApiUpdateBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return localVarReturnValue, reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return localVarReturnValue, reportError("backupId must have less than 36 elements") + } + if r.updateBackupPayload == nil { + return localVarReturnValue, reportError("updateBackupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + updateImagePayload *UpdateImagePayload +} + +// Request an update of an Image. +func (r ApiUpdateImageRequest) UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest { + r.updateImagePayload = &updateImagePayload + return r +} + +func (r ApiUpdateImageRequest) Execute() (*Image, error) { + return r.ApiService.UpdateImageExecute(r) +} + +/* +UpdateImage Update Image Parameters. + +Update the properties of an existing Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageRequest +*/ +func (a *DefaultAPIService) UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest { + return ApiUpdateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return Image +func (a *DefaultAPIService) UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.updateImagePayload == nil { + return localVarReturnValue, reportError("updateImagePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateImagePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + updateImageSharePayload *UpdateImageSharePayload +} + +// Update an Image Share. +func (r ApiUpdateImageShareRequest) UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest { + r.updateImageSharePayload = &updateImageSharePayload + return r +} + +func (r ApiUpdateImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.UpdateImageShareExecute(r) +} + +/* +UpdateImageShare Update image share. + +Update share of an Image. Projects will be appended to existing list. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageShareRequest +*/ +func (a *DefaultAPIService) UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest { + return ApiUpdateImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +func (a *DefaultAPIService) UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.updateImageSharePayload == nil { + return localVarReturnValue, reportError("updateImageSharePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateImageSharePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string + updateKeyPairPayload *UpdateKeyPairPayload +} + +// Request an update of an SSH keypair. +func (r ApiUpdateKeyPairRequest) UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest { + r.updateKeyPairPayload = &updateKeyPairPayload + return r +} + +func (r ApiUpdateKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.UpdateKeyPairExecute(r) +} + +/* +UpdateKeyPair Update information of an SSH keypair. + +Update labels of the SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiUpdateKeyPairRequest +*/ +func (a *DefaultAPIService) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { + return ApiUpdateKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +// +// @return Keypair +func (a *DefaultAPIService) UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return localVarReturnValue, reportError("keypairName must have less than 127 elements") + } + if r.updateKeyPairPayload == nil { + return localVarReturnValue, reportError("updateKeyPairPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateKeyPairPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateNetworkAreaRegionRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + updateNetworkAreaRegionPayload *UpdateNetworkAreaRegionPayload +} + +// Request an update of a regional network area. +func (r ApiUpdateNetworkAreaRegionRequest) UpdateNetworkAreaRegionPayload(updateNetworkAreaRegionPayload UpdateNetworkAreaRegionPayload) ApiUpdateNetworkAreaRegionRequest { + r.updateNetworkAreaRegionPayload = &updateNetworkAreaRegionPayload + return r +} + +func (r ApiUpdateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { + return r.ApiService.UpdateNetworkAreaRegionExecute(r) +} + +/* +UpdateNetworkAreaRegion Update a region for a network area. + +Update a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiUpdateNetworkAreaRegionRequest +*/ +func (a *DefaultAPIService) UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiUpdateNetworkAreaRegionRequest { + return ApiUpdateNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RegionalArea +func (a *DefaultAPIService) UpdateNetworkAreaRegionExecute(r ApiUpdateNetworkAreaRegionRequest) (*RegionalArea, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegionalArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateNetworkAreaRegion") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.updateNetworkAreaRegionPayload == nil { + return localVarReturnValue, reportError("updateNetworkAreaRegionPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateNetworkAreaRegionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routeId string + updateNetworkAreaRoutePayload *UpdateNetworkAreaRoutePayload +} + +// Request an update of a network route. +func (r ApiUpdateNetworkAreaRouteRequest) UpdateNetworkAreaRoutePayload(updateNetworkAreaRoutePayload UpdateNetworkAreaRoutePayload) ApiUpdateNetworkAreaRouteRequest { + r.updateNetworkAreaRoutePayload = &updateNetworkAreaRoutePayload + return r +} + +func (r ApiUpdateNetworkAreaRouteRequest) Execute() (*Route, error) { + return r.ApiService.UpdateNetworkAreaRouteExecute(r) +} + +/* +UpdateNetworkAreaRoute Update a network route. + +Update a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateNetworkAreaRouteRequest +*/ +func (a *DefaultAPIService) UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiUpdateNetworkAreaRouteRequest { + return ApiUpdateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) UpdateNetworkAreaRouteExecute(r ApiUpdateNetworkAreaRouteRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + if r.updateNetworkAreaRoutePayload == nil { + return localVarReturnValue, reportError("updateNetworkAreaRoutePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateNetworkAreaRoutePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + nicId string + updateNicPayload *UpdateNicPayload +} + +// Request an update of a network interface. +func (r ApiUpdateNicRequest) UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest { + r.updateNicPayload = &updateNicPayload + return r +} + +func (r ApiUpdateNicRequest) Execute() (*NIC, error) { + return r.ApiService.UpdateNicExecute(r) +} + +/* +UpdateNic Update a network interface. + +Update the properties of an existing network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiUpdateNicRequest +*/ +func (a *DefaultAPIService) UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest { + return ApiUpdateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +func (a *DefaultAPIService) UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + if r.updateNicPayload == nil { + return localVarReturnValue, reportError("updateNicPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateNicPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdatePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + publicIpId string + updatePublicIPPayload *UpdatePublicIPPayload +} + +// Request an update of a public IP. +func (r ApiUpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { + r.updatePublicIPPayload = &updatePublicIPPayload + return r +} + +func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.UpdatePublicIPExecute(r) +} + +/* +UpdatePublicIP Update a public IP. + +Update the properties of an existing public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiUpdatePublicIPRequest +*/ +func (a *DefaultAPIService) UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest { + return ApiUpdatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// +// @return PublicIp +func (a *DefaultAPIService) UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdatePublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, reportError("publicIpId must have less than 36 elements") + } + if r.updatePublicIPPayload == nil { + return localVarReturnValue, reportError("updatePublicIPPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updatePublicIPPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateRouteOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string + updateRouteOfRoutingTablePayload *UpdateRouteOfRoutingTablePayload +} + +// Request an update of a route in a routing table. +func (r ApiUpdateRouteOfRoutingTableRequest) UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest { + r.updateRouteOfRoutingTablePayload = &updateRouteOfRoutingTablePayload + return r +} + +func (r ApiUpdateRouteOfRoutingTableRequest) Execute() (*Route, error) { + return r.ApiService.UpdateRouteOfRoutingTableExecute(r) +} + +/* +UpdateRouteOfRoutingTable Update a route of a routing table. + +Update a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest +*/ +func (a *DefaultAPIService) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { + return ApiUpdateRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRouteOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + if r.updateRouteOfRoutingTablePayload == nil { + return localVarReturnValue, reportError("updateRouteOfRoutingTablePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRouteOfRoutingTablePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateRoutingTableOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + updateRoutingTableOfAreaPayload *UpdateRoutingTableOfAreaPayload +} + +// Request an update of a routing table. +func (r ApiUpdateRoutingTableOfAreaRequest) UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest { + r.updateRoutingTableOfAreaPayload = &updateRoutingTableOfAreaPayload + return r +} + +func (r ApiUpdateRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.UpdateRoutingTableOfAreaExecute(r) +} + +/* +UpdateRoutingTableOfArea Update a routing table. + +Update a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest +*/ +func (a *DefaultAPIService) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { + return ApiUpdateRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRoutingTableOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if r.updateRoutingTableOfAreaPayload == nil { + return localVarReturnValue, reportError("updateRoutingTableOfAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRoutingTableOfAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string + updateSecurityGroupPayload *UpdateSecurityGroupPayload +} + +// Request an update of a security group. +func (r ApiUpdateSecurityGroupRequest) UpdateSecurityGroupPayload(updateSecurityGroupPayload UpdateSecurityGroupPayload) ApiUpdateSecurityGroupRequest { + r.updateSecurityGroupPayload = &updateSecurityGroupPayload + return r +} + +func (r ApiUpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.UpdateSecurityGroupExecute(r) +} + +/* +UpdateSecurityGroup Update information of a security group. + +Update labels of the security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiUpdateSecurityGroupRequest +*/ +func (a *DefaultAPIService) UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiUpdateSecurityGroupRequest { + return ApiUpdateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroup +func (a *DefaultAPIService) UpdateSecurityGroupExecute(r ApiUpdateSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if r.updateSecurityGroupPayload == nil { + return localVarReturnValue, reportError("updateSecurityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateSecurityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + updateServerPayload *UpdateServerPayload +} + +// Request an update of a server. +func (r ApiUpdateServerRequest) UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest { + r.updateServerPayload = &updateServerPayload + return r +} + +func (r ApiUpdateServerRequest) Execute() (*Server, error) { + return r.ApiService.UpdateServerExecute(r) +} + +/* +UpdateServer Update information of a server. + +Update name or labels of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUpdateServerRequest +*/ +func (a *DefaultAPIService) UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest { + return ApiUpdateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return Server +func (a *DefaultAPIService) UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if r.updateServerPayload == nil { + return localVarReturnValue, reportError("updateServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + snapshotId string + updateSnapshotPayload *UpdateSnapshotPayload +} + +// Request an update of a snapshot. +func (r ApiUpdateSnapshotRequest) UpdateSnapshotPayload(updateSnapshotPayload UpdateSnapshotPayload) ApiUpdateSnapshotRequest { + r.updateSnapshotPayload = &updateSnapshotPayload + return r +} + +func (r ApiUpdateSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.UpdateSnapshotExecute(r) +} + +/* +UpdateSnapshot Update information of the snapshot. + +Update information like name or labels of the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiUpdateSnapshotRequest +*/ +func (a *DefaultAPIService) UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiUpdateSnapshotRequest { + return ApiUpdateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// Execute executes the request +// +// @return Snapshot +func (a *DefaultAPIService) UpdateSnapshotExecute(r ApiUpdateSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return localVarReturnValue, reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return localVarReturnValue, reportError("snapshotId must have less than 36 elements") + } + if r.updateSnapshotPayload == nil { + return localVarReturnValue, reportError("updateSnapshotPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateSnapshotPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumeId string + updateVolumePayload *UpdateVolumePayload +} + +// Request an update of a volume. +func (r ApiUpdateVolumeRequest) UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest { + r.updateVolumePayload = &updateVolumePayload + return r +} + +func (r ApiUpdateVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.UpdateVolumeExecute(r) +} + +/* +UpdateVolume Update information of a volume. + +Update name, description or labels of the volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateVolumeRequest +*/ +func (a *DefaultAPIService) UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest { + return ApiUpdateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return Volume +func (a *DefaultAPIService) UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + if r.updateVolumePayload == nil { + return localVarReturnValue, reportError("updateVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/iaas/v2api/api_default_mock.go b/services/iaas/v2api/api_default_mock.go new file mode 100644 index 000000000..95b69a221 --- /dev/null +++ b/services/iaas/v2api/api_default_mock.go @@ -0,0 +1,2962 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // AddNetworkToServerExecuteMock can be populated to implement the behavior of the AddNetworkToServerExecute function of this mock + AddNetworkToServerExecuteMock *func(r ApiAddNetworkToServerRequest) error + // AddNicToServerExecuteMock can be populated to implement the behavior of the AddNicToServerExecute function of this mock + AddNicToServerExecuteMock *func(r ApiAddNicToServerRequest) error + // AddPublicIpToServerExecuteMock can be populated to implement the behavior of the AddPublicIpToServerExecute function of this mock + AddPublicIpToServerExecuteMock *func(r ApiAddPublicIpToServerRequest) error + // AddRoutesToRoutingTableExecuteMock can be populated to implement the behavior of the AddRoutesToRoutingTableExecute function of this mock + AddRoutesToRoutingTableExecuteMock *func(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) + // AddRoutingTableToAreaExecuteMock can be populated to implement the behavior of the AddRoutingTableToAreaExecute function of this mock + AddRoutingTableToAreaExecuteMock *func(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) + // AddSecurityGroupToServerExecuteMock can be populated to implement the behavior of the AddSecurityGroupToServerExecute function of this mock + AddSecurityGroupToServerExecuteMock *func(r ApiAddSecurityGroupToServerRequest) error + // AddServiceAccountToServerExecuteMock can be populated to implement the behavior of the AddServiceAccountToServerExecute function of this mock + AddServiceAccountToServerExecuteMock *func(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) + // AddVolumeToServerExecuteMock can be populated to implement the behavior of the AddVolumeToServerExecute function of this mock + AddVolumeToServerExecuteMock *func(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) + // CreateAffinityGroupExecuteMock can be populated to implement the behavior of the CreateAffinityGroupExecute function of this mock + CreateAffinityGroupExecuteMock *func(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) (*Backup, error) + // CreateImageExecuteMock can be populated to implement the behavior of the CreateImageExecute function of this mock + CreateImageExecuteMock *func(r ApiCreateImageRequest) (*ImageCreateResponse, error) + // CreateIsolatedNetworkExecuteMock can be populated to implement the behavior of the CreateIsolatedNetworkExecute function of this mock + CreateIsolatedNetworkExecuteMock *func(r ApiCreateIsolatedNetworkRequest) (*Network, error) + // CreateKeyPairExecuteMock can be populated to implement the behavior of the CreateKeyPairExecute function of this mock + CreateKeyPairExecuteMock *func(r ApiCreateKeyPairRequest) (*Keypair, error) + // CreateNetworkExecuteMock can be populated to implement the behavior of the CreateNetworkExecute function of this mock + CreateNetworkExecuteMock *func(r ApiCreateNetworkRequest) (*Network, error) + // CreateNetworkAreaExecuteMock can be populated to implement the behavior of the CreateNetworkAreaExecute function of this mock + CreateNetworkAreaExecuteMock *func(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) + // CreateNetworkAreaRangeExecuteMock can be populated to implement the behavior of the CreateNetworkAreaRangeExecute function of this mock + CreateNetworkAreaRangeExecuteMock *func(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) + // CreateNetworkAreaRegionExecuteMock can be populated to implement the behavior of the CreateNetworkAreaRegionExecute function of this mock + CreateNetworkAreaRegionExecuteMock *func(r ApiCreateNetworkAreaRegionRequest) (*RegionalArea, error) + // CreateNetworkAreaRouteExecuteMock can be populated to implement the behavior of the CreateNetworkAreaRouteExecute function of this mock + CreateNetworkAreaRouteExecuteMock *func(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) + // CreateNicExecuteMock can be populated to implement the behavior of the CreateNicExecute function of this mock + CreateNicExecuteMock *func(r ApiCreateNicRequest) (*NIC, error) + // CreatePublicIPExecuteMock can be populated to implement the behavior of the CreatePublicIPExecute function of this mock + CreatePublicIPExecuteMock *func(r ApiCreatePublicIPRequest) (*PublicIp, error) + // CreateSecurityGroupExecuteMock can be populated to implement the behavior of the CreateSecurityGroupExecute function of this mock + CreateSecurityGroupExecuteMock *func(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) + // CreateSecurityGroupRuleExecuteMock can be populated to implement the behavior of the CreateSecurityGroupRuleExecute function of this mock + CreateSecurityGroupRuleExecuteMock *func(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) + // CreateServerExecuteMock can be populated to implement the behavior of the CreateServerExecute function of this mock + CreateServerExecuteMock *func(r ApiCreateServerRequest) (*Server, error) + // CreateSnapshotExecuteMock can be populated to implement the behavior of the CreateSnapshotExecute function of this mock + CreateSnapshotExecuteMock *func(r ApiCreateSnapshotRequest) (*Snapshot, error) + // CreateVolumeExecuteMock can be populated to implement the behavior of the CreateVolumeExecute function of this mock + CreateVolumeExecuteMock *func(r ApiCreateVolumeRequest) (*Volume, error) + // DeallocateServerExecuteMock can be populated to implement the behavior of the DeallocateServerExecute function of this mock + DeallocateServerExecuteMock *func(r ApiDeallocateServerRequest) error + // DeleteAffinityGroupExecuteMock can be populated to implement the behavior of the DeleteAffinityGroupExecute function of this mock + DeleteAffinityGroupExecuteMock *func(r ApiDeleteAffinityGroupRequest) error + // DeleteBackupExecuteMock can be populated to implement the behavior of the DeleteBackupExecute function of this mock + DeleteBackupExecuteMock *func(r ApiDeleteBackupRequest) error + // DeleteImageExecuteMock can be populated to implement the behavior of the DeleteImageExecute function of this mock + DeleteImageExecuteMock *func(r ApiDeleteImageRequest) error + // DeleteImageShareExecuteMock can be populated to implement the behavior of the DeleteImageShareExecute function of this mock + DeleteImageShareExecuteMock *func(r ApiDeleteImageShareRequest) error + // DeleteImageShareConsumerExecuteMock can be populated to implement the behavior of the DeleteImageShareConsumerExecute function of this mock + DeleteImageShareConsumerExecuteMock *func(r ApiDeleteImageShareConsumerRequest) error + // DeleteKeyPairExecuteMock can be populated to implement the behavior of the DeleteKeyPairExecute function of this mock + DeleteKeyPairExecuteMock *func(r ApiDeleteKeyPairRequest) error + // DeleteNetworkExecuteMock can be populated to implement the behavior of the DeleteNetworkExecute function of this mock + DeleteNetworkExecuteMock *func(r ApiDeleteNetworkRequest) error + // DeleteNetworkAreaExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaExecute function of this mock + DeleteNetworkAreaExecuteMock *func(r ApiDeleteNetworkAreaRequest) error + // DeleteNetworkAreaRangeExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaRangeExecute function of this mock + DeleteNetworkAreaRangeExecuteMock *func(r ApiDeleteNetworkAreaRangeRequest) error + // DeleteNetworkAreaRegionExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaRegionExecute function of this mock + DeleteNetworkAreaRegionExecuteMock *func(r ApiDeleteNetworkAreaRegionRequest) error + // DeleteNetworkAreaRouteExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaRouteExecute function of this mock + DeleteNetworkAreaRouteExecuteMock *func(r ApiDeleteNetworkAreaRouteRequest) error + // DeleteNicExecuteMock can be populated to implement the behavior of the DeleteNicExecute function of this mock + DeleteNicExecuteMock *func(r ApiDeleteNicRequest) error + // DeletePublicIPExecuteMock can be populated to implement the behavior of the DeletePublicIPExecute function of this mock + DeletePublicIPExecuteMock *func(r ApiDeletePublicIPRequest) error + // DeleteRouteFromRoutingTableExecuteMock can be populated to implement the behavior of the DeleteRouteFromRoutingTableExecute function of this mock + DeleteRouteFromRoutingTableExecuteMock *func(r ApiDeleteRouteFromRoutingTableRequest) error + // DeleteRoutingTableFromAreaExecuteMock can be populated to implement the behavior of the DeleteRoutingTableFromAreaExecute function of this mock + DeleteRoutingTableFromAreaExecuteMock *func(r ApiDeleteRoutingTableFromAreaRequest) error + // DeleteSecurityGroupExecuteMock can be populated to implement the behavior of the DeleteSecurityGroupExecute function of this mock + DeleteSecurityGroupExecuteMock *func(r ApiDeleteSecurityGroupRequest) error + // DeleteSecurityGroupRuleExecuteMock can be populated to implement the behavior of the DeleteSecurityGroupRuleExecute function of this mock + DeleteSecurityGroupRuleExecuteMock *func(r ApiDeleteSecurityGroupRuleRequest) error + // DeleteServerExecuteMock can be populated to implement the behavior of the DeleteServerExecute function of this mock + DeleteServerExecuteMock *func(r ApiDeleteServerRequest) error + // DeleteSnapshotExecuteMock can be populated to implement the behavior of the DeleteSnapshotExecute function of this mock + DeleteSnapshotExecuteMock *func(r ApiDeleteSnapshotRequest) error + // DeleteVolumeExecuteMock can be populated to implement the behavior of the DeleteVolumeExecute function of this mock + DeleteVolumeExecuteMock *func(r ApiDeleteVolumeRequest) error + // GetAffinityGroupExecuteMock can be populated to implement the behavior of the GetAffinityGroupExecute function of this mock + GetAffinityGroupExecuteMock *func(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) + // GetAttachedVolumeExecuteMock can be populated to implement the behavior of the GetAttachedVolumeExecute function of this mock + GetAttachedVolumeExecuteMock *func(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*Backup, error) + // GetImageExecuteMock can be populated to implement the behavior of the GetImageExecute function of this mock + GetImageExecuteMock *func(r ApiGetImageRequest) (*Image, error) + // GetImageShareExecuteMock can be populated to implement the behavior of the GetImageShareExecute function of this mock + GetImageShareExecuteMock *func(r ApiGetImageShareRequest) (*ImageShare, error) + // GetImageShareConsumerExecuteMock can be populated to implement the behavior of the GetImageShareConsumerExecute function of this mock + GetImageShareConsumerExecuteMock *func(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) + // GetKeyPairExecuteMock can be populated to implement the behavior of the GetKeyPairExecute function of this mock + GetKeyPairExecuteMock *func(r ApiGetKeyPairRequest) (*Keypair, error) + // GetMachineTypeExecuteMock can be populated to implement the behavior of the GetMachineTypeExecute function of this mock + GetMachineTypeExecuteMock *func(r ApiGetMachineTypeRequest) (*MachineType, error) + // GetNetworkExecuteMock can be populated to implement the behavior of the GetNetworkExecute function of this mock + GetNetworkExecuteMock *func(r ApiGetNetworkRequest) (*Network, error) + // GetNetworkAreaExecuteMock can be populated to implement the behavior of the GetNetworkAreaExecute function of this mock + GetNetworkAreaExecuteMock *func(r ApiGetNetworkAreaRequest) (*NetworkArea, error) + // GetNetworkAreaRangeExecuteMock can be populated to implement the behavior of the GetNetworkAreaRangeExecute function of this mock + GetNetworkAreaRangeExecuteMock *func(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) + // GetNetworkAreaRegionExecuteMock can be populated to implement the behavior of the GetNetworkAreaRegionExecute function of this mock + GetNetworkAreaRegionExecuteMock *func(r ApiGetNetworkAreaRegionRequest) (*RegionalArea, error) + // GetNetworkAreaRouteExecuteMock can be populated to implement the behavior of the GetNetworkAreaRouteExecute function of this mock + GetNetworkAreaRouteExecuteMock *func(r ApiGetNetworkAreaRouteRequest) (*Route, error) + // GetNicExecuteMock can be populated to implement the behavior of the GetNicExecute function of this mock + GetNicExecuteMock *func(r ApiGetNicRequest) (*NIC, error) + // GetOrganizationRequestExecuteMock can be populated to implement the behavior of the GetOrganizationRequestExecute function of this mock + GetOrganizationRequestExecuteMock *func(r ApiGetOrganizationRequestRequest) (*Request, error) + // GetProjectDetailsExecuteMock can be populated to implement the behavior of the GetProjectDetailsExecute function of this mock + GetProjectDetailsExecuteMock *func(r ApiGetProjectDetailsRequest) (*Project, error) + // GetProjectNICExecuteMock can be populated to implement the behavior of the GetProjectNICExecute function of this mock + GetProjectNICExecuteMock *func(r ApiGetProjectNICRequest) (*NIC, error) + // GetProjectRequestExecuteMock can be populated to implement the behavior of the GetProjectRequestExecute function of this mock + GetProjectRequestExecuteMock *func(r ApiGetProjectRequestRequest) (*Request, error) + // GetPublicIPExecuteMock can be populated to implement the behavior of the GetPublicIPExecute function of this mock + GetPublicIPExecuteMock *func(r ApiGetPublicIPRequest) (*PublicIp, error) + // GetRouteOfRoutingTableExecuteMock can be populated to implement the behavior of the GetRouteOfRoutingTableExecute function of this mock + GetRouteOfRoutingTableExecuteMock *func(r ApiGetRouteOfRoutingTableRequest) (*Route, error) + // GetRoutingTableOfAreaExecuteMock can be populated to implement the behavior of the GetRoutingTableOfAreaExecute function of this mock + GetRoutingTableOfAreaExecuteMock *func(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) + // GetSecurityGroupExecuteMock can be populated to implement the behavior of the GetSecurityGroupExecute function of this mock + GetSecurityGroupExecuteMock *func(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) + // GetSecurityGroupRuleExecuteMock can be populated to implement the behavior of the GetSecurityGroupRuleExecute function of this mock + GetSecurityGroupRuleExecuteMock *func(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) + // GetServerExecuteMock can be populated to implement the behavior of the GetServerExecute function of this mock + GetServerExecuteMock *func(r ApiGetServerRequest) (*Server, error) + // GetServerConsoleExecuteMock can be populated to implement the behavior of the GetServerConsoleExecute function of this mock + GetServerConsoleExecuteMock *func(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) + // GetServerLogExecuteMock can be populated to implement the behavior of the GetServerLogExecute function of this mock + GetServerLogExecuteMock *func(r ApiGetServerLogRequest) (*GetServerLog200Response, error) + // GetSnapshotExecuteMock can be populated to implement the behavior of the GetSnapshotExecute function of this mock + GetSnapshotExecuteMock *func(r ApiGetSnapshotRequest) (*Snapshot, error) + // GetVolumeExecuteMock can be populated to implement the behavior of the GetVolumeExecute function of this mock + GetVolumeExecuteMock *func(r ApiGetVolumeRequest) (*Volume, error) + // GetVolumePerformanceClassExecuteMock can be populated to implement the behavior of the GetVolumePerformanceClassExecute function of this mock + GetVolumePerformanceClassExecuteMock *func(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) + // ImageFromVolumeExecuteMock can be populated to implement the behavior of the ImageFromVolumeExecute function of this mock + ImageFromVolumeExecuteMock *func(r ApiImageFromVolumeRequest) (*Image, error) + // ListAffinityGroupsExecuteMock can be populated to implement the behavior of the ListAffinityGroupsExecute function of this mock + ListAffinityGroupsExecuteMock *func(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) + // ListAttachedVolumesExecuteMock can be populated to implement the behavior of the ListAttachedVolumesExecute function of this mock + ListAttachedVolumesExecuteMock *func(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) + // ListAvailabilityZonesExecuteMock can be populated to implement the behavior of the ListAvailabilityZonesExecute function of this mock + ListAvailabilityZonesExecuteMock *func(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*BackupListResponse, error) + // ListImagesExecuteMock can be populated to implement the behavior of the ListImagesExecute function of this mock + ListImagesExecuteMock *func(r ApiListImagesRequest) (*ImageListResponse, error) + // ListKeyPairsExecuteMock can be populated to implement the behavior of the ListKeyPairsExecute function of this mock + ListKeyPairsExecuteMock *func(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) + // ListMachineTypesExecuteMock can be populated to implement the behavior of the ListMachineTypesExecute function of this mock + ListMachineTypesExecuteMock *func(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) + // ListNetworkAreaProjectsExecuteMock can be populated to implement the behavior of the ListNetworkAreaProjectsExecute function of this mock + ListNetworkAreaProjectsExecuteMock *func(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) + // ListNetworkAreaRangesExecuteMock can be populated to implement the behavior of the ListNetworkAreaRangesExecute function of this mock + ListNetworkAreaRangesExecuteMock *func(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) + // ListNetworkAreaRegionsExecuteMock can be populated to implement the behavior of the ListNetworkAreaRegionsExecute function of this mock + ListNetworkAreaRegionsExecuteMock *func(r ApiListNetworkAreaRegionsRequest) (*RegionalAreaListResponse, error) + // ListNetworkAreaRoutesExecuteMock can be populated to implement the behavior of the ListNetworkAreaRoutesExecute function of this mock + ListNetworkAreaRoutesExecuteMock *func(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) + // ListNetworkAreasExecuteMock can be populated to implement the behavior of the ListNetworkAreasExecute function of this mock + ListNetworkAreasExecuteMock *func(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) + // ListNetworksExecuteMock can be populated to implement the behavior of the ListNetworksExecute function of this mock + ListNetworksExecuteMock *func(r ApiListNetworksRequest) (*NetworkListResponse, error) + // ListNicsExecuteMock can be populated to implement the behavior of the ListNicsExecute function of this mock + ListNicsExecuteMock *func(r ApiListNicsRequest) (*NICListResponse, error) + // ListProjectNICsExecuteMock can be populated to implement the behavior of the ListProjectNICsExecute function of this mock + ListProjectNICsExecuteMock *func(r ApiListProjectNICsRequest) (*NICListResponse, error) + // ListPublicIPRangesExecuteMock can be populated to implement the behavior of the ListPublicIPRangesExecute function of this mock + ListPublicIPRangesExecuteMock *func(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) + // ListPublicIPsExecuteMock can be populated to implement the behavior of the ListPublicIPsExecute function of this mock + ListPublicIPsExecuteMock *func(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) + // ListQuotasExecuteMock can be populated to implement the behavior of the ListQuotasExecute function of this mock + ListQuotasExecuteMock *func(r ApiListQuotasRequest) (*QuotaListResponse, error) + // ListRoutesOfRoutingTableExecuteMock can be populated to implement the behavior of the ListRoutesOfRoutingTableExecute function of this mock + ListRoutesOfRoutingTableExecuteMock *func(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) + // ListRoutingTablesOfAreaExecuteMock can be populated to implement the behavior of the ListRoutingTablesOfAreaExecute function of this mock + ListRoutingTablesOfAreaExecuteMock *func(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) + // ListSecurityGroupRulesExecuteMock can be populated to implement the behavior of the ListSecurityGroupRulesExecute function of this mock + ListSecurityGroupRulesExecuteMock *func(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) + // ListSecurityGroupsExecuteMock can be populated to implement the behavior of the ListSecurityGroupsExecute function of this mock + ListSecurityGroupsExecuteMock *func(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) + // ListServerNICsExecuteMock can be populated to implement the behavior of the ListServerNICsExecute function of this mock + ListServerNICsExecuteMock *func(r ApiListServerNICsRequest) (*NICListResponse, error) + // ListServerServiceAccountsExecuteMock can be populated to implement the behavior of the ListServerServiceAccountsExecute function of this mock + ListServerServiceAccountsExecuteMock *func(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) + // ListServersExecuteMock can be populated to implement the behavior of the ListServersExecute function of this mock + ListServersExecuteMock *func(r ApiListServersRequest) (*ServerListResponse, error) + // ListSnapshotsInProjectExecuteMock can be populated to implement the behavior of the ListSnapshotsInProjectExecute function of this mock + ListSnapshotsInProjectExecuteMock *func(r ApiListSnapshotsInProjectRequest) (*SnapshotListResponse, error) + // ListVolumePerformanceClassesExecuteMock can be populated to implement the behavior of the ListVolumePerformanceClassesExecute function of this mock + ListVolumePerformanceClassesExecuteMock *func(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) + // ListVolumesExecuteMock can be populated to implement the behavior of the ListVolumesExecute function of this mock + ListVolumesExecuteMock *func(r ApiListVolumesRequest) (*VolumeListResponse, error) + // PartialUpdateNetworkExecuteMock can be populated to implement the behavior of the PartialUpdateNetworkExecute function of this mock + PartialUpdateNetworkExecuteMock *func(r ApiPartialUpdateNetworkRequest) error + // PartialUpdateNetworkAreaExecuteMock can be populated to implement the behavior of the PartialUpdateNetworkAreaExecute function of this mock + PartialUpdateNetworkAreaExecuteMock *func(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) + // RebootServerExecuteMock can be populated to implement the behavior of the RebootServerExecute function of this mock + RebootServerExecuteMock *func(r ApiRebootServerRequest) error + // RemoveNetworkFromServerExecuteMock can be populated to implement the behavior of the RemoveNetworkFromServerExecute function of this mock + RemoveNetworkFromServerExecuteMock *func(r ApiRemoveNetworkFromServerRequest) error + // RemoveNicFromServerExecuteMock can be populated to implement the behavior of the RemoveNicFromServerExecute function of this mock + RemoveNicFromServerExecuteMock *func(r ApiRemoveNicFromServerRequest) error + // RemovePublicIpFromServerExecuteMock can be populated to implement the behavior of the RemovePublicIpFromServerExecute function of this mock + RemovePublicIpFromServerExecuteMock *func(r ApiRemovePublicIpFromServerRequest) error + // RemoveSecurityGroupFromServerExecuteMock can be populated to implement the behavior of the RemoveSecurityGroupFromServerExecute function of this mock + RemoveSecurityGroupFromServerExecuteMock *func(r ApiRemoveSecurityGroupFromServerRequest) error + // RemoveServiceAccountFromServerExecuteMock can be populated to implement the behavior of the RemoveServiceAccountFromServerExecute function of this mock + RemoveServiceAccountFromServerExecuteMock *func(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) + // RemoveVolumeFromServerExecuteMock can be populated to implement the behavior of the RemoveVolumeFromServerExecute function of this mock + RemoveVolumeFromServerExecuteMock *func(r ApiRemoveVolumeFromServerRequest) error + // RescueServerExecuteMock can be populated to implement the behavior of the RescueServerExecute function of this mock + RescueServerExecuteMock *func(r ApiRescueServerRequest) error + // ResizeServerExecuteMock can be populated to implement the behavior of the ResizeServerExecute function of this mock + ResizeServerExecuteMock *func(r ApiResizeServerRequest) error + // ResizeVolumeExecuteMock can be populated to implement the behavior of the ResizeVolumeExecute function of this mock + ResizeVolumeExecuteMock *func(r ApiResizeVolumeRequest) error + // RestoreBackupExecuteMock can be populated to implement the behavior of the RestoreBackupExecute function of this mock + RestoreBackupExecuteMock *func(r ApiRestoreBackupRequest) error + // SetImageShareExecuteMock can be populated to implement the behavior of the SetImageShareExecute function of this mock + SetImageShareExecuteMock *func(r ApiSetImageShareRequest) (*ImageShare, error) + // StartServerExecuteMock can be populated to implement the behavior of the StartServerExecute function of this mock + StartServerExecuteMock *func(r ApiStartServerRequest) error + // StopServerExecuteMock can be populated to implement the behavior of the StopServerExecute function of this mock + StopServerExecuteMock *func(r ApiStopServerRequest) error + // UnrescueServerExecuteMock can be populated to implement the behavior of the UnrescueServerExecute function of this mock + UnrescueServerExecuteMock *func(r ApiUnrescueServerRequest) error + // UpdateAttachedVolumeExecuteMock can be populated to implement the behavior of the UpdateAttachedVolumeExecute function of this mock + UpdateAttachedVolumeExecuteMock *func(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) + // UpdateBackupExecuteMock can be populated to implement the behavior of the UpdateBackupExecute function of this mock + UpdateBackupExecuteMock *func(r ApiUpdateBackupRequest) (*Backup, error) + // UpdateImageExecuteMock can be populated to implement the behavior of the UpdateImageExecute function of this mock + UpdateImageExecuteMock *func(r ApiUpdateImageRequest) (*Image, error) + // UpdateImageShareExecuteMock can be populated to implement the behavior of the UpdateImageShareExecute function of this mock + UpdateImageShareExecuteMock *func(r ApiUpdateImageShareRequest) (*ImageShare, error) + // UpdateKeyPairExecuteMock can be populated to implement the behavior of the UpdateKeyPairExecute function of this mock + UpdateKeyPairExecuteMock *func(r ApiUpdateKeyPairRequest) (*Keypair, error) + // UpdateNetworkAreaRegionExecuteMock can be populated to implement the behavior of the UpdateNetworkAreaRegionExecute function of this mock + UpdateNetworkAreaRegionExecuteMock *func(r ApiUpdateNetworkAreaRegionRequest) (*RegionalArea, error) + // UpdateNetworkAreaRouteExecuteMock can be populated to implement the behavior of the UpdateNetworkAreaRouteExecute function of this mock + UpdateNetworkAreaRouteExecuteMock *func(r ApiUpdateNetworkAreaRouteRequest) (*Route, error) + // UpdateNicExecuteMock can be populated to implement the behavior of the UpdateNicExecute function of this mock + UpdateNicExecuteMock *func(r ApiUpdateNicRequest) (*NIC, error) + // UpdatePublicIPExecuteMock can be populated to implement the behavior of the UpdatePublicIPExecute function of this mock + UpdatePublicIPExecuteMock *func(r ApiUpdatePublicIPRequest) (*PublicIp, error) + // UpdateRouteOfRoutingTableExecuteMock can be populated to implement the behavior of the UpdateRouteOfRoutingTableExecute function of this mock + UpdateRouteOfRoutingTableExecuteMock *func(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) + // UpdateRoutingTableOfAreaExecuteMock can be populated to implement the behavior of the UpdateRoutingTableOfAreaExecute function of this mock + UpdateRoutingTableOfAreaExecuteMock *func(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) + // UpdateSecurityGroupExecuteMock can be populated to implement the behavior of the UpdateSecurityGroupExecute function of this mock + UpdateSecurityGroupExecuteMock *func(r ApiUpdateSecurityGroupRequest) (*SecurityGroup, error) + // UpdateServerExecuteMock can be populated to implement the behavior of the UpdateServerExecute function of this mock + UpdateServerExecuteMock *func(r ApiUpdateServerRequest) (*Server, error) + // UpdateSnapshotExecuteMock can be populated to implement the behavior of the UpdateSnapshotExecute function of this mock + UpdateSnapshotExecuteMock *func(r ApiUpdateSnapshotRequest) (*Snapshot, error) + // UpdateVolumeExecuteMock can be populated to implement the behavior of the UpdateVolumeExecute function of this mock + UpdateVolumeExecuteMock *func(r ApiUpdateVolumeRequest) (*Volume, error) +} + +func (a DefaultAPIServiceMock) AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest { + return ApiAddNetworkToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + networkId: networkId, + } +} + +// AddNetworkToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddNetworkToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error { + if a.AddNetworkToServerExecuteMock == nil { + return nil + } + + return (*a.AddNetworkToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest { + return ApiAddNicToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + nicId: nicId, + } +} + +// AddNicToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddNicToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddNicToServerExecute(r ApiAddNicToServerRequest) error { + if a.AddNicToServerExecuteMock == nil { + return nil + } + + return (*a.AddNicToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest { + return ApiAddPublicIpToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// AddPublicIpToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddPublicIpToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error { + if a.AddPublicIpToServerExecuteMock == nil { + return nil + } + + return (*a.AddPublicIpToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { + return ApiAddRoutesToRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// AddRoutesToRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddRoutesToRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) { + if a.AddRoutesToRoutingTableExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.AddRoutesToRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { + return ApiAddRoutingTableToAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// AddRoutingTableToAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddRoutingTableToAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) { + if a.AddRoutingTableToAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.AddRoutingTableToAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest { + return ApiAddSecurityGroupToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// AddSecurityGroupToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddSecurityGroupToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error { + if a.AddSecurityGroupToServerExecuteMock == nil { + return nil + } + + return (*a.AddSecurityGroupToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest { + return ApiAddServiceAccountToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// AddServiceAccountToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddServiceAccountToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) { + if a.AddServiceAccountToServerExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.AddServiceAccountToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest { + return ApiAddVolumeToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// AddVolumeToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddVolumeToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) { + if a.AddVolumeToServerExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.AddVolumeToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest { + return ApiCreateAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) { + if a.CreateAffinityGroupExecuteMock == nil { + var localVarReturnValue *AffinityGroup + return localVarReturnValue, nil + } + + return (*a.CreateAffinityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest { + return ApiCreateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) { + if a.CreateImageExecuteMock == nil { + var localVarReturnValue *ImageCreateResponse + return localVarReturnValue, nil + } + + return (*a.CreateImageExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateIsolatedNetwork(ctx context.Context, projectId string, region string) ApiCreateIsolatedNetworkRequest { + return ApiCreateIsolatedNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateIsolatedNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateIsolatedNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateIsolatedNetworkExecute(r ApiCreateIsolatedNetworkRequest) (*Network, error) { + if a.CreateIsolatedNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.CreateIsolatedNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return ApiCreateKeyPairRequest{ + ApiService: a, + ctx: ctx, + } +} + +// CreateKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) { + if a.CreateKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.CreateKeyPairExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { + if a.CreateNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.CreateNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { + return ApiCreateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// CreateNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) { + if a.CreateNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest { + return ApiCreateNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// CreateNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) { + if a.CreateNetworkAreaRangeExecuteMock == nil { + var localVarReturnValue *NetworkRangeListResponse + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaRangeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRegionRequest { + return ApiCreateNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// CreateNetworkAreaRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaRegionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaRegionExecute(r ApiCreateNetworkAreaRegionRequest) (*RegionalArea, error) { + if a.CreateNetworkAreaRegionExecuteMock == nil { + var localVarReturnValue *RegionalArea + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaRegionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest { + return ApiCreateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// CreateNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) { + if a.CreateNetworkAreaRouteExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaRouteExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest { + return ApiCreateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// CreateNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) { + if a.CreateNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.CreateNicExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest { + return ApiCreatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreatePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreatePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) { + if a.CreatePublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.CreatePublicIPExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest { + return ApiCreateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) { + if a.CreateSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.CreateSecurityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { + return ApiCreateSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// CreateSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + if a.CreateSecurityGroupRuleExecuteMock == nil { + var localVarReturnValue *SecurityGroupRule + return localVarReturnValue, nil + } + + return (*a.CreateSecurityGroupRuleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest { + return ApiCreateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateServerExecute(r ApiCreateServerRequest) (*Server, error) { + if a.CreateServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.CreateServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateSnapshot(ctx context.Context, projectId string, region string) ApiCreateSnapshotRequest { + return ApiCreateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateSnapshotExecute(r ApiCreateSnapshotRequest) (*Snapshot, error) { + if a.CreateSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.CreateSnapshotExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest { + return ApiCreateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) { + if a.CreateVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.CreateVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest { + return ApiDeallocateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// DeallocateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeallocateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeallocateServerExecute(r ApiDeallocateServerRequest) error { + if a.DeallocateServerExecuteMock == nil { + return nil + } + + return (*a.DeallocateServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest { + return ApiDeleteAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +// DeleteAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error { + if a.DeleteAffinityGroupExecuteMock == nil { + return nil + } + + return (*a.DeleteAffinityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// DeleteBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + if a.DeleteBackupExecuteMock == nil { + return nil + } + + return (*a.DeleteBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest { + return ApiDeleteImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// DeleteImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageExecute(r ApiDeleteImageRequest) error { + if a.DeleteImageExecuteMock == nil { + return nil + } + + return (*a.DeleteImageExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest { + return ApiDeleteImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// DeleteImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageShareExecute(r ApiDeleteImageShareRequest) error { + if a.DeleteImageShareExecuteMock == nil { + return nil + } + + return (*a.DeleteImageShareExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { + return ApiDeleteImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// DeleteImageShareConsumerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageShareConsumerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error { + if a.DeleteImageShareConsumerExecuteMock == nil { + return nil + } + + return (*a.DeleteImageShareConsumerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// DeleteKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error { + if a.DeleteKeyPairExecuteMock == nil { + return nil + } + + return (*a.DeleteKeyPairExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// DeleteNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { + if a.DeleteNetworkExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { + return ApiDeleteNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// DeleteNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error { + if a.DeleteNetworkAreaExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { + return ApiDeleteNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, + } +} + +// DeleteNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error { + if a.DeleteNetworkAreaRangeExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaRangeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiDeleteNetworkAreaRegionRequest { + return ApiDeleteNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// DeleteNetworkAreaRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaRegionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaRegionExecute(r ApiDeleteNetworkAreaRegionRequest) error { + if a.DeleteNetworkAreaRegionExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaRegionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest { + return ApiDeleteNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// DeleteNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error { + if a.DeleteNetworkAreaRouteExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaRouteExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest { + return ApiDeleteNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// DeleteNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNicExecute(r ApiDeleteNicRequest) error { + if a.DeleteNicExecuteMock == nil { + return nil + } + + return (*a.DeleteNicExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest { + return ApiDeletePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// DeletePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeletePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeletePublicIPExecute(r ApiDeletePublicIPRequest) error { + if a.DeletePublicIPExecuteMock == nil { + return nil + } + + return (*a.DeletePublicIPExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { + return ApiDeleteRouteFromRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// DeleteRouteFromRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRouteFromRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error { + if a.DeleteRouteFromRoutingTableExecuteMock == nil { + return nil + } + + return (*a.DeleteRouteFromRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { + return ApiDeleteRoutingTableFromAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// DeleteRoutingTableFromAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRoutingTableFromAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error { + if a.DeleteRoutingTableFromAreaExecuteMock == nil { + return nil + } + + return (*a.DeleteRoutingTableFromAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return ApiDeleteSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// DeleteSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error { + if a.DeleteSecurityGroupExecuteMock == nil { + return nil + } + + return (*a.DeleteSecurityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return ApiDeleteSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// DeleteSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error { + if a.DeleteSecurityGroupRuleExecuteMock == nil { + return nil + } + + return (*a.DeleteSecurityGroupRuleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// DeleteServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteServerExecute(r ApiDeleteServerRequest) error { + if a.DeleteServerExecuteMock == nil { + return nil + } + + return (*a.DeleteServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiDeleteSnapshotRequest { + return ApiDeleteSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// DeleteSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteSnapshotExecute(r ApiDeleteSnapshotRequest) error { + if a.DeleteSnapshotExecuteMock == nil { + return nil + } + + return (*a.DeleteSnapshotExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest { + return ApiDeleteVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// DeleteVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteVolumeExecute(r ApiDeleteVolumeRequest) error { + if a.DeleteVolumeExecuteMock == nil { + return nil + } + + return (*a.DeleteVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest { + return ApiGetAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +// GetAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) { + if a.GetAffinityGroupExecuteMock == nil { + var localVarReturnValue *AffinityGroup + return localVarReturnValue, nil + } + + return (*a.GetAffinityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return ApiGetAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// GetAttachedVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetAttachedVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) { + if a.GetAttachedVolumeExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.GetAttachedVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// GetBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest { + return ApiGetImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// GetImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageExecute(r ApiGetImageRequest) (*Image, error) { + if a.GetImageExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.GetImageExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest { + return ApiGetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// GetImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) { + if a.GetImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.GetImageShareExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { + return ApiGetImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// GetImageShareConsumerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageShareConsumerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) { + if a.GetImageShareConsumerExecuteMock == nil { + var localVarReturnValue *ImageShareConsumer + return localVarReturnValue, nil + } + + return (*a.GetImageShareConsumerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return ApiGetKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// GetKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) { + if a.GetKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.GetKeyPairExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest { + return ApiGetMachineTypeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + machineType: machineType, + } +} + +// GetMachineTypeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMachineTypeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) { + if a.GetMachineTypeExecuteMock == nil { + var localVarReturnValue *MachineType + return localVarReturnValue, nil + } + + return (*a.GetMachineTypeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// GetNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { + if a.GetNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.GetNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return ApiGetNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// GetNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) { + if a.GetNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest { + return ApiGetNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, + } +} + +// GetNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) { + if a.GetNetworkAreaRangeExecuteMock == nil { + var localVarReturnValue *NetworkRange + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaRangeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiGetNetworkAreaRegionRequest { + return ApiGetNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// GetNetworkAreaRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaRegionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaRegionExecute(r ApiGetNetworkAreaRegionRequest) (*RegionalArea, error) { + if a.GetNetworkAreaRegionExecuteMock == nil { + var localVarReturnValue *RegionalArea + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaRegionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest { + return ApiGetNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// GetNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) { + if a.GetNetworkAreaRouteExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaRouteExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest { + return ApiGetNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// GetNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNicExecute(r ApiGetNicRequest) (*NIC, error) { + if a.GetNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.GetNicExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return ApiGetOrganizationRequestRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, + } +} + +// GetOrganizationRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetOrganizationRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) { + if a.GetOrganizationRequestExecuteMock == nil { + var localVarReturnValue *Request + return localVarReturnValue, nil + } + + return (*a.GetOrganizationRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return ApiGetProjectDetailsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// GetProjectDetailsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectDetailsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) { + if a.GetProjectDetailsExecuteMock == nil { + var localVarReturnValue *Project + return localVarReturnValue, nil + } + + return (*a.GetProjectDetailsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest { + return ApiGetProjectNICRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + nicId: nicId, + } +} + +// GetProjectNICExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectNICExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) { + if a.GetProjectNICExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.GetProjectNICExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest { + return ApiGetProjectRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + requestId: requestId, + } +} + +// GetProjectRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) { + if a.GetProjectRequestExecuteMock == nil { + var localVarReturnValue *Request + return localVarReturnValue, nil + } + + return (*a.GetProjectRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest { + return ApiGetPublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// GetPublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetPublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) { + if a.GetPublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.GetPublicIPExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { + return ApiGetRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// GetRouteOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRouteOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) { + if a.GetRouteOfRoutingTableExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.GetRouteOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { + return ApiGetRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// GetRoutingTableOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRoutingTableOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) { + if a.GetRoutingTableOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.GetRoutingTableOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest { + return ApiGetSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// GetSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) { + if a.GetSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.GetSecurityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return ApiGetSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// GetSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + if a.GetSecurityGroupRuleExecuteMock == nil { + var localVarReturnValue *SecurityGroupRule + return localVarReturnValue, nil + } + + return (*a.GetSecurityGroupRuleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// GetServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerExecute(r ApiGetServerRequest) (*Server, error) { + if a.GetServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.GetServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// GetServerConsoleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerConsoleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) { + if a.GetServerConsoleExecuteMock == nil { + var localVarReturnValue *ServerConsoleUrl + return localVarReturnValue, nil + } + + return (*a.GetServerConsoleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest { + return ApiGetServerLogRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// GetServerLogExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerLogExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) { + if a.GetServerLogExecuteMock == nil { + var localVarReturnValue *GetServerLog200Response + return localVarReturnValue, nil + } + + return (*a.GetServerLogExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiGetSnapshotRequest { + return ApiGetSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// GetSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSnapshotExecute(r ApiGetSnapshotRequest) (*Snapshot, error) { + if a.GetSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.GetSnapshotExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest { + return ApiGetVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// GetVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) { + if a.GetVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.GetVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return ApiGetVolumePerformanceClassRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumePerformanceClass: volumePerformanceClass, + } +} + +// GetVolumePerformanceClassExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVolumePerformanceClassExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) { + if a.GetVolumePerformanceClassExecuteMock == nil { + var localVarReturnValue *VolumePerformanceClass + return localVarReturnValue, nil + } + + return (*a.GetVolumePerformanceClassExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ImageFromVolume(ctx context.Context, projectId string, volumeId string, region string) ApiImageFromVolumeRequest { + return ApiImageFromVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + volumeId: volumeId, + region: region, + } +} + +// ImageFromVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ImageFromVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ImageFromVolumeExecute(r ApiImageFromVolumeRequest) (*Image, error) { + if a.ImageFromVolumeExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.ImageFromVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest { + return ApiListAffinityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListAffinityGroupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAffinityGroupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) { + if a.ListAffinityGroupsExecuteMock == nil { + var localVarReturnValue *AffinityGroupListResponse + return localVarReturnValue, nil + } + + return (*a.ListAffinityGroupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest { + return ApiListAttachedVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// ListAttachedVolumesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAttachedVolumesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) { + if a.ListAttachedVolumesExecuteMock == nil { + var localVarReturnValue *VolumeAttachmentListResponse + return localVarReturnValue, nil + } + + return (*a.ListAttachedVolumesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest { + return ApiListAvailabilityZonesRequest{ + ApiService: a, + ctx: ctx, + region: region, + } +} + +// ListAvailabilityZonesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAvailabilityZonesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) { + if a.ListAvailabilityZonesExecuteMock == nil { + var localVarReturnValue *AvailabilityZoneListResponse + return localVarReturnValue, nil + } + + return (*a.ListAvailabilityZonesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *BackupListResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest { + return ApiListImagesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListImagesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListImagesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) { + if a.ListImagesExecuteMock == nil { + var localVarReturnValue *ImageListResponse + return localVarReturnValue, nil + } + + return (*a.ListImagesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ApiListKeyPairsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// ListKeyPairsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListKeyPairsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) { + if a.ListKeyPairsExecuteMock == nil { + var localVarReturnValue *KeyPairListResponse + return localVarReturnValue, nil + } + + return (*a.ListKeyPairsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest { + return ApiListMachineTypesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListMachineTypesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListMachineTypesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) { + if a.ListMachineTypesExecuteMock == nil { + var localVarReturnValue *MachineTypeListResponse + return localVarReturnValue, nil + } + + return (*a.ListMachineTypesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ApiListNetworkAreaProjectsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// ListNetworkAreaProjectsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaProjectsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) { + if a.ListNetworkAreaProjectsExecuteMock == nil { + var localVarReturnValue *ProjectListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaProjectsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest { + return ApiListNetworkAreaRangesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// ListNetworkAreaRangesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaRangesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) { + if a.ListNetworkAreaRangesExecuteMock == nil { + var localVarReturnValue *NetworkRangeListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaRangesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreaRegions(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaRegionsRequest { + return ApiListNetworkAreaRegionsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// ListNetworkAreaRegionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaRegionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaRegionsExecute(r ApiListNetworkAreaRegionsRequest) (*RegionalAreaListResponse, error) { + if a.ListNetworkAreaRegionsExecuteMock == nil { + var localVarReturnValue *RegionalAreaListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaRegionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest { + return ApiListNetworkAreaRoutesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// ListNetworkAreaRoutesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaRoutesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) { + if a.ListNetworkAreaRoutesExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaRoutesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ApiListNetworkAreasRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// ListNetworkAreasExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreasExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) { + if a.ListNetworkAreasExecuteMock == nil { + var localVarReturnValue *NetworkAreaListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreasExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListNetworksExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworksExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { + if a.ListNetworksExecuteMock == nil { + var localVarReturnValue *NetworkListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworksExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest { + return ApiListNicsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// ListNicsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNicsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) { + if a.ListNicsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListNicsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest { + return ApiListProjectNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListProjectNICsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListProjectNICsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) { + if a.ListProjectNICsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListProjectNICsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ApiListPublicIPRangesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// ListPublicIPRangesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListPublicIPRangesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) { + if a.ListPublicIPRangesExecuteMock == nil { + var localVarReturnValue *PublicNetworkListResponse + return localVarReturnValue, nil + } + + return (*a.ListPublicIPRangesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest { + return ApiListPublicIPsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListPublicIPsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListPublicIPsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) { + if a.ListPublicIPsExecuteMock == nil { + var localVarReturnValue *PublicIpListResponse + return localVarReturnValue, nil + } + + return (*a.ListPublicIPsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest { + return ApiListQuotasRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListQuotasExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListQuotasExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) { + if a.ListQuotasExecuteMock == nil { + var localVarReturnValue *QuotaListResponse + return localVarReturnValue, nil + } + + return (*a.ListQuotasExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { + return ApiListRoutesOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// ListRoutesOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRoutesOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) { + if a.ListRoutesOfRoutingTableExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.ListRoutesOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { + return ApiListRoutingTablesOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// ListRoutingTablesOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRoutingTablesOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) { + if a.ListRoutingTablesOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTableListResponse + return localVarReturnValue, nil + } + + return (*a.ListRoutingTablesOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest { + return ApiListSecurityGroupRulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// ListSecurityGroupRulesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSecurityGroupRulesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) { + if a.ListSecurityGroupRulesExecuteMock == nil { + var localVarReturnValue *SecurityGroupRuleListResponse + return localVarReturnValue, nil + } + + return (*a.ListSecurityGroupRulesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest { + return ApiListSecurityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListSecurityGroupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSecurityGroupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) { + if a.ListSecurityGroupsExecuteMock == nil { + var localVarReturnValue *SecurityGroupListResponse + return localVarReturnValue, nil + } + + return (*a.ListSecurityGroupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest { + return ApiListServerNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// ListServerNICsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServerNICsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServerNICsExecute(r ApiListServerNICsRequest) (*NICListResponse, error) { + if a.ListServerNICsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListServerNICsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest { + return ApiListServerServiceAccountsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// ListServerServiceAccountsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServerServiceAccountsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) { + if a.ListServerServiceAccountsExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.ListServerServiceAccountsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest { + return ApiListServersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListServersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) { + if a.ListServersExecuteMock == nil { + var localVarReturnValue *ServerListResponse + return localVarReturnValue, nil + } + + return (*a.ListServersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiListSnapshotsInProjectRequest { + return ApiListSnapshotsInProjectRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListSnapshotsInProjectExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSnapshotsInProjectExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSnapshotsInProjectExecute(r ApiListSnapshotsInProjectRequest) (*SnapshotListResponse, error) { + if a.ListSnapshotsInProjectExecuteMock == nil { + var localVarReturnValue *SnapshotListResponse + return localVarReturnValue, nil + } + + return (*a.ListSnapshotsInProjectExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest { + return ApiListVolumePerformanceClassesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListVolumePerformanceClassesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVolumePerformanceClassesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) { + if a.ListVolumePerformanceClassesExecuteMock == nil { + var localVarReturnValue *VolumePerformanceClassListResponse + return localVarReturnValue, nil + } + + return (*a.ListVolumePerformanceClassesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest { + return ApiListVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListVolumesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVolumesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) { + if a.ListVolumesExecuteMock == nil { + var localVarReturnValue *VolumeListResponse + return localVarReturnValue, nil + } + + return (*a.ListVolumesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// PartialUpdateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { + if a.PartialUpdateNetworkExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest { + return ApiPartialUpdateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// PartialUpdateNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) { + if a.PartialUpdateNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.PartialUpdateNetworkAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest { + return ApiRebootServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// RebootServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RebootServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RebootServerExecute(r ApiRebootServerRequest) error { + if a.RebootServerExecuteMock == nil { + return nil + } + + return (*a.RebootServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { + return ApiRemoveNetworkFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + networkId: networkId, + } +} + +// RemoveNetworkFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveNetworkFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error { + if a.RemoveNetworkFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveNetworkFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest { + return ApiRemoveNicFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + nicId: nicId, + } +} + +// RemoveNicFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveNicFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error { + if a.RemoveNicFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveNicFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { + return ApiRemovePublicIpFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// RemovePublicIpFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemovePublicIpFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error { + if a.RemovePublicIpFromServerExecuteMock == nil { + return nil + } + + return (*a.RemovePublicIpFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { + return ApiRemoveSecurityGroupFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// RemoveSecurityGroupFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveSecurityGroupFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error { + if a.RemoveSecurityGroupFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveSecurityGroupFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { + return ApiRemoveServiceAccountFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// RemoveServiceAccountFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveServiceAccountFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) { + if a.RemoveServiceAccountFromServerExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.RemoveServiceAccountFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { + return ApiRemoveVolumeFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// RemoveVolumeFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveVolumeFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error { + if a.RemoveVolumeFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveVolumeFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest { + return ApiRescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// RescueServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RescueServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RescueServerExecute(r ApiRescueServerRequest) error { + if a.RescueServerExecuteMock == nil { + return nil + } + + return (*a.RescueServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest { + return ApiResizeServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// ResizeServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResizeServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResizeServerExecute(r ApiResizeServerRequest) error { + if a.ResizeServerExecuteMock == nil { + return nil + } + + return (*a.ResizeServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest { + return ApiResizeVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// ResizeVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResizeVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResizeVolumeExecute(r ApiResizeVolumeRequest) error { + if a.ResizeVolumeExecuteMock == nil { + return nil + } + + return (*a.ResizeVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// RestoreBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + if a.RestoreBackupExecuteMock == nil { + return nil + } + + return (*a.RestoreBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest { + return ApiSetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// SetImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the SetImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) { + if a.SetImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.SetImageShareExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest { + return ApiStartServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// StartServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the StartServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) StartServerExecute(r ApiStartServerRequest) error { + if a.StartServerExecuteMock == nil { + return nil + } + + return (*a.StartServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest { + return ApiStopServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// StopServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the StopServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) StopServerExecute(r ApiStopServerRequest) error { + if a.StopServerExecuteMock == nil { + return nil + } + + return (*a.StopServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest { + return ApiUnrescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// UnrescueServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UnrescueServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UnrescueServerExecute(r ApiUnrescueServerRequest) error { + if a.UnrescueServerExecuteMock == nil { + return nil + } + + return (*a.UnrescueServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { + return ApiUpdateAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// UpdateAttachedVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateAttachedVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) { + if a.UpdateAttachedVolumeExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.UpdateAttachedVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiUpdateBackupRequest { + return ApiUpdateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// UpdateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupExecute(r ApiUpdateBackupRequest) (*Backup, error) { + if a.UpdateBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.UpdateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest { + return ApiUpdateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// UpdateImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) { + if a.UpdateImageExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.UpdateImageExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest { + return ApiUpdateImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// UpdateImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) { + if a.UpdateImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.UpdateImageShareExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { + return ApiUpdateKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// UpdateKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) { + if a.UpdateKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.UpdateKeyPairExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiUpdateNetworkAreaRegionRequest { + return ApiUpdateNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// UpdateNetworkAreaRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateNetworkAreaRegionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateNetworkAreaRegionExecute(r ApiUpdateNetworkAreaRegionRequest) (*RegionalArea, error) { + if a.UpdateNetworkAreaRegionExecuteMock == nil { + var localVarReturnValue *RegionalArea + return localVarReturnValue, nil + } + + return (*a.UpdateNetworkAreaRegionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiUpdateNetworkAreaRouteRequest { + return ApiUpdateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// UpdateNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateNetworkAreaRouteExecute(r ApiUpdateNetworkAreaRouteRequest) (*Route, error) { + if a.UpdateNetworkAreaRouteExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.UpdateNetworkAreaRouteExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest { + return ApiUpdateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// UpdateNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) { + if a.UpdateNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.UpdateNicExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest { + return ApiUpdatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// UpdatePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdatePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) { + if a.UpdatePublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.UpdatePublicIPExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { + return ApiUpdateRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// UpdateRouteOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRouteOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) { + if a.UpdateRouteOfRoutingTableExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.UpdateRouteOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { + return ApiUpdateRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// UpdateRoutingTableOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRoutingTableOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) { + if a.UpdateRoutingTableOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.UpdateRoutingTableOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiUpdateSecurityGroupRequest { + return ApiUpdateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// UpdateSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateSecurityGroupExecute(r ApiUpdateSecurityGroupRequest) (*SecurityGroup, error) { + if a.UpdateSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.UpdateSecurityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest { + return ApiUpdateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// UpdateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) { + if a.UpdateServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.UpdateServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiUpdateSnapshotRequest { + return ApiUpdateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// UpdateSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateSnapshotExecute(r ApiUpdateSnapshotRequest) (*Snapshot, error) { + if a.UpdateSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.UpdateSnapshotExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest { + return ApiUpdateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// UpdateVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) { + if a.UpdateVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.UpdateVolumeExecuteMock)(r) +} diff --git a/services/iaas/v2api/client.go b/services/iaas/v2api/client.go new file mode 100644 index 000000000..b780cc045 --- /dev/null +++ b/services/iaas/v2api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT IaaS API API v2 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/iaas/v2api/configuration.go b/services/iaas/v2api/configuration.go new file mode 100644 index 000000000..2ba6ffdc9 --- /dev/null +++ b/services/iaas/v2api/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/iaas", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://iaas.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/iaas/v2api/model_add_routes_to_routing_table_payload.go b/services/iaas/v2api/model_add_routes_to_routing_table_payload.go new file mode 100644 index 000000000..95b3cada8 --- /dev/null +++ b/services/iaas/v2api/model_add_routes_to_routing_table_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AddRoutesToRoutingTablePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRoutesToRoutingTablePayload{} + +// AddRoutesToRoutingTablePayload Object represents a request to add network routes. +type AddRoutesToRoutingTablePayload struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _AddRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload + +// NewAddRoutesToRoutingTablePayload instantiates a new AddRoutesToRoutingTablePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRoutesToRoutingTablePayload(items []Route) *AddRoutesToRoutingTablePayload { + this := AddRoutesToRoutingTablePayload{} + this.Items = items + return &this +} + +// NewAddRoutesToRoutingTablePayloadWithDefaults instantiates a new AddRoutesToRoutingTablePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRoutesToRoutingTablePayloadWithDefaults() *AddRoutesToRoutingTablePayload { + this := AddRoutesToRoutingTablePayload{} + return &this +} + +// GetItems returns the Items field value +func (o *AddRoutesToRoutingTablePayload) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AddRoutesToRoutingTablePayload) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AddRoutesToRoutingTablePayload) SetItems(v []Route) { + o.Items = v +} + +func (o AddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddRoutesToRoutingTablePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AddRoutesToRoutingTablePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddRoutesToRoutingTablePayload := _AddRoutesToRoutingTablePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAddRoutesToRoutingTablePayload) + + if err != nil { + return err + } + + *o = AddRoutesToRoutingTablePayload(varAddRoutesToRoutingTablePayload) + + return err +} + +type NullableAddRoutesToRoutingTablePayload struct { + value *AddRoutesToRoutingTablePayload + isSet bool +} + +func (v NullableAddRoutesToRoutingTablePayload) Get() *AddRoutesToRoutingTablePayload { + return v.value +} + +func (v *NullableAddRoutesToRoutingTablePayload) Set(val *AddRoutesToRoutingTablePayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddRoutesToRoutingTablePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRoutesToRoutingTablePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRoutesToRoutingTablePayload(val *AddRoutesToRoutingTablePayload) *NullableAddRoutesToRoutingTablePayload { + return &NullableAddRoutesToRoutingTablePayload{value: val, isSet: true} +} + +func (v NullableAddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRoutesToRoutingTablePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_add_routing_table_to_area_payload.go b/services/iaas/v2api/model_add_routing_table_to_area_payload.go new file mode 100644 index 000000000..05e3ecd40 --- /dev/null +++ b/services/iaas/v2api/model_add_routing_table_to_area_payload.go @@ -0,0 +1,463 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the AddRoutingTableToAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRoutingTableToAreaPayload{} + +// AddRoutingTableToAreaPayload An object representing a routing table. +type AddRoutingTableToAreaPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. + Default *bool `json:"default,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _AddRoutingTableToAreaPayload AddRoutingTableToAreaPayload + +// NewAddRoutingTableToAreaPayload instantiates a new AddRoutingTableToAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRoutingTableToAreaPayload(name string) *AddRoutingTableToAreaPayload { + this := AddRoutingTableToAreaPayload{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + this.Name = name + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// NewAddRoutingTableToAreaPayloadWithDefaults instantiates a new AddRoutingTableToAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRoutingTableToAreaPayloadWithDefaults() *AddRoutingTableToAreaPayload { + this := AddRoutingTableToAreaPayload{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AddRoutingTableToAreaPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *AddRoutingTableToAreaPayload) SetDefault(v bool) { + o.Default = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AddRoutingTableToAreaPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *AddRoutingTableToAreaPayload) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AddRoutingTableToAreaPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *AddRoutingTableToAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *AddRoutingTableToAreaPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AddRoutingTableToAreaPayload) SetName(v string) { + o.Name = v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *AddRoutingTableToAreaPayload) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AddRoutingTableToAreaPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o AddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddRoutingTableToAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *AddRoutingTableToAreaPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddRoutingTableToAreaPayload := _AddRoutingTableToAreaPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAddRoutingTableToAreaPayload) + + if err != nil { + return err + } + + *o = AddRoutingTableToAreaPayload(varAddRoutingTableToAreaPayload) + + return err +} + +type NullableAddRoutingTableToAreaPayload struct { + value *AddRoutingTableToAreaPayload + isSet bool +} + +func (v NullableAddRoutingTableToAreaPayload) Get() *AddRoutingTableToAreaPayload { + return v.value +} + +func (v *NullableAddRoutingTableToAreaPayload) Set(val *AddRoutingTableToAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddRoutingTableToAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRoutingTableToAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRoutingTableToAreaPayload(val *AddRoutingTableToAreaPayload) *NullableAddRoutingTableToAreaPayload { + return &NullableAddRoutingTableToAreaPayload{value: val, isSet: true} +} + +func (v NullableAddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRoutingTableToAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_add_volume_to_server_payload.go b/services/iaas/v2api/model_add_volume_to_server_payload.go new file mode 100644 index 000000000..81ee8942f --- /dev/null +++ b/services/iaas/v2api/model_add_volume_to_server_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the AddVolumeToServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddVolumeToServerPayload{} + +// AddVolumeToServerPayload Object that represents a Volume attachment to a server. +type AddVolumeToServerPayload struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewAddVolumeToServerPayload instantiates a new AddVolumeToServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddVolumeToServerPayload() *AddVolumeToServerPayload { + this := AddVolumeToServerPayload{} + return &this +} + +// NewAddVolumeToServerPayloadWithDefaults instantiates a new AddVolumeToServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddVolumeToServerPayloadWithDefaults() *AddVolumeToServerPayload { + this := AddVolumeToServerPayload{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *AddVolumeToServerPayload) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *AddVolumeToServerPayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *AddVolumeToServerPayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o AddVolumeToServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddVolumeToServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableAddVolumeToServerPayload struct { + value *AddVolumeToServerPayload + isSet bool +} + +func (v NullableAddVolumeToServerPayload) Get() *AddVolumeToServerPayload { + return v.value +} + +func (v *NullableAddVolumeToServerPayload) Set(val *AddVolumeToServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddVolumeToServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddVolumeToServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddVolumeToServerPayload(val *AddVolumeToServerPayload) *NullableAddVolumeToServerPayload { + return &NullableAddVolumeToServerPayload{value: val, isSet: true} +} + +func (v NullableAddVolumeToServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddVolumeToServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_affinity_group.go b/services/iaas/v2api/model_affinity_group.go new file mode 100644 index 000000000..7960e2b99 --- /dev/null +++ b/services/iaas/v2api/model_affinity_group.go @@ -0,0 +1,261 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AffinityGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AffinityGroup{} + +// AffinityGroup Definition of an affinity group. +type AffinityGroup struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The servers that are part of the affinity group. + Members []string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. + Policy string `json:"policy"` +} + +type _AffinityGroup AffinityGroup + +// NewAffinityGroup instantiates a new AffinityGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAffinityGroup(name string, policy string) *AffinityGroup { + this := AffinityGroup{} + this.Name = name + this.Policy = policy + return &this +} + +// NewAffinityGroupWithDefaults instantiates a new AffinityGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAffinityGroupWithDefaults() *AffinityGroup { + this := AffinityGroup{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AffinityGroup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AffinityGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AffinityGroup) SetId(v string) { + o.Id = &v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *AffinityGroup) GetMembers() []string { + if o == nil || IsNil(o.Members) { + var ret []string + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetMembersOk() ([]string, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *AffinityGroup) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []string and assigns it to the Members field. +func (o *AffinityGroup) SetMembers(v []string) { + o.Members = v +} + +// GetName returns the Name field value +func (o *AffinityGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AffinityGroup) SetName(v string) { + o.Name = v +} + +// GetPolicy returns the Policy field value +func (o *AffinityGroup) GetPolicy() string { + if o == nil { + var ret string + return ret + } + + return o.Policy +} + +// GetPolicyOk returns a tuple with the Policy field value +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Policy, true +} + +// SetPolicy sets field value +func (o *AffinityGroup) SetPolicy(v string) { + o.Policy = v +} + +func (o AffinityGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AffinityGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + toSerialize["name"] = o.Name + toSerialize["policy"] = o.Policy + return toSerialize, nil +} + +func (o *AffinityGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "policy", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAffinityGroup := _AffinityGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAffinityGroup) + + if err != nil { + return err + } + + *o = AffinityGroup(varAffinityGroup) + + return err +} + +type NullableAffinityGroup struct { + value *AffinityGroup + isSet bool +} + +func (v NullableAffinityGroup) Get() *AffinityGroup { + return v.value +} + +func (v *NullableAffinityGroup) Set(val *AffinityGroup) { + v.value = val + v.isSet = true +} + +func (v NullableAffinityGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableAffinityGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAffinityGroup(val *AffinityGroup) *NullableAffinityGroup { + return &NullableAffinityGroup{value: val, isSet: true} +} + +func (v NullableAffinityGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAffinityGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_affinity_group_list_response.go b/services/iaas/v2api/model_affinity_group_list_response.go new file mode 100644 index 000000000..12ee697ea --- /dev/null +++ b/services/iaas/v2api/model_affinity_group_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AffinityGroupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AffinityGroupListResponse{} + +// AffinityGroupListResponse Response object for affinity group list request. +type AffinityGroupListResponse struct { + // A list of affinity groups. + Items []AffinityGroup `json:"items"` +} + +type _AffinityGroupListResponse AffinityGroupListResponse + +// NewAffinityGroupListResponse instantiates a new AffinityGroupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAffinityGroupListResponse(items []AffinityGroup) *AffinityGroupListResponse { + this := AffinityGroupListResponse{} + this.Items = items + return &this +} + +// NewAffinityGroupListResponseWithDefaults instantiates a new AffinityGroupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAffinityGroupListResponseWithDefaults() *AffinityGroupListResponse { + this := AffinityGroupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AffinityGroupListResponse) GetItems() []AffinityGroup { + if o == nil { + var ret []AffinityGroup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AffinityGroupListResponse) GetItemsOk() ([]AffinityGroup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AffinityGroupListResponse) SetItems(v []AffinityGroup) { + o.Items = v +} + +func (o AffinityGroupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AffinityGroupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AffinityGroupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAffinityGroupListResponse := _AffinityGroupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAffinityGroupListResponse) + + if err != nil { + return err + } + + *o = AffinityGroupListResponse(varAffinityGroupListResponse) + + return err +} + +type NullableAffinityGroupListResponse struct { + value *AffinityGroupListResponse + isSet bool +} + +func (v NullableAffinityGroupListResponse) Get() *AffinityGroupListResponse { + return v.value +} + +func (v *NullableAffinityGroupListResponse) Set(val *AffinityGroupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAffinityGroupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAffinityGroupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAffinityGroupListResponse(val *AffinityGroupListResponse) *NullableAffinityGroupListResponse { + return &NullableAffinityGroupListResponse{value: val, isSet: true} +} + +func (v NullableAffinityGroupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAffinityGroupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_allowed_addresses_inner.go b/services/iaas/v2api/model_allowed_addresses_inner.go new file mode 100644 index 000000000..da7ab7e48 --- /dev/null +++ b/services/iaas/v2api/model_allowed_addresses_inner.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// AllowedAddressesInner - struct for AllowedAddressesInner +type AllowedAddressesInner struct { + String *string +} + +// stringAsAllowedAddressesInner is a convenience function that returns string wrapped in AllowedAddressesInner +func StringAsAllowedAddressesInner(v *string) AllowedAddressesInner { + return AllowedAddressesInner{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *AllowedAddressesInner) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(AllowedAddressesInner)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(AllowedAddressesInner)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src AllowedAddressesInner) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *AllowedAddressesInner) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj AllowedAddressesInner) GetActualInstanceValue() interface{} { + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableAllowedAddressesInner struct { + value *AllowedAddressesInner + isSet bool +} + +func (v NullableAllowedAddressesInner) Get() *AllowedAddressesInner { + return v.value +} + +func (v *NullableAllowedAddressesInner) Set(val *AllowedAddressesInner) { + v.value = val + v.isSet = true +} + +func (v NullableAllowedAddressesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableAllowedAddressesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAllowedAddressesInner(val *AllowedAddressesInner) *NullableAllowedAddressesInner { + return &NullableAllowedAddressesInner{value: val, isSet: true} +} + +func (v NullableAllowedAddressesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAllowedAddressesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_area_id.go b/services/iaas/v2api/model_area_id.go new file mode 100644 index 000000000..3c516b052 --- /dev/null +++ b/services/iaas/v2api/model_area_id.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// AreaId - The identifier (ID) of an area. +type AreaId struct { + StaticAreaID *StaticAreaID + String *string +} + +// StaticAreaIDAsAreaId is a convenience function that returns StaticAreaID wrapped in AreaId +func StaticAreaIDAsAreaId(v *StaticAreaID) AreaId { + return AreaId{ + StaticAreaID: v, + } +} + +// stringAsAreaId is a convenience function that returns string wrapped in AreaId +func StringAsAreaId(v *string) AreaId { + return AreaId{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *AreaId) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StaticAreaID + err = json.Unmarshal(data, &dst.StaticAreaID) + if err == nil { + jsonStaticAreaID, _ := json.Marshal(dst.StaticAreaID) + if string(jsonStaticAreaID) == "{}" { // empty struct + dst.StaticAreaID = nil + } else { + match++ + } + } else { + dst.StaticAreaID = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StaticAreaID = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(AreaId)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(AreaId)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src AreaId) MarshalJSON() ([]byte, error) { + if src.StaticAreaID != nil { + return json.Marshal(&src.StaticAreaID) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *AreaId) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.StaticAreaID != nil { + return obj.StaticAreaID + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj AreaId) GetActualInstanceValue() interface{} { + if obj.StaticAreaID != nil { + return *obj.StaticAreaID + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableAreaId struct { + value *AreaId + isSet bool +} + +func (v NullableAreaId) Get() *AreaId { + return v.value +} + +func (v *NullableAreaId) Set(val *AreaId) { + v.value = val + v.isSet = true +} + +func (v NullableAreaId) IsSet() bool { + return v.isSet +} + +func (v *NullableAreaId) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAreaId(val *AreaId) *NullableAreaId { + return &NullableAreaId{value: val, isSet: true} +} + +func (v NullableAreaId) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAreaId) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_availability_zone_list_response.go b/services/iaas/v2api/model_availability_zone_list_response.go new file mode 100644 index 000000000..951d2e244 --- /dev/null +++ b/services/iaas/v2api/model_availability_zone_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AvailabilityZoneListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AvailabilityZoneListResponse{} + +// AvailabilityZoneListResponse Availability Zone list response. +type AvailabilityZoneListResponse struct { + // A list of availability zones. + Items []string `json:"items"` +} + +type _AvailabilityZoneListResponse AvailabilityZoneListResponse + +// NewAvailabilityZoneListResponse instantiates a new AvailabilityZoneListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAvailabilityZoneListResponse(items []string) *AvailabilityZoneListResponse { + this := AvailabilityZoneListResponse{} + this.Items = items + return &this +} + +// NewAvailabilityZoneListResponseWithDefaults instantiates a new AvailabilityZoneListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAvailabilityZoneListResponseWithDefaults() *AvailabilityZoneListResponse { + this := AvailabilityZoneListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AvailabilityZoneListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AvailabilityZoneListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AvailabilityZoneListResponse) SetItems(v []string) { + o.Items = v +} + +func (o AvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AvailabilityZoneListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AvailabilityZoneListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAvailabilityZoneListResponse := _AvailabilityZoneListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAvailabilityZoneListResponse) + + if err != nil { + return err + } + + *o = AvailabilityZoneListResponse(varAvailabilityZoneListResponse) + + return err +} + +type NullableAvailabilityZoneListResponse struct { + value *AvailabilityZoneListResponse + isSet bool +} + +func (v NullableAvailabilityZoneListResponse) Get() *AvailabilityZoneListResponse { + return v.value +} + +func (v *NullableAvailabilityZoneListResponse) Set(val *AvailabilityZoneListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAvailabilityZoneListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAvailabilityZoneListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAvailabilityZoneListResponse(val *AvailabilityZoneListResponse) *NullableAvailabilityZoneListResponse { + return &NullableAvailabilityZoneListResponse{value: val, isSet: true} +} + +func (v NullableAvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAvailabilityZoneListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_backup.go b/services/iaas/v2api/model_backup.go new file mode 100644 index 000000000..710e75e6b --- /dev/null +++ b/services/iaas/v2api/model_backup.go @@ -0,0 +1,497 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "time" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup Object that represents a backup. +type Backup struct { + // Object that represents an availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // Universally Unique Identifier (UUID). + SnapshotId *string `json:"snapshotId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup() *Backup { + this := Backup{} + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *Backup) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *Backup) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *Backup) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Backup) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Backup) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Backup) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *Backup) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *Backup) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *Backup) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Backup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Backup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Backup) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Backup) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Backup) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Backup) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Backup) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Backup) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Backup) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Backup) SetSize(v int64) { + o.Size = &v +} + +// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +func (o *Backup) GetSnapshotId() string { + if o == nil || IsNil(o.SnapshotId) { + var ret string + return ret + } + return *o.SnapshotId +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSnapshotIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotId) { + return nil, false + } + return o.SnapshotId, true +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *Backup) HasSnapshotId() bool { + if o != nil && !IsNil(o.SnapshotId) { + return true + } + + return false +} + +// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +func (o *Backup) SetSnapshotId(v string) { + o.SnapshotId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Backup) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Backup) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Backup) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Backup) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Backup) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Backup) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *Backup) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *Backup) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *Backup) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SnapshotId) { + toSerialize["snapshotId"] = o.SnapshotId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_backup_list_response.go b/services/iaas/v2api/model_backup_list_response.go new file mode 100644 index 000000000..0e9af94ae --- /dev/null +++ b/services/iaas/v2api/model_backup_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupListResponse{} + +// BackupListResponse Backup list response. +type BackupListResponse struct { + // A list containing backup objects. + Items []Backup `json:"items"` +} + +type _BackupListResponse BackupListResponse + +// NewBackupListResponse instantiates a new BackupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupListResponse(items []Backup) *BackupListResponse { + this := BackupListResponse{} + this.Items = items + return &this +} + +// NewBackupListResponseWithDefaults instantiates a new BackupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupListResponseWithDefaults() *BackupListResponse { + this := BackupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *BackupListResponse) GetItems() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *BackupListResponse) GetItemsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *BackupListResponse) SetItems(v []Backup) { + o.Items = v +} + +func (o BackupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *BackupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupListResponse := _BackupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupListResponse) + + if err != nil { + return err + } + + *o = BackupListResponse(varBackupListResponse) + + return err +} + +type NullableBackupListResponse struct { + value *BackupListResponse + isSet bool +} + +func (v NullableBackupListResponse) Get() *BackupListResponse { + return v.value +} + +func (v *NullableBackupListResponse) Set(val *BackupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBackupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupListResponse(val *BackupListResponse) *NullableBackupListResponse { + return &NullableBackupListResponse{value: val, isSet: true} +} + +func (v NullableBackupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_backup_source.go b/services/iaas/v2api/model_backup_source.go new file mode 100644 index 000000000..3fa20ab2f --- /dev/null +++ b/services/iaas/v2api/model_backup_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupSource{} + +// BackupSource The source object of a backup. +type BackupSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a backup. Possible values: `volume`, `snapshot`. + Type string `json:"type"` +} + +type _BackupSource BackupSource + +// NewBackupSource instantiates a new BackupSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupSource(id string, types string) *BackupSource { + this := BackupSource{} + this.Id = id + this.Type = types + return &this +} + +// NewBackupSourceWithDefaults instantiates a new BackupSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupSourceWithDefaults() *BackupSource { + this := BackupSource{} + return &this +} + +// GetId returns the Id field value +func (o *BackupSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BackupSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BackupSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *BackupSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BackupSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BackupSource) SetType(v string) { + o.Type = v +} + +func (o BackupSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BackupSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupSource := _BackupSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupSource) + + if err != nil { + return err + } + + *o = BackupSource(varBackupSource) + + return err +} + +type NullableBackupSource struct { + value *BackupSource + isSet bool +} + +func (v NullableBackupSource) Get() *BackupSource { + return v.value +} + +func (v *NullableBackupSource) Set(val *BackupSource) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSource) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSource(val *BackupSource) *NullableBackupSource { + return &NullableBackupSource{value: val, isSet: true} +} + +func (v NullableBackupSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_base_security_group_rule.go b/services/iaas/v2api/model_base_security_group_rule.go new file mode 100644 index 000000000..606c20544 --- /dev/null +++ b/services/iaas/v2api/model_base_security_group_rule.go @@ -0,0 +1,531 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the BaseSecurityGroupRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BaseSecurityGroupRule{} + +// BaseSecurityGroupRule The base schema for a security group rule. +type BaseSecurityGroupRule struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _BaseSecurityGroupRule BaseSecurityGroupRule + +// NewBaseSecurityGroupRule instantiates a new BaseSecurityGroupRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBaseSecurityGroupRule(direction string) *BaseSecurityGroupRule { + this := BaseSecurityGroupRule{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewBaseSecurityGroupRuleWithDefaults instantiates a new BaseSecurityGroupRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBaseSecurityGroupRuleWithDefaults() *BaseSecurityGroupRule { + this := BaseSecurityGroupRule{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *BaseSecurityGroupRule) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *BaseSecurityGroupRule) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *BaseSecurityGroupRule) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *BaseSecurityGroupRule) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *BaseSecurityGroupRule) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *BaseSecurityGroupRule) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BaseSecurityGroupRule) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *BaseSecurityGroupRule) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *BaseSecurityGroupRule) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *BaseSecurityGroupRule) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *BaseSecurityGroupRule) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *BaseSecurityGroupRule) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o BaseSecurityGroupRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BaseSecurityGroupRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *BaseSecurityGroupRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBaseSecurityGroupRule := _BaseSecurityGroupRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBaseSecurityGroupRule) + + if err != nil { + return err + } + + *o = BaseSecurityGroupRule(varBaseSecurityGroupRule) + + return err +} + +type NullableBaseSecurityGroupRule struct { + value *BaseSecurityGroupRule + isSet bool +} + +func (v NullableBaseSecurityGroupRule) Get() *BaseSecurityGroupRule { + return v.value +} + +func (v *NullableBaseSecurityGroupRule) Set(val *BaseSecurityGroupRule) { + v.value = val + v.isSet = true +} + +func (v NullableBaseSecurityGroupRule) IsSet() bool { + return v.isSet +} + +func (v *NullableBaseSecurityGroupRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBaseSecurityGroupRule(val *BaseSecurityGroupRule) *NullableBaseSecurityGroupRule { + return &NullableBaseSecurityGroupRule{value: val, isSet: true} +} + +func (v NullableBaseSecurityGroupRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBaseSecurityGroupRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_boot_volume.go b/services/iaas/v2api/model_boot_volume.go new file mode 100644 index 000000000..577ed3152 --- /dev/null +++ b/services/iaas/v2api/model_boot_volume.go @@ -0,0 +1,273 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the BootVolume type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BootVolume{} + +// BootVolume The boot device for the server. +type BootVolume struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *BootVolumeSource `json:"source,omitempty"` +} + +// NewBootVolume instantiates a new BootVolume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBootVolume() *BootVolume { + this := BootVolume{} + return &this +} + +// NewBootVolumeWithDefaults instantiates a new BootVolume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBootVolumeWithDefaults() *BootVolume { + this := BootVolume{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *BootVolume) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *BootVolume) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *BootVolume) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BootVolume) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BootVolume) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BootVolume) SetId(v string) { + o.Id = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *BootVolume) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *BootVolume) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *BootVolume) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *BootVolume) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *BootVolume) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *BootVolume) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *BootVolume) GetSource() BootVolumeSource { + if o == nil || IsNil(o.Source) { + var ret BootVolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetSourceOk() (*BootVolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *BootVolume) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. +func (o *BootVolume) SetSource(v BootVolumeSource) { + o.Source = &v +} + +func (o BootVolume) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BootVolume) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + return toSerialize, nil +} + +type NullableBootVolume struct { + value *BootVolume + isSet bool +} + +func (v NullableBootVolume) Get() *BootVolume { + return v.value +} + +func (v *NullableBootVolume) Set(val *BootVolume) { + v.value = val + v.isSet = true +} + +func (v NullableBootVolume) IsSet() bool { + return v.isSet +} + +func (v *NullableBootVolume) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBootVolume(val *BootVolume) *NullableBootVolume { + return &NullableBootVolume{value: val, isSet: true} +} + +func (v NullableBootVolume) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBootVolume) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_boot_volume_source.go b/services/iaas/v2api/model_boot_volume_source.go new file mode 100644 index 000000000..55b36d71b --- /dev/null +++ b/services/iaas/v2api/model_boot_volume_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BootVolumeSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BootVolumeSource{} + +// BootVolumeSource The source object of a boot volume. +type BootVolumeSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a boot volume. Possible values: `image`, `volume`. + Type string `json:"type"` +} + +type _BootVolumeSource BootVolumeSource + +// NewBootVolumeSource instantiates a new BootVolumeSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBootVolumeSource(id string, types string) *BootVolumeSource { + this := BootVolumeSource{} + this.Id = id + this.Type = types + return &this +} + +// NewBootVolumeSourceWithDefaults instantiates a new BootVolumeSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBootVolumeSourceWithDefaults() *BootVolumeSource { + this := BootVolumeSource{} + return &this +} + +// GetId returns the Id field value +func (o *BootVolumeSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BootVolumeSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BootVolumeSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *BootVolumeSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BootVolumeSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BootVolumeSource) SetType(v string) { + o.Type = v +} + +func (o BootVolumeSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BootVolumeSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BootVolumeSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBootVolumeSource := _BootVolumeSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBootVolumeSource) + + if err != nil { + return err + } + + *o = BootVolumeSource(varBootVolumeSource) + + return err +} + +type NullableBootVolumeSource struct { + value *BootVolumeSource + isSet bool +} + +func (v NullableBootVolumeSource) Get() *BootVolumeSource { + return v.value +} + +func (v *NullableBootVolumeSource) Set(val *BootVolumeSource) { + v.value = val + v.isSet = true +} + +func (v NullableBootVolumeSource) IsSet() bool { + return v.isSet +} + +func (v *NullableBootVolumeSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBootVolumeSource(val *BootVolumeSource) *NullableBootVolumeSource { + return &NullableBootVolumeSource{value: val, isSet: true} +} + +func (v NullableBootVolumeSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBootVolumeSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_affinity_group_payload.go b/services/iaas/v2api/model_create_affinity_group_payload.go new file mode 100644 index 000000000..1d4bf6448 --- /dev/null +++ b/services/iaas/v2api/model_create_affinity_group_payload.go @@ -0,0 +1,261 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateAffinityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAffinityGroupPayload{} + +// CreateAffinityGroupPayload Definition of an affinity group. +type CreateAffinityGroupPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The servers that are part of the affinity group. + Members []string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. + Policy string `json:"policy"` +} + +type _CreateAffinityGroupPayload CreateAffinityGroupPayload + +// NewCreateAffinityGroupPayload instantiates a new CreateAffinityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAffinityGroupPayload(name string, policy string) *CreateAffinityGroupPayload { + this := CreateAffinityGroupPayload{} + this.Name = name + this.Policy = policy + return &this +} + +// NewCreateAffinityGroupPayloadWithDefaults instantiates a new CreateAffinityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAffinityGroupPayloadWithDefaults() *CreateAffinityGroupPayload { + this := CreateAffinityGroupPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateAffinityGroupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateAffinityGroupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateAffinityGroupPayload) SetId(v string) { + o.Id = &v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *CreateAffinityGroupPayload) GetMembers() []string { + if o == nil || IsNil(o.Members) { + var ret []string + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetMembersOk() ([]string, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *CreateAffinityGroupPayload) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []string and assigns it to the Members field. +func (o *CreateAffinityGroupPayload) SetMembers(v []string) { + o.Members = v +} + +// GetName returns the Name field value +func (o *CreateAffinityGroupPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateAffinityGroupPayload) SetName(v string) { + o.Name = v +} + +// GetPolicy returns the Policy field value +func (o *CreateAffinityGroupPayload) GetPolicy() string { + if o == nil { + var ret string + return ret + } + + return o.Policy +} + +// GetPolicyOk returns a tuple with the Policy field value +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Policy, true +} + +// SetPolicy sets field value +func (o *CreateAffinityGroupPayload) SetPolicy(v string) { + o.Policy = v +} + +func (o CreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + toSerialize["name"] = o.Name + toSerialize["policy"] = o.Policy + return toSerialize, nil +} + +func (o *CreateAffinityGroupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "policy", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateAffinityGroupPayload := _CreateAffinityGroupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateAffinityGroupPayload) + + if err != nil { + return err + } + + *o = CreateAffinityGroupPayload(varCreateAffinityGroupPayload) + + return err +} + +type NullableCreateAffinityGroupPayload struct { + value *CreateAffinityGroupPayload + isSet bool +} + +func (v NullableCreateAffinityGroupPayload) Get() *CreateAffinityGroupPayload { + return v.value +} + +func (v *NullableCreateAffinityGroupPayload) Set(val *CreateAffinityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAffinityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAffinityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAffinityGroupPayload(val *CreateAffinityGroupPayload) *NullableCreateAffinityGroupPayload { + return &NullableCreateAffinityGroupPayload{value: val, isSet: true} +} + +func (v NullableCreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAffinityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_backup_payload.go b/services/iaas/v2api/model_create_backup_payload.go new file mode 100644 index 000000000..66f25ca9b --- /dev/null +++ b/services/iaas/v2api/model_create_backup_payload.go @@ -0,0 +1,231 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupPayload{} + +// CreateBackupPayload Object that represents a backup create request body. +type CreateBackupPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + Source BackupSource `json:"source"` +} + +type _CreateBackupPayload CreateBackupPayload + +// NewCreateBackupPayload instantiates a new CreateBackupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupPayload(source BackupSource) *CreateBackupPayload { + this := CreateBackupPayload{} + this.Source = source + return &this +} + +// NewCreateBackupPayloadWithDefaults instantiates a new CreateBackupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { + this := CreateBackupPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateBackupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateBackupPayload) SetName(v string) { + o.Name = &v +} + +// GetSource returns the Source field value +func (o *CreateBackupPayload) GetSource() BackupSource { + if o == nil { + var ret BackupSource + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetSourceOk() (*BackupSource, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *CreateBackupPayload) SetSource(v BackupSource) { + o.Source = v +} + +func (o CreateBackupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["source"] = o.Source + return toSerialize, nil +} + +func (o *CreateBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupPayload := _CreateBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateBackupPayload) + + if err != nil { + return err + } + + *o = CreateBackupPayload(varCreateBackupPayload) + + return err +} + +type NullableCreateBackupPayload struct { + value *CreateBackupPayload + isSet bool +} + +func (v NullableCreateBackupPayload) Get() *CreateBackupPayload { + return v.value +} + +func (v *NullableCreateBackupPayload) Set(val *CreateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupPayload(val *CreateBackupPayload) *NullableCreateBackupPayload { + return &NullableCreateBackupPayload{value: val, isSet: true} +} + +func (v NullableCreateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_image_payload.go b/services/iaas/v2api/model_create_image_payload.go new file mode 100644 index 000000000..507f5b506 --- /dev/null +++ b/services/iaas/v2api/model_create_image_payload.go @@ -0,0 +1,740 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateImagePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateImagePayload{} + +// CreateImagePayload Object that represents an Image and its parameters. Used for Creating and returning (get/list). +type CreateImagePayload struct { + Agent *ImageAgent `json:"agent,omitempty"` + Checksum *ImageChecksum `json:"checksum,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat string `json:"diskFormat"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Indicates Image Import Progress in percent. + ImportProgress *int64 `json:"importProgress,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + Owner *string `json:"owner,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` + // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. + Scope *string `json:"scope,omitempty"` + // Size in bytes. + Size *int64 `json:"size,omitempty"` + // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateImagePayload CreateImagePayload + +// NewCreateImagePayload instantiates a new CreateImagePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateImagePayload(diskFormat string, name string) *CreateImagePayload { + this := CreateImagePayload{} + this.DiskFormat = diskFormat + this.Name = name + return &this +} + +// NewCreateImagePayloadWithDefaults instantiates a new CreateImagePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateImagePayloadWithDefaults() *CreateImagePayload { + this := CreateImagePayload{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *CreateImagePayload) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *CreateImagePayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *CreateImagePayload) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *CreateImagePayload) GetChecksum() ImageChecksum { + if o == nil || IsNil(o.Checksum) { + var ret ImageChecksum + return ret + } + return *o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetChecksumOk() (*ImageChecksum, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *CreateImagePayload) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +func (o *CreateImagePayload) SetChecksum(v ImageChecksum) { + o.Checksum = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *CreateImagePayload) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *CreateImagePayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *CreateImagePayload) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateImagePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateImagePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateImagePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDiskFormat returns the DiskFormat field value +func (o *CreateImagePayload) GetDiskFormat() string { + if o == nil { + var ret string + return ret + } + + return o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetDiskFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DiskFormat, true +} + +// SetDiskFormat sets field value +func (o *CreateImagePayload) SetDiskFormat(v string) { + o.DiskFormat = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateImagePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateImagePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateImagePayload) SetId(v string) { + o.Id = &v +} + +// GetImportProgress returns the ImportProgress field value if set, zero value otherwise. +func (o *CreateImagePayload) GetImportProgress() int64 { + if o == nil || IsNil(o.ImportProgress) { + var ret int64 + return ret + } + return *o.ImportProgress +} + +// GetImportProgressOk returns a tuple with the ImportProgress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetImportProgressOk() (*int64, bool) { + if o == nil || IsNil(o.ImportProgress) { + return nil, false + } + return o.ImportProgress, true +} + +// HasImportProgress returns a boolean if a field has been set. +func (o *CreateImagePayload) HasImportProgress() bool { + if o != nil && !IsNil(o.ImportProgress) { + return true + } + + return false +} + +// SetImportProgress gets a reference to the given int64 and assigns it to the ImportProgress field. +func (o *CreateImagePayload) SetImportProgress(v int64) { + o.ImportProgress = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateImagePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateImagePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateImagePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *CreateImagePayload) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *CreateImagePayload) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *CreateImagePayload) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *CreateImagePayload) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *CreateImagePayload) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *CreateImagePayload) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value +func (o *CreateImagePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateImagePayload) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *CreateImagePayload) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *CreateImagePayload) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *CreateImagePayload) SetOwner(v string) { + o.Owner = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *CreateImagePayload) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *CreateImagePayload) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *CreateImagePayload) SetProtected(v bool) { + o.Protected = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *CreateImagePayload) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *CreateImagePayload) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *CreateImagePayload) SetScope(v string) { + o.Scope = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateImagePayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateImagePayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateImagePayload) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateImagePayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateImagePayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateImagePayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateImagePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateImagePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateImagePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateImagePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["diskFormat"] = o.DiskFormat + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImportProgress) { + toSerialize["importProgress"] = o.ImportProgress + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateImagePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "diskFormat", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateImagePayload := _CreateImagePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateImagePayload) + + if err != nil { + return err + } + + *o = CreateImagePayload(varCreateImagePayload) + + return err +} + +type NullableCreateImagePayload struct { + value *CreateImagePayload + isSet bool +} + +func (v NullableCreateImagePayload) Get() *CreateImagePayload { + return v.value +} + +func (v *NullableCreateImagePayload) Set(val *CreateImagePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateImagePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateImagePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateImagePayload(val *CreateImagePayload) *NullableCreateImagePayload { + return &NullableCreateImagePayload{value: val, isSet: true} +} + +func (v NullableCreateImagePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateImagePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_isolated_network_payload.go b/services/iaas/v2api/model_create_isolated_network_payload.go new file mode 100644 index 000000000..1cba15ed9 --- /dev/null +++ b/services/iaas/v2api/model_create_isolated_network_payload.go @@ -0,0 +1,272 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateIsolatedNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateIsolatedNetworkPayload{} + +// CreateIsolatedNetworkPayload Object that represents the request body for a single isolated network create. +type CreateIsolatedNetworkPayload struct { + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + Ipv4 *CreateNetworkIPv4 `json:"ipv4,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +type _CreateIsolatedNetworkPayload CreateIsolatedNetworkPayload + +// NewCreateIsolatedNetworkPayload instantiates a new CreateIsolatedNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateIsolatedNetworkPayload(name string) *CreateIsolatedNetworkPayload { + this := CreateIsolatedNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + this.Name = name + return &this +} + +// NewCreateIsolatedNetworkPayloadWithDefaults instantiates a new CreateIsolatedNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateIsolatedNetworkPayloadWithDefaults() *CreateIsolatedNetworkPayload { + this := CreateIsolatedNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + return &this +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *CreateIsolatedNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateIsolatedNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *CreateIsolatedNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *CreateIsolatedNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateIsolatedNetworkPayload) GetIpv4() CreateNetworkIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret CreateNetworkIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateIsolatedNetworkPayload) GetIpv4Ok() (*CreateNetworkIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateIsolatedNetworkPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. +func (o *CreateIsolatedNetworkPayload) SetIpv4(v CreateNetworkIPv4) { + o.Ipv4 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateIsolatedNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateIsolatedNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateIsolatedNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateIsolatedNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateIsolatedNetworkPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateIsolatedNetworkPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateIsolatedNetworkPayload) SetName(v string) { + o.Name = v +} + +func (o CreateIsolatedNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateIsolatedNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *CreateIsolatedNetworkPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateIsolatedNetworkPayload := _CreateIsolatedNetworkPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateIsolatedNetworkPayload) + + if err != nil { + return err + } + + *o = CreateIsolatedNetworkPayload(varCreateIsolatedNetworkPayload) + + return err +} + +type NullableCreateIsolatedNetworkPayload struct { + value *CreateIsolatedNetworkPayload + isSet bool +} + +func (v NullableCreateIsolatedNetworkPayload) Get() *CreateIsolatedNetworkPayload { + return v.value +} + +func (v *NullableCreateIsolatedNetworkPayload) Set(val *CreateIsolatedNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateIsolatedNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateIsolatedNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateIsolatedNetworkPayload(val *CreateIsolatedNetworkPayload) *NullableCreateIsolatedNetworkPayload { + return &NullableCreateIsolatedNetworkPayload{value: val, isSet: true} +} + +func (v NullableCreateIsolatedNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateIsolatedNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_key_pair_payload.go b/services/iaas/v2api/model_create_key_pair_payload.go new file mode 100644 index 000000000..59b8e9b74 --- /dev/null +++ b/services/iaas/v2api/model_create_key_pair_payload.go @@ -0,0 +1,344 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateKeyPairPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateKeyPairPayload{} + +// CreateKeyPairPayload Object that represents the public key of an SSH keypair and its name. +type CreateKeyPairPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents an SSH keypair MD5 fingerprint. + Fingerprint *string `json:"fingerprint,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // Object that represents a public SSH key. + PublicKey string `json:"publicKey" validate:"regexp=^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\\\\s+[A-Za-z0-9+\\/]+[=]{0,3}(\\\\s+.+)?\\\\s*$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateKeyPairPayload CreateKeyPairPayload + +// NewCreateKeyPairPayload instantiates a new CreateKeyPairPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateKeyPairPayload(publicKey string) *CreateKeyPairPayload { + this := CreateKeyPairPayload{} + this.PublicKey = publicKey + return &this +} + +// NewCreateKeyPairPayloadWithDefaults instantiates a new CreateKeyPairPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateKeyPairPayloadWithDefaults() *CreateKeyPairPayload { + this := CreateKeyPairPayload{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateKeyPairPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetFingerprint() string { + if o == nil || IsNil(o.Fingerprint) { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetFingerprintOk() (*string, bool) { + if o == nil || IsNil(o.Fingerprint) { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasFingerprint() bool { + if o != nil && !IsNil(o.Fingerprint) { + return true + } + + return false +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *CreateKeyPairPayload) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateKeyPairPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateKeyPairPayload) SetName(v string) { + o.Name = &v +} + +// GetPublicKey returns the PublicKey field value +func (o *CreateKeyPairPayload) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *CreateKeyPairPayload) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateKeyPairPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateKeyPairPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateKeyPairPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Fingerprint) { + toSerialize["fingerprint"] = o.Fingerprint + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["publicKey"] = o.PublicKey + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateKeyPairPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "publicKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateKeyPairPayload := _CreateKeyPairPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateKeyPairPayload) + + if err != nil { + return err + } + + *o = CreateKeyPairPayload(varCreateKeyPairPayload) + + return err +} + +type NullableCreateKeyPairPayload struct { + value *CreateKeyPairPayload + isSet bool +} + +func (v NullableCreateKeyPairPayload) Get() *CreateKeyPairPayload { + return v.value +} + +func (v *NullableCreateKeyPairPayload) Set(val *CreateKeyPairPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateKeyPairPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateKeyPairPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateKeyPairPayload(val *CreateKeyPairPayload) *NullableCreateKeyPairPayload { + return &NullableCreateKeyPairPayload{value: val, isSet: true} +} + +func (v NullableCreateKeyPairPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateKeyPairPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_area_payload.go b/services/iaas/v2api/model_create_network_area_payload.go new file mode 100644 index 000000000..fc2195257 --- /dev/null +++ b/services/iaas/v2api/model_create_network_area_payload.go @@ -0,0 +1,194 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaPayload{} + +// CreateNetworkAreaPayload Object that represents the network area create request. +type CreateNetworkAreaPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` +} + +type _CreateNetworkAreaPayload CreateNetworkAreaPayload + +// NewCreateNetworkAreaPayload instantiates a new CreateNetworkAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaPayload(name string) *CreateNetworkAreaPayload { + this := CreateNetworkAreaPayload{} + this.Name = name + return &this +} + +// NewCreateNetworkAreaPayloadWithDefaults instantiates a new CreateNetworkAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaPayloadWithDefaults() *CreateNetworkAreaPayload { + this := CreateNetworkAreaPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkAreaPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkAreaPayload) SetName(v string) { + o.Name = v +} + +func (o CreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *CreateNetworkAreaPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkAreaPayload := _CreateNetworkAreaPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkAreaPayload) + + if err != nil { + return err + } + + *o = CreateNetworkAreaPayload(varCreateNetworkAreaPayload) + + return err +} + +type NullableCreateNetworkAreaPayload struct { + value *CreateNetworkAreaPayload + isSet bool +} + +func (v NullableCreateNetworkAreaPayload) Get() *CreateNetworkAreaPayload { + return v.value +} + +func (v *NullableCreateNetworkAreaPayload) Set(val *CreateNetworkAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaPayload(val *CreateNetworkAreaPayload) *NullableCreateNetworkAreaPayload { + return &NullableCreateNetworkAreaPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_area_range_payload.go b/services/iaas/v2api/model_create_network_area_range_payload.go new file mode 100644 index 000000000..b3274155c --- /dev/null +++ b/services/iaas/v2api/model_create_network_area_range_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateNetworkAreaRangePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRangePayload{} + +// CreateNetworkAreaRangePayload struct for CreateNetworkAreaRangePayload +type CreateNetworkAreaRangePayload struct { + // A list of network ranges. + Ipv4 []NetworkRange `json:"ipv4,omitempty"` +} + +// NewCreateNetworkAreaRangePayload instantiates a new CreateNetworkAreaRangePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaRangePayload() *CreateNetworkAreaRangePayload { + this := CreateNetworkAreaRangePayload{} + return &this +} + +// NewCreateNetworkAreaRangePayloadWithDefaults instantiates a new CreateNetworkAreaRangePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaRangePayloadWithDefaults() *CreateNetworkAreaRangePayload { + this := CreateNetworkAreaRangePayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAreaRangePayload) GetIpv4() []NetworkRange { + if o == nil || IsNil(o.Ipv4) { + var ret []NetworkRange + return ret + } + return o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRangePayload) GetIpv4Ok() ([]NetworkRange, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAreaRangePayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given []NetworkRange and assigns it to the Ipv4 field. +func (o *CreateNetworkAreaRangePayload) SetIpv4(v []NetworkRange) { + o.Ipv4 = v +} + +func (o CreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaRangePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableCreateNetworkAreaRangePayload struct { + value *CreateNetworkAreaRangePayload + isSet bool +} + +func (v NullableCreateNetworkAreaRangePayload) Get() *CreateNetworkAreaRangePayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRangePayload) Set(val *CreateNetworkAreaRangePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRangePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRangePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRangePayload(val *CreateNetworkAreaRangePayload) *NullableCreateNetworkAreaRangePayload { + return &NullableCreateNetworkAreaRangePayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRangePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_area_region_payload.go b/services/iaas/v2api/model_create_network_area_region_payload.go new file mode 100644 index 000000000..7e6a79dbc --- /dev/null +++ b/services/iaas/v2api/model_create_network_area_region_payload.go @@ -0,0 +1,162 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateNetworkAreaRegionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRegionPayload{} + +// CreateNetworkAreaRegionPayload The basic properties of a regional network area. +type CreateNetworkAreaRegionPayload struct { + Ipv4 *RegionalAreaIPv4 `json:"ipv4,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status *string `json:"status,omitempty"` +} + +// NewCreateNetworkAreaRegionPayload instantiates a new CreateNetworkAreaRegionPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaRegionPayload() *CreateNetworkAreaRegionPayload { + this := CreateNetworkAreaRegionPayload{} + return &this +} + +// NewCreateNetworkAreaRegionPayloadWithDefaults instantiates a new CreateNetworkAreaRegionPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaRegionPayloadWithDefaults() *CreateNetworkAreaRegionPayload { + this := CreateNetworkAreaRegionPayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAreaRegionPayload) GetIpv4() RegionalAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret RegionalAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRegionPayload) GetIpv4Ok() (*RegionalAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAreaRegionPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given RegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *CreateNetworkAreaRegionPayload) SetIpv4(v RegionalAreaIPv4) { + o.Ipv4 = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateNetworkAreaRegionPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRegionPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateNetworkAreaRegionPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateNetworkAreaRegionPayload) SetStatus(v string) { + o.Status = &v +} + +func (o CreateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableCreateNetworkAreaRegionPayload struct { + value *CreateNetworkAreaRegionPayload + isSet bool +} + +func (v NullableCreateNetworkAreaRegionPayload) Get() *CreateNetworkAreaRegionPayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRegionPayload) Set(val *CreateNetworkAreaRegionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRegionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRegionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRegionPayload(val *CreateNetworkAreaRegionPayload) *NullableCreateNetworkAreaRegionPayload { + return &NullableCreateNetworkAreaRegionPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRegionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_area_route_payload.go b/services/iaas/v2api/model_create_network_area_route_payload.go new file mode 100644 index 000000000..6b37f5f3f --- /dev/null +++ b/services/iaas/v2api/model_create_network_area_route_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRoutePayload{} + +// CreateNetworkAreaRoutePayload Object represents a request to add network routes. +type CreateNetworkAreaRoutePayload struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _CreateNetworkAreaRoutePayload CreateNetworkAreaRoutePayload + +// NewCreateNetworkAreaRoutePayload instantiates a new CreateNetworkAreaRoutePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaRoutePayload(items []Route) *CreateNetworkAreaRoutePayload { + this := CreateNetworkAreaRoutePayload{} + this.Items = items + return &this +} + +// NewCreateNetworkAreaRoutePayloadWithDefaults instantiates a new CreateNetworkAreaRoutePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaRoutePayloadWithDefaults() *CreateNetworkAreaRoutePayload { + this := CreateNetworkAreaRoutePayload{} + return &this +} + +// GetItems returns the Items field value +func (o *CreateNetworkAreaRoutePayload) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRoutePayload) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *CreateNetworkAreaRoutePayload) SetItems(v []Route) { + o.Items = v +} + +func (o CreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *CreateNetworkAreaRoutePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkAreaRoutePayload := _CreateNetworkAreaRoutePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkAreaRoutePayload) + + if err != nil { + return err + } + + *o = CreateNetworkAreaRoutePayload(varCreateNetworkAreaRoutePayload) + + return err +} + +type NullableCreateNetworkAreaRoutePayload struct { + value *CreateNetworkAreaRoutePayload + isSet bool +} + +func (v NullableCreateNetworkAreaRoutePayload) Get() *CreateNetworkAreaRoutePayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRoutePayload) Set(val *CreateNetworkAreaRoutePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRoutePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRoutePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRoutePayload(val *CreateNetworkAreaRoutePayload) *NullableCreateNetworkAreaRoutePayload { + return &NullableCreateNetworkAreaRoutePayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_ipv4.go b/services/iaas/v2api/model_create_network_ipv4.go new file mode 100644 index 000000000..056a26741 --- /dev/null +++ b/services/iaas/v2api/model_create_network_ipv4.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateNetworkIPv4 - The create request for an IPv4 network. +type CreateNetworkIPv4 struct { + CreateNetworkIPv4WithPrefix *CreateNetworkIPv4WithPrefix + CreateNetworkIPv4WithPrefixLength *CreateNetworkIPv4WithPrefixLength +} + +// CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefix wrapped in CreateNetworkIPv4 +func CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefix) CreateNetworkIPv4 { + return CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefix: v, + } +} + +// CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefixLength wrapped in CreateNetworkIPv4 +func CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefixLength) CreateNetworkIPv4 { + return CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefixLength: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateNetworkIPv4) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateNetworkIPv4WithPrefix + err = json.Unmarshal(data, &dst.CreateNetworkIPv4WithPrefix) + if err == nil { + jsonCreateNetworkIPv4WithPrefix, _ := json.Marshal(dst.CreateNetworkIPv4WithPrefix) + if string(jsonCreateNetworkIPv4WithPrefix) == "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefix = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv4WithPrefix = nil + } + + // try to unmarshal data into CreateNetworkIPv4WithPrefixLength + err = json.Unmarshal(data, &dst.CreateNetworkIPv4WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv4WithPrefixLength, _ := json.Marshal(dst.CreateNetworkIPv4WithPrefixLength) + if string(jsonCreateNetworkIPv4WithPrefixLength) == "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefixLength = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv4WithPrefixLength = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateNetworkIPv4WithPrefix = nil + dst.CreateNetworkIPv4WithPrefixLength = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateNetworkIPv4)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv4)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateNetworkIPv4) MarshalJSON() ([]byte, error) { + if src.CreateNetworkIPv4WithPrefix != nil { + return json.Marshal(&src.CreateNetworkIPv4WithPrefix) + } + + if src.CreateNetworkIPv4WithPrefixLength != nil { + return json.Marshal(&src.CreateNetworkIPv4WithPrefixLength) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateNetworkIPv4) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateNetworkIPv4WithPrefix != nil { + return obj.CreateNetworkIPv4WithPrefix + } + + if obj.CreateNetworkIPv4WithPrefixLength != nil { + return obj.CreateNetworkIPv4WithPrefixLength + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateNetworkIPv4) GetActualInstanceValue() interface{} { + if obj.CreateNetworkIPv4WithPrefix != nil { + return *obj.CreateNetworkIPv4WithPrefix + } + + if obj.CreateNetworkIPv4WithPrefixLength != nil { + return *obj.CreateNetworkIPv4WithPrefixLength + } + + // all schemas are nil + return nil +} + +type NullableCreateNetworkIPv4 struct { + value *CreateNetworkIPv4 + isSet bool +} + +func (v NullableCreateNetworkIPv4) Get() *CreateNetworkIPv4 { + return v.value +} + +func (v *NullableCreateNetworkIPv4) Set(val *CreateNetworkIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4(val *CreateNetworkIPv4) *NullableCreateNetworkIPv4 { + return &NullableCreateNetworkIPv4{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_ipv4_with_prefix.go b/services/iaas/v2api/model_create_network_ipv4_with_prefix.go new file mode 100644 index 000000000..9f1c6ac00 --- /dev/null +++ b/services/iaas/v2api/model_create_network_ipv4_with_prefix.go @@ -0,0 +1,243 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv4WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefix{} + +// CreateNetworkIPv4WithPrefix The create request for an IPv4 network with a specified prefix. +type CreateNetworkIPv4WithPrefix struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + // IPv4 Classless Inter-Domain Routing (CIDR). + Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` +} + +type _CreateNetworkIPv4WithPrefix CreateNetworkIPv4WithPrefix + +// NewCreateNetworkIPv4WithPrefix instantiates a new CreateNetworkIPv4WithPrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4WithPrefix(prefix string) *CreateNetworkIPv4WithPrefix { + this := CreateNetworkIPv4WithPrefix{} + this.Prefix = prefix + return &this +} + +// NewCreateNetworkIPv4WithPrefixWithDefaults instantiates a new CreateNetworkIPv4WithPrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4WithPrefixWithDefaults() *CreateNetworkIPv4WithPrefix { + this := CreateNetworkIPv4WithPrefix{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv4WithPrefix) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv4WithPrefix) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefix) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *CreateNetworkIPv4WithPrefix) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv4WithPrefix) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv4WithPrefix) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4WithPrefix) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefix) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefix) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4WithPrefix) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value +func (o *CreateNetworkIPv4WithPrefix) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefix) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *CreateNetworkIPv4WithPrefix) SetPrefix(v string) { + o.Prefix = v +} + +func (o CreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv4WithPrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefix"] = o.Prefix + return toSerialize, nil +} + +func (o *CreateNetworkIPv4WithPrefix) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv4WithPrefix := _CreateNetworkIPv4WithPrefix{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv4WithPrefix) + + if err != nil { + return err + } + + *o = CreateNetworkIPv4WithPrefix(varCreateNetworkIPv4WithPrefix) + + return err +} + +type NullableCreateNetworkIPv4WithPrefix struct { + value *CreateNetworkIPv4WithPrefix + isSet bool +} + +func (v NullableCreateNetworkIPv4WithPrefix) Get() *CreateNetworkIPv4WithPrefix { + return v.value +} + +func (v *NullableCreateNetworkIPv4WithPrefix) Set(val *CreateNetworkIPv4WithPrefix) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4WithPrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4WithPrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4WithPrefix(val *CreateNetworkIPv4WithPrefix) *NullableCreateNetworkIPv4WithPrefix { + return &NullableCreateNetworkIPv4WithPrefix{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4WithPrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_ipv4_with_prefix_length.go b/services/iaas/v2api/model_create_network_ipv4_with_prefix_length.go new file mode 100644 index 000000000..c35d96597 --- /dev/null +++ b/services/iaas/v2api/model_create_network_ipv4_with_prefix_length.go @@ -0,0 +1,194 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv4WithPrefixLength type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefixLength{} + +// CreateNetworkIPv4WithPrefixLength The create request for an IPv4 network with a wanted prefix length. +type CreateNetworkIPv4WithPrefixLength struct { + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + PrefixLength int64 `json:"prefixLength"` +} + +type _CreateNetworkIPv4WithPrefixLength CreateNetworkIPv4WithPrefixLength + +// NewCreateNetworkIPv4WithPrefixLength instantiates a new CreateNetworkIPv4WithPrefixLength object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4WithPrefixLength(prefixLength int64) *CreateNetworkIPv4WithPrefixLength { + this := CreateNetworkIPv4WithPrefixLength{} + this.PrefixLength = prefixLength + return &this +} + +// NewCreateNetworkIPv4WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv4WithPrefixLength object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4WithPrefixLengthWithDefaults() *CreateNetworkIPv4WithPrefixLength { + this := CreateNetworkIPv4WithPrefixLength{} + return &this +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4WithPrefixLength) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefixLength) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefixLength) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4WithPrefixLength) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixLength returns the PrefixLength field value +func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLength() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLengthOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.PrefixLength, true +} + +// SetPrefixLength sets field value +func (o *CreateNetworkIPv4WithPrefixLength) SetPrefixLength(v int64) { + o.PrefixLength = v +} + +func (o CreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv4WithPrefixLength) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixLength"] = o.PrefixLength + return toSerialize, nil +} + +func (o *CreateNetworkIPv4WithPrefixLength) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixLength", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv4WithPrefixLength := _CreateNetworkIPv4WithPrefixLength{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv4WithPrefixLength) + + if err != nil { + return err + } + + *o = CreateNetworkIPv4WithPrefixLength(varCreateNetworkIPv4WithPrefixLength) + + return err +} + +type NullableCreateNetworkIPv4WithPrefixLength struct { + value *CreateNetworkIPv4WithPrefixLength + isSet bool +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) Get() *CreateNetworkIPv4WithPrefixLength { + return v.value +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) Set(val *CreateNetworkIPv4WithPrefixLength) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4WithPrefixLength(val *CreateNetworkIPv4WithPrefixLength) *NullableCreateNetworkIPv4WithPrefixLength { + return &NullableCreateNetworkIPv4WithPrefixLength{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_ipv6.go b/services/iaas/v2api/model_create_network_ipv6.go new file mode 100644 index 000000000..ca998e898 --- /dev/null +++ b/services/iaas/v2api/model_create_network_ipv6.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateNetworkIPv6 - The create request for an IPv6 network. +type CreateNetworkIPv6 struct { + CreateNetworkIPv6WithPrefix *CreateNetworkIPv6WithPrefix + CreateNetworkIPv6WithPrefixLength *CreateNetworkIPv6WithPrefixLength +} + +// CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefix wrapped in CreateNetworkIPv6 +func CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefix) CreateNetworkIPv6 { + return CreateNetworkIPv6{ + CreateNetworkIPv6WithPrefix: v, + } +} + +// CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefixLength wrapped in CreateNetworkIPv6 +func CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefixLength) CreateNetworkIPv6 { + return CreateNetworkIPv6{ + CreateNetworkIPv6WithPrefixLength: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateNetworkIPv6) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateNetworkIPv6WithPrefix + err = json.Unmarshal(data, &dst.CreateNetworkIPv6WithPrefix) + if err == nil { + jsonCreateNetworkIPv6WithPrefix, _ := json.Marshal(dst.CreateNetworkIPv6WithPrefix) + if string(jsonCreateNetworkIPv6WithPrefix) == "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefix = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv6WithPrefix = nil + } + + // try to unmarshal data into CreateNetworkIPv6WithPrefixLength + err = json.Unmarshal(data, &dst.CreateNetworkIPv6WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv6WithPrefixLength, _ := json.Marshal(dst.CreateNetworkIPv6WithPrefixLength) + if string(jsonCreateNetworkIPv6WithPrefixLength) == "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefixLength = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv6WithPrefixLength = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateNetworkIPv6WithPrefix = nil + dst.CreateNetworkIPv6WithPrefixLength = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateNetworkIPv6)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv6)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateNetworkIPv6) MarshalJSON() ([]byte, error) { + if src.CreateNetworkIPv6WithPrefix != nil { + return json.Marshal(&src.CreateNetworkIPv6WithPrefix) + } + + if src.CreateNetworkIPv6WithPrefixLength != nil { + return json.Marshal(&src.CreateNetworkIPv6WithPrefixLength) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateNetworkIPv6) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateNetworkIPv6WithPrefix != nil { + return obj.CreateNetworkIPv6WithPrefix + } + + if obj.CreateNetworkIPv6WithPrefixLength != nil { + return obj.CreateNetworkIPv6WithPrefixLength + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateNetworkIPv6) GetActualInstanceValue() interface{} { + if obj.CreateNetworkIPv6WithPrefix != nil { + return *obj.CreateNetworkIPv6WithPrefix + } + + if obj.CreateNetworkIPv6WithPrefixLength != nil { + return *obj.CreateNetworkIPv6WithPrefixLength + } + + // all schemas are nil + return nil +} + +type NullableCreateNetworkIPv6 struct { + value *CreateNetworkIPv6 + isSet bool +} + +func (v NullableCreateNetworkIPv6) Get() *CreateNetworkIPv6 { + return v.value +} + +func (v *NullableCreateNetworkIPv6) Set(val *CreateNetworkIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6(val *CreateNetworkIPv6) *NullableCreateNetworkIPv6 { + return &NullableCreateNetworkIPv6{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_ipv6_with_prefix.go b/services/iaas/v2api/model_create_network_ipv6_with_prefix.go new file mode 100644 index 000000000..eebdcf41e --- /dev/null +++ b/services/iaas/v2api/model_create_network_ipv6_with_prefix.go @@ -0,0 +1,243 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv6WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefix{} + +// CreateNetworkIPv6WithPrefix The create request for an IPv6 network with a specified prefix. +type CreateNetworkIPv6WithPrefix struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + // Classless Inter-Domain Routing (CIDR) for IPv6. + Prefix string `json:"prefix" validate:"regexp=^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +type _CreateNetworkIPv6WithPrefix CreateNetworkIPv6WithPrefix + +// NewCreateNetworkIPv6WithPrefix instantiates a new CreateNetworkIPv6WithPrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6WithPrefix(prefix string) *CreateNetworkIPv6WithPrefix { + this := CreateNetworkIPv6WithPrefix{} + this.Prefix = prefix + return &this +} + +// NewCreateNetworkIPv6WithPrefixWithDefaults instantiates a new CreateNetworkIPv6WithPrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6WithPrefixWithDefaults() *CreateNetworkIPv6WithPrefix { + this := CreateNetworkIPv6WithPrefix{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv6WithPrefix) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv6WithPrefix) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefix) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *CreateNetworkIPv6WithPrefix) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv6WithPrefix) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv6WithPrefix) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6WithPrefix) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefix) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefix) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6WithPrefix) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value +func (o *CreateNetworkIPv6WithPrefix) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefix) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *CreateNetworkIPv6WithPrefix) SetPrefix(v string) { + o.Prefix = v +} + +func (o CreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv6WithPrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefix"] = o.Prefix + return toSerialize, nil +} + +func (o *CreateNetworkIPv6WithPrefix) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv6WithPrefix := _CreateNetworkIPv6WithPrefix{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv6WithPrefix) + + if err != nil { + return err + } + + *o = CreateNetworkIPv6WithPrefix(varCreateNetworkIPv6WithPrefix) + + return err +} + +type NullableCreateNetworkIPv6WithPrefix struct { + value *CreateNetworkIPv6WithPrefix + isSet bool +} + +func (v NullableCreateNetworkIPv6WithPrefix) Get() *CreateNetworkIPv6WithPrefix { + return v.value +} + +func (v *NullableCreateNetworkIPv6WithPrefix) Set(val *CreateNetworkIPv6WithPrefix) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6WithPrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6WithPrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6WithPrefix(val *CreateNetworkIPv6WithPrefix) *NullableCreateNetworkIPv6WithPrefix { + return &NullableCreateNetworkIPv6WithPrefix{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6WithPrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_ipv6_with_prefix_length.go b/services/iaas/v2api/model_create_network_ipv6_with_prefix_length.go new file mode 100644 index 000000000..55aa57c6a --- /dev/null +++ b/services/iaas/v2api/model_create_network_ipv6_with_prefix_length.go @@ -0,0 +1,194 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv6WithPrefixLength type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefixLength{} + +// CreateNetworkIPv6WithPrefixLength The create request for an IPv6 network with a wanted prefix length. +type CreateNetworkIPv6WithPrefixLength struct { + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + PrefixLength int64 `json:"prefixLength"` +} + +type _CreateNetworkIPv6WithPrefixLength CreateNetworkIPv6WithPrefixLength + +// NewCreateNetworkIPv6WithPrefixLength instantiates a new CreateNetworkIPv6WithPrefixLength object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6WithPrefixLength(prefixLength int64) *CreateNetworkIPv6WithPrefixLength { + this := CreateNetworkIPv6WithPrefixLength{} + this.PrefixLength = prefixLength + return &this +} + +// NewCreateNetworkIPv6WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv6WithPrefixLength object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6WithPrefixLengthWithDefaults() *CreateNetworkIPv6WithPrefixLength { + this := CreateNetworkIPv6WithPrefixLength{} + return &this +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6WithPrefixLength) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefixLength) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefixLength) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6WithPrefixLength) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixLength returns the PrefixLength field value +func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLength() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLengthOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.PrefixLength, true +} + +// SetPrefixLength sets field value +func (o *CreateNetworkIPv6WithPrefixLength) SetPrefixLength(v int64) { + o.PrefixLength = v +} + +func (o CreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv6WithPrefixLength) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixLength"] = o.PrefixLength + return toSerialize, nil +} + +func (o *CreateNetworkIPv6WithPrefixLength) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixLength", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv6WithPrefixLength := _CreateNetworkIPv6WithPrefixLength{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv6WithPrefixLength) + + if err != nil { + return err + } + + *o = CreateNetworkIPv6WithPrefixLength(varCreateNetworkIPv6WithPrefixLength) + + return err +} + +type NullableCreateNetworkIPv6WithPrefixLength struct { + value *CreateNetworkIPv6WithPrefixLength + isSet bool +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) Get() *CreateNetworkIPv6WithPrefixLength { + return v.value +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) Set(val *CreateNetworkIPv6WithPrefixLength) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6WithPrefixLength(val *CreateNetworkIPv6WithPrefixLength) *NullableCreateNetworkIPv6WithPrefixLength { + return &NullableCreateNetworkIPv6WithPrefixLength{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_network_payload.go b/services/iaas/v2api/model_create_network_payload.go new file mode 100644 index 000000000..7b69b0f5c --- /dev/null +++ b/services/iaas/v2api/model_create_network_payload.go @@ -0,0 +1,382 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkPayload{} + +// CreateNetworkPayload Object that represents the request body for a network create. +type CreateNetworkPayload struct { + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + Ipv4 *CreateNetworkIPv4 `json:"ipv4,omitempty"` + Ipv6 *CreateNetworkIPv6 `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _CreateNetworkPayload CreateNetworkPayload + +// NewCreateNetworkPayload instantiates a new CreateNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkPayload(name string) *CreateNetworkPayload { + this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + this.Name = name + return &this +} + +// NewCreateNetworkPayloadWithDefaults instantiates a new CreateNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { + this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + return &this +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *CreateNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetIpv4() CreateNetworkIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret CreateNetworkIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetIpv4Ok() (*CreateNetworkIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. +func (o *CreateNetworkPayload) SetIpv4(v CreateNetworkIPv4) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetIpv6() CreateNetworkIPv6 { + if o == nil || IsNil(o.Ipv6) { + var ret CreateNetworkIPv6 + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetIpv6Ok() (*CreateNetworkIPv6, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given CreateNetworkIPv6 and assigns it to the Ipv6 field. +func (o *CreateNetworkPayload) SetIpv6(v CreateNetworkIPv6) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkPayload) SetName(v string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *CreateNetworkPayload) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *CreateNetworkPayload) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +func (o CreateNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + return toSerialize, nil +} + +func (o *CreateNetworkPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkPayload := _CreateNetworkPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkPayload) + + if err != nil { + return err + } + + *o = CreateNetworkPayload(varCreateNetworkPayload) + + return err +} + +type NullableCreateNetworkPayload struct { + value *CreateNetworkPayload + isSet bool +} + +func (v NullableCreateNetworkPayload) Get() *CreateNetworkPayload { + return v.value +} + +func (v *NullableCreateNetworkPayload) Set(val *CreateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkPayload(val *CreateNetworkPayload) *NullableCreateNetworkPayload { + return &NullableCreateNetworkPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_nic_payload.go b/services/iaas/v2api/model_create_nic_payload.go new file mode 100644 index 000000000..20a6654fe --- /dev/null +++ b/services/iaas/v2api/model_create_nic_payload.go @@ -0,0 +1,611 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateNicPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNicPayload{} + +// CreateNicPayload Object that represents a network interface. +type CreateNicPayload struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Device *string `json:"device,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents an MAC address. + Mac *string `json:"mac,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` + // Possible values: `ACTIVE`, `DOWN`. + Status *string `json:"status,omitempty"` + // Possible values: `server`, `metadata`, `gateway`, `none`. + Type *string `json:"type,omitempty"` +} + +// NewCreateNicPayload instantiates a new CreateNicPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNicPayload() *CreateNicPayload { + this := CreateNicPayload{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// NewCreateNicPayloadWithDefaults instantiates a new CreateNicPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNicPayloadWithDefaults() *CreateNicPayload { + this := CreateNicPayload{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *CreateNicPayload) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *CreateNicPayload) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *CreateNicPayload) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateNicPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateNicPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateNicPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *CreateNicPayload) GetDevice() string { + if o == nil || IsNil(o.Device) { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetDeviceOk() (*string, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *CreateNicPayload) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *CreateNicPayload) SetDevice(v string) { + o.Device = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateNicPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateNicPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateNicPayload) SetId(v string) { + o.Id = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNicPayload) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNicPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *CreateNicPayload) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNicPayload) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNicPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *CreateNicPayload) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNicPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNicPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNicPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMac returns the Mac field value if set, zero value otherwise. +func (o *CreateNicPayload) GetMac() string { + if o == nil || IsNil(o.Mac) { + var ret string + return ret + } + return *o.Mac +} + +// GetMacOk returns a tuple with the Mac field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetMacOk() (*string, bool) { + if o == nil || IsNil(o.Mac) { + return nil, false + } + return o.Mac, true +} + +// HasMac returns a boolean if a field has been set. +func (o *CreateNicPayload) HasMac() bool { + if o != nil && !IsNil(o.Mac) { + return true + } + + return false +} + +// SetMac gets a reference to the given string and assigns it to the Mac field. +func (o *CreateNicPayload) SetMac(v string) { + o.Mac = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateNicPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateNicPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateNicPayload) SetName(v string) { + o.Name = &v +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *CreateNicPayload) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *CreateNicPayload) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *CreateNicPayload) SetNetworkId(v string) { + o.NetworkId = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *CreateNicPayload) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *CreateNicPayload) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *CreateNicPayload) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *CreateNicPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *CreateNicPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *CreateNicPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateNicPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateNicPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateNicPayload) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreateNicPayload) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CreateNicPayload) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CreateNicPayload) SetType(v string) { + o.Type = &v +} + +func (o CreateNicPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNicPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Mac) { + toSerialize["mac"] = o.Mac + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableCreateNicPayload struct { + value *CreateNicPayload + isSet bool +} + +func (v NullableCreateNicPayload) Get() *CreateNicPayload { + return v.value +} + +func (v *NullableCreateNicPayload) Set(val *CreateNicPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNicPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNicPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNicPayload(val *CreateNicPayload) *NullableCreateNicPayload { + return &NullableCreateNicPayload{value: val, isSet: true} +} + +func (v NullableCreateNicPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNicPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_protocol.go b/services/iaas/v2api/model_create_protocol.go new file mode 100644 index 000000000..ecc0e0660 --- /dev/null +++ b/services/iaas/v2api/model_create_protocol.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateProtocol - The schema for a protocol when creating a security group rule. +type CreateProtocol struct { + Int64 *int64 + String *string +} + +// int64AsCreateProtocol is a convenience function that returns int64 wrapped in CreateProtocol +func Int64AsCreateProtocol(v *int64) CreateProtocol { + return CreateProtocol{ + Int64: v, + } +} + +// stringAsCreateProtocol is a convenience function that returns string wrapped in CreateProtocol +func StringAsCreateProtocol(v *string) CreateProtocol { + return CreateProtocol{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Int64 + err = json.Unmarshal(data, &dst.Int64) + if err == nil { + jsonInt64, _ := json.Marshal(dst.Int64) + if string(jsonInt64) == "{}" { // empty struct + dst.Int64 = nil + } else { + match++ + } + } else { + dst.Int64 = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Int64 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateProtocol)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateProtocol)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateProtocol) MarshalJSON() ([]byte, error) { + if src.Int64 != nil { + return json.Marshal(&src.Int64) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateProtocol) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.Int64 != nil { + return obj.Int64 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateProtocol) GetActualInstanceValue() interface{} { + if obj.Int64 != nil { + return *obj.Int64 + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableCreateProtocol struct { + value *CreateProtocol + isSet bool +} + +func (v NullableCreateProtocol) Get() *CreateProtocol { + return v.value +} + +func (v *NullableCreateProtocol) Set(val *CreateProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableCreateProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateProtocol(val *CreateProtocol) *NullableCreateProtocol { + return &NullableCreateProtocol{value: val, isSet: true} +} + +func (v NullableCreateProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_public_ip_payload.go b/services/iaas/v2api/model_create_public_ip_payload.go new file mode 100644 index 000000000..bd314324f --- /dev/null +++ b/services/iaas/v2api/model_create_public_ip_payload.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreatePublicIPPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreatePublicIPPayload{} + +// CreatePublicIPPayload Object that represents a public IP. +type CreatePublicIPPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // String that represents an IPv4 address. + Ip *string `json:"ip,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewCreatePublicIPPayload instantiates a new CreatePublicIPPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreatePublicIPPayload() *CreatePublicIPPayload { + this := CreatePublicIPPayload{} + return &this +} + +// NewCreatePublicIPPayloadWithDefaults instantiates a new CreatePublicIPPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreatePublicIPPayloadWithDefaults() *CreatePublicIPPayload { + this := CreatePublicIPPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreatePublicIPPayload) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *CreatePublicIPPayload) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreatePublicIPPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreatePublicIPPayload) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *CreatePublicIPPayload) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *CreatePublicIPPayload) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *CreatePublicIPPayload) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o CreatePublicIPPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreatePublicIPPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullableCreatePublicIPPayload struct { + value *CreatePublicIPPayload + isSet bool +} + +func (v NullableCreatePublicIPPayload) Get() *CreatePublicIPPayload { + return v.value +} + +func (v *NullableCreatePublicIPPayload) Set(val *CreatePublicIPPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreatePublicIPPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreatePublicIPPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreatePublicIPPayload(val *CreatePublicIPPayload) *NullableCreatePublicIPPayload { + return &NullableCreatePublicIPPayload{value: val, isSet: true} +} + +func (v NullableCreatePublicIPPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreatePublicIPPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_security_group_payload.go b/services/iaas/v2api/model_create_security_group_payload.go new file mode 100644 index 000000000..7b7e067ca --- /dev/null +++ b/services/iaas/v2api/model_create_security_group_payload.go @@ -0,0 +1,422 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateSecurityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupPayload{} + +// CreateSecurityGroupPayload Object that represents a security group. +type CreateSecurityGroupPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A list containing security group rule objects. + Rules []SecurityGroupRule `json:"rules,omitempty"` + // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. + Stateful *bool `json:"stateful,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateSecurityGroupPayload CreateSecurityGroupPayload + +// NewCreateSecurityGroupPayload instantiates a new CreateSecurityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupPayload(name string) *CreateSecurityGroupPayload { + this := CreateSecurityGroupPayload{} + this.Name = name + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// NewCreateSecurityGroupPayloadWithDefaults instantiates a new CreateSecurityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupPayloadWithDefaults() *CreateSecurityGroupPayload { + this := CreateSecurityGroupPayload{} + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateSecurityGroupPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateSecurityGroupPayload) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSecurityGroupPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateSecurityGroupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateSecurityGroupPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateSecurityGroupPayload) SetName(v string) { + o.Name = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetRules() []SecurityGroupRule { + if o == nil || IsNil(o.Rules) { + var ret []SecurityGroupRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetRulesOk() ([]SecurityGroupRule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. +func (o *CreateSecurityGroupPayload) SetRules(v []SecurityGroupRule) { + o.Rules = v +} + +// GetStateful returns the Stateful field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetStateful() bool { + if o == nil || IsNil(o.Stateful) { + var ret bool + return ret + } + return *o.Stateful +} + +// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetStatefulOk() (*bool, bool) { + if o == nil || IsNil(o.Stateful) { + return nil, false + } + return o.Stateful, true +} + +// HasStateful returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasStateful() bool { + if o != nil && !IsNil(o.Stateful) { + return true + } + + return false +} + +// SetStateful gets a reference to the given bool and assigns it to the Stateful field. +func (o *CreateSecurityGroupPayload) SetStateful(v bool) { + o.Stateful = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateSecurityGroupPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + if !IsNil(o.Stateful) { + toSerialize["stateful"] = o.Stateful + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateSecurityGroupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateSecurityGroupPayload := _CreateSecurityGroupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateSecurityGroupPayload) + + if err != nil { + return err + } + + *o = CreateSecurityGroupPayload(varCreateSecurityGroupPayload) + + return err +} + +type NullableCreateSecurityGroupPayload struct { + value *CreateSecurityGroupPayload + isSet bool +} + +func (v NullableCreateSecurityGroupPayload) Get() *CreateSecurityGroupPayload { + return v.value +} + +func (v *NullableCreateSecurityGroupPayload) Set(val *CreateSecurityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupPayload(val *CreateSecurityGroupPayload) *NullableCreateSecurityGroupPayload { + return &NullableCreateSecurityGroupPayload{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_security_group_rule_payload.go b/services/iaas/v2api/model_create_security_group_rule_payload.go new file mode 100644 index 000000000..960ed9ce4 --- /dev/null +++ b/services/iaas/v2api/model_create_security_group_rule_payload.go @@ -0,0 +1,567 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateSecurityGroupRulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupRulePayload{} + +// CreateSecurityGroupRulePayload Object that represents a request body for security group rule creation. +type CreateSecurityGroupRulePayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Protocol *CreateProtocol `json:"protocol,omitempty"` +} + +type _CreateSecurityGroupRulePayload CreateSecurityGroupRulePayload + +// NewCreateSecurityGroupRulePayload instantiates a new CreateSecurityGroupRulePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupRulePayload(direction string) *CreateSecurityGroupRulePayload { + this := CreateSecurityGroupRulePayload{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewCreateSecurityGroupRulePayloadWithDefaults instantiates a new CreateSecurityGroupRulePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupRulePayloadWithDefaults() *CreateSecurityGroupRulePayload { + this := CreateSecurityGroupRulePayload{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateSecurityGroupRulePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateSecurityGroupRulePayload) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *CreateSecurityGroupRulePayload) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *CreateSecurityGroupRulePayload) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *CreateSecurityGroupRulePayload) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *CreateSecurityGroupRulePayload) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSecurityGroupRulePayload) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *CreateSecurityGroupRulePayload) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *CreateSecurityGroupRulePayload) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *CreateSecurityGroupRulePayload) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *CreateSecurityGroupRulePayload) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateSecurityGroupRulePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetProtocol() CreateProtocol { + if o == nil || IsNil(o.Protocol) { + var ret CreateProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (*CreateProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +func (o *CreateSecurityGroupRulePayload) SetProtocol(v CreateProtocol) { + o.Protocol = &v +} + +func (o CreateSecurityGroupRulePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +func (o *CreateSecurityGroupRulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateSecurityGroupRulePayload := _CreateSecurityGroupRulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateSecurityGroupRulePayload) + + if err != nil { + return err + } + + *o = CreateSecurityGroupRulePayload(varCreateSecurityGroupRulePayload) + + return err +} + +type NullableCreateSecurityGroupRulePayload struct { + value *CreateSecurityGroupRulePayload + isSet bool +} + +func (v NullableCreateSecurityGroupRulePayload) Get() *CreateSecurityGroupRulePayload { + return v.value +} + +func (v *NullableCreateSecurityGroupRulePayload) Set(val *CreateSecurityGroupRulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupRulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupRulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupRulePayload(val *CreateSecurityGroupRulePayload) *NullableCreateSecurityGroupRulePayload { + return &NullableCreateSecurityGroupRulePayload{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupRulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupRulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_security_group_rule_protocol.go b/services/iaas/v2api/model_create_security_group_rule_protocol.go new file mode 100644 index 000000000..7f7783d29 --- /dev/null +++ b/services/iaas/v2api/model_create_security_group_rule_protocol.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateSecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupRuleProtocol{} + +// CreateSecurityGroupRuleProtocol The internet protocol which the rule should match. +type CreateSecurityGroupRuleProtocol struct { + Protocol *CreateProtocol `json:"protocol,omitempty"` +} + +// NewCreateSecurityGroupRuleProtocol instantiates a new CreateSecurityGroupRuleProtocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupRuleProtocol() *CreateSecurityGroupRuleProtocol { + this := CreateSecurityGroupRuleProtocol{} + return &this +} + +// NewCreateSecurityGroupRuleProtocolWithDefaults instantiates a new CreateSecurityGroupRuleProtocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupRuleProtocolWithDefaults() *CreateSecurityGroupRuleProtocol { + this := CreateSecurityGroupRuleProtocol{} + return &this +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *CreateSecurityGroupRuleProtocol) GetProtocol() CreateProtocol { + if o == nil || IsNil(o.Protocol) { + var ret CreateProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (*CreateProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *CreateSecurityGroupRuleProtocol) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +func (o *CreateSecurityGroupRuleProtocol) SetProtocol(v CreateProtocol) { + o.Protocol = &v +} + +func (o CreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +type NullableCreateSecurityGroupRuleProtocol struct { + value *CreateSecurityGroupRuleProtocol + isSet bool +} + +func (v NullableCreateSecurityGroupRuleProtocol) Get() *CreateSecurityGroupRuleProtocol { + return v.value +} + +func (v *NullableCreateSecurityGroupRuleProtocol) Set(val *CreateSecurityGroupRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupRuleProtocol(val *CreateSecurityGroupRuleProtocol) *NullableCreateSecurityGroupRuleProtocol { + return &NullableCreateSecurityGroupRuleProtocol{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_server_networking.go b/services/iaas/v2api/model_create_server_networking.go new file mode 100644 index 000000000..c4731b1f9 --- /dev/null +++ b/services/iaas/v2api/model_create_server_networking.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateServerNetworking type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerNetworking{} + +// CreateServerNetworking The initial networking setup for the server creation with a network. +type CreateServerNetworking struct { + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewCreateServerNetworking instantiates a new CreateServerNetworking object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerNetworking() *CreateServerNetworking { + this := CreateServerNetworking{} + return &this +} + +// NewCreateServerNetworkingWithDefaults instantiates a new CreateServerNetworking object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerNetworkingWithDefaults() *CreateServerNetworking { + this := CreateServerNetworking{} + return &this +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *CreateServerNetworking) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerNetworking) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *CreateServerNetworking) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *CreateServerNetworking) SetNetworkId(v string) { + o.NetworkId = &v +} + +func (o CreateServerNetworking) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerNetworking) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + return toSerialize, nil +} + +type NullableCreateServerNetworking struct { + value *CreateServerNetworking + isSet bool +} + +func (v NullableCreateServerNetworking) Get() *CreateServerNetworking { + return v.value +} + +func (v *NullableCreateServerNetworking) Set(val *CreateServerNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerNetworking(val *CreateServerNetworking) *NullableCreateServerNetworking { + return &NullableCreateServerNetworking{value: val, isSet: true} +} + +func (v NullableCreateServerNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_server_networking_with_nics.go b/services/iaas/v2api/model_create_server_networking_with_nics.go new file mode 100644 index 000000000..69ad250b1 --- /dev/null +++ b/services/iaas/v2api/model_create_server_networking_with_nics.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the CreateServerNetworkingWithNics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerNetworkingWithNics{} + +// CreateServerNetworkingWithNics The initial networking setup for the server creation with a network interface. +type CreateServerNetworkingWithNics struct { + // A list of UUIDs. + NicIds []string `json:"nicIds,omitempty"` +} + +// NewCreateServerNetworkingWithNics instantiates a new CreateServerNetworkingWithNics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerNetworkingWithNics() *CreateServerNetworkingWithNics { + this := CreateServerNetworkingWithNics{} + return &this +} + +// NewCreateServerNetworkingWithNicsWithDefaults instantiates a new CreateServerNetworkingWithNics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerNetworkingWithNicsWithDefaults() *CreateServerNetworkingWithNics { + this := CreateServerNetworkingWithNics{} + return &this +} + +// GetNicIds returns the NicIds field value if set, zero value otherwise. +func (o *CreateServerNetworkingWithNics) GetNicIds() []string { + if o == nil || IsNil(o.NicIds) { + var ret []string + return ret + } + return o.NicIds +} + +// GetNicIdsOk returns a tuple with the NicIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerNetworkingWithNics) GetNicIdsOk() ([]string, bool) { + if o == nil || IsNil(o.NicIds) { + return nil, false + } + return o.NicIds, true +} + +// HasNicIds returns a boolean if a field has been set. +func (o *CreateServerNetworkingWithNics) HasNicIds() bool { + if o != nil && !IsNil(o.NicIds) { + return true + } + + return false +} + +// SetNicIds gets a reference to the given []string and assigns it to the NicIds field. +func (o *CreateServerNetworkingWithNics) SetNicIds(v []string) { + o.NicIds = v +} + +func (o CreateServerNetworkingWithNics) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerNetworkingWithNics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NicIds) { + toSerialize["nicIds"] = o.NicIds + } + return toSerialize, nil +} + +type NullableCreateServerNetworkingWithNics struct { + value *CreateServerNetworkingWithNics + isSet bool +} + +func (v NullableCreateServerNetworkingWithNics) Get() *CreateServerNetworkingWithNics { + return v.value +} + +func (v *NullableCreateServerNetworkingWithNics) Set(val *CreateServerNetworkingWithNics) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerNetworkingWithNics) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerNetworkingWithNics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerNetworkingWithNics(val *CreateServerNetworkingWithNics) *NullableCreateServerNetworkingWithNics { + return &NullableCreateServerNetworkingWithNics{value: val, isSet: true} +} + +func (v NullableCreateServerNetworkingWithNics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerNetworkingWithNics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_server_payload.go b/services/iaas/v2api/model_create_server_payload.go new file mode 100644 index 000000000..97512e51d --- /dev/null +++ b/services/iaas/v2api/model_create_server_payload.go @@ -0,0 +1,990 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerPayload{} + +// CreateServerPayload Object that represents the request body for a server create. +type CreateServerPayload struct { + // The affinity group the server is assigned to. + AffinityGroup *string `json:"affinityGroup,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Agent *ServerAgent `json:"agent,omitempty"` + // This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + BootVolume *BootVolume `json:"bootVolume,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // An error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The SSH keypair used during the server creation. + KeypairName *string `json:"keypairName,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Date-time when resource was launched. + LaunchedAt *time.Time `json:"launchedAt,omitempty"` + // Name of the machine type the server shall belong to. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + MaintenanceWindow *ServerMaintenance `json:"maintenanceWindow,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name string `json:"name" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` + Networking CreateServerPayloadAllOfNetworking `json:"networking"` + // The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested. + Nics []ServerNetwork `json:"nics,omitempty"` + // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. + PowerStatus *string `json:"powerStatus,omitempty"` + // The initial security groups for the server creation. + SecurityGroups []string `json:"securityGroups,omitempty"` + // A list of service account mails. Only shown when detailed information is requested. + ServiceAccountMails []string `json:"serviceAccountMails,omitempty"` + // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. + UserData *string `json:"userData,omitempty"` + // The list of volumes attached to the server. + Volumes []string `json:"volumes,omitempty"` +} + +type _CreateServerPayload CreateServerPayload + +// NewCreateServerPayload instantiates a new CreateServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerPayload(machineType string, name string, networking CreateServerPayloadAllOfNetworking) *CreateServerPayload { + this := CreateServerPayload{} + this.MachineType = machineType + this.Name = name + this.Networking = networking + return &this +} + +// NewCreateServerPayloadWithDefaults instantiates a new CreateServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerPayloadWithDefaults() *CreateServerPayload { + this := CreateServerPayload{} + return &this +} + +// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAffinityGroup() string { + if o == nil || IsNil(o.AffinityGroup) { + var ret string + return ret + } + return *o.AffinityGroup +} + +// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAffinityGroupOk() (*string, bool) { + if o == nil || IsNil(o.AffinityGroup) { + return nil, false + } + return o.AffinityGroup, true +} + +// HasAffinityGroup returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAffinityGroup() bool { + if o != nil && !IsNil(o.AffinityGroup) { + return true + } + + return false +} + +// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +func (o *CreateServerPayload) SetAffinityGroup(v string) { + o.AffinityGroup = &v +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAgent() ServerAgent { + if o == nil || IsNil(o.Agent) { + var ret ServerAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAgentOk() (*ServerAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ServerAgent and assigns it to the Agent field. +func (o *CreateServerPayload) SetAgent(v ServerAgent) { + o.Agent = &v +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *CreateServerPayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetBootVolume returns the BootVolume field value if set, zero value otherwise. +func (o *CreateServerPayload) GetBootVolume() BootVolume { + if o == nil || IsNil(o.BootVolume) { + var ret BootVolume + return ret + } + return *o.BootVolume +} + +// GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetBootVolumeOk() (*BootVolume, bool) { + if o == nil || IsNil(o.BootVolume) { + return nil, false + } + return o.BootVolume, true +} + +// HasBootVolume returns a boolean if a field has been set. +func (o *CreateServerPayload) HasBootVolume() bool { + if o != nil && !IsNil(o.BootVolume) { + return true + } + + return false +} + +// SetBootVolume gets a reference to the given BootVolume and assigns it to the BootVolume field. +func (o *CreateServerPayload) SetBootVolume(v BootVolume) { + o.BootVolume = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateServerPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *CreateServerPayload) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *CreateServerPayload) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *CreateServerPayload) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateServerPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateServerPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateServerPayload) SetId(v string) { + o.Id = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *CreateServerPayload) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *CreateServerPayload) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *CreateServerPayload) SetImageId(v string) { + o.ImageId = &v +} + +// GetKeypairName returns the KeypairName field value if set, zero value otherwise. +func (o *CreateServerPayload) GetKeypairName() string { + if o == nil || IsNil(o.KeypairName) { + var ret string + return ret + } + return *o.KeypairName +} + +// GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetKeypairNameOk() (*string, bool) { + if o == nil || IsNil(o.KeypairName) { + return nil, false + } + return o.KeypairName, true +} + +// HasKeypairName returns a boolean if a field has been set. +func (o *CreateServerPayload) HasKeypairName() bool { + if o != nil && !IsNil(o.KeypairName) { + return true + } + + return false +} + +// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. +func (o *CreateServerPayload) SetKeypairName(v string) { + o.KeypairName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateServerPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateServerPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateServerPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetLaunchedAt() time.Time { + if o == nil || IsNil(o.LaunchedAt) { + var ret time.Time + return ret + } + return *o.LaunchedAt +} + +// GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetLaunchedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LaunchedAt) { + return nil, false + } + return o.LaunchedAt, true +} + +// HasLaunchedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasLaunchedAt() bool { + if o != nil && !IsNil(o.LaunchedAt) { + return true + } + + return false +} + +// SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. +func (o *CreateServerPayload) SetLaunchedAt(v time.Time) { + o.LaunchedAt = &v +} + +// GetMachineType returns the MachineType field value +func (o *CreateServerPayload) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *CreateServerPayload) SetMachineType(v string) { + o.MachineType = v +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *CreateServerPayload) GetMaintenanceWindow() ServerMaintenance { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret ServerMaintenance + return ret + } + return *o.MaintenanceWindow +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { + if o == nil || IsNil(o.MaintenanceWindow) { + return nil, false + } + return o.MaintenanceWindow, true +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *CreateServerPayload) HasMaintenanceWindow() bool { + if o != nil && !IsNil(o.MaintenanceWindow) { + return true + } + + return false +} + +// SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. +func (o *CreateServerPayload) SetMaintenanceWindow(v ServerMaintenance) { + o.MaintenanceWindow = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CreateServerPayload) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CreateServerPayload) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CreateServerPayload) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value +func (o *CreateServerPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateServerPayload) SetName(v string) { + o.Name = v +} + +// GetNetworking returns the Networking field value +func (o *CreateServerPayload) GetNetworking() CreateServerPayloadAllOfNetworking { + if o == nil { + var ret CreateServerPayloadAllOfNetworking + return ret + } + + return o.Networking +} + +// GetNetworkingOk returns a tuple with the Networking field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNetworkingOk() (*CreateServerPayloadAllOfNetworking, bool) { + if o == nil { + return nil, false + } + return &o.Networking, true +} + +// SetNetworking sets field value +func (o *CreateServerPayload) SetNetworking(v CreateServerPayloadAllOfNetworking) { + o.Networking = v +} + +// GetNics returns the Nics field value if set, zero value otherwise. +func (o *CreateServerPayload) GetNics() []ServerNetwork { + if o == nil || IsNil(o.Nics) { + var ret []ServerNetwork + return ret + } + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNicsOk() ([]ServerNetwork, bool) { + if o == nil || IsNil(o.Nics) { + return nil, false + } + return o.Nics, true +} + +// HasNics returns a boolean if a field has been set. +func (o *CreateServerPayload) HasNics() bool { + if o != nil && !IsNil(o.Nics) { + return true + } + + return false +} + +// SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. +func (o *CreateServerPayload) SetNics(v []ServerNetwork) { + o.Nics = v +} + +// GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. +func (o *CreateServerPayload) GetPowerStatus() string { + if o == nil || IsNil(o.PowerStatus) { + var ret string + return ret + } + return *o.PowerStatus +} + +// GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetPowerStatusOk() (*string, bool) { + if o == nil || IsNil(o.PowerStatus) { + return nil, false + } + return o.PowerStatus, true +} + +// HasPowerStatus returns a boolean if a field has been set. +func (o *CreateServerPayload) HasPowerStatus() bool { + if o != nil && !IsNil(o.PowerStatus) { + return true + } + + return false +} + +// SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. +func (o *CreateServerPayload) SetPowerStatus(v string) { + o.PowerStatus = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *CreateServerPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *CreateServerPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *CreateServerPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. +func (o *CreateServerPayload) GetServiceAccountMails() []string { + if o == nil || IsNil(o.ServiceAccountMails) { + var ret []string + return ret + } + return o.ServiceAccountMails +} + +// GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetServiceAccountMailsOk() ([]string, bool) { + if o == nil || IsNil(o.ServiceAccountMails) { + return nil, false + } + return o.ServiceAccountMails, true +} + +// HasServiceAccountMails returns a boolean if a field has been set. +func (o *CreateServerPayload) HasServiceAccountMails() bool { + if o != nil && !IsNil(o.ServiceAccountMails) { + return true + } + + return false +} + +// SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. +func (o *CreateServerPayload) SetServiceAccountMails(v []string) { + o.ServiceAccountMails = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateServerPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateServerPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateServerPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateServerPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *CreateServerPayload) GetUserData() string { + if o == nil || IsNil(o.UserData) { + var ret string + return ret + } + return *o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetUserDataOk() (*string, bool) { + if o == nil || IsNil(o.UserData) { + return nil, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *CreateServerPayload) HasUserData() bool { + if o != nil && !IsNil(o.UserData) { + return true + } + + return false +} + +// SetUserData gets a reference to the given string and assigns it to the UserData field. +func (o *CreateServerPayload) SetUserData(v string) { + o.UserData = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *CreateServerPayload) GetVolumes() []string { + if o == nil || IsNil(o.Volumes) { + var ret []string + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetVolumesOk() ([]string, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *CreateServerPayload) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +func (o *CreateServerPayload) SetVolumes(v []string) { + o.Volumes = v +} + +func (o CreateServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AffinityGroup) { + toSerialize["affinityGroup"] = o.AffinityGroup + } + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.BootVolume) { + toSerialize["bootVolume"] = o.BootVolume + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.KeypairName) { + toSerialize["keypairName"] = o.KeypairName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.LaunchedAt) { + toSerialize["launchedAt"] = o.LaunchedAt + } + toSerialize["machineType"] = o.MachineType + if !IsNil(o.MaintenanceWindow) { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + toSerialize["name"] = o.Name + toSerialize["networking"] = o.Networking + if !IsNil(o.Nics) { + toSerialize["nics"] = o.Nics + } + if !IsNil(o.PowerStatus) { + toSerialize["powerStatus"] = o.PowerStatus + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.ServiceAccountMails) { + toSerialize["serviceAccountMails"] = o.ServiceAccountMails + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.UserData) { + toSerialize["userData"] = o.UserData + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + return toSerialize, nil +} + +func (o *CreateServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + "name", + "networking", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateServerPayload := _CreateServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateServerPayload) + + if err != nil { + return err + } + + *o = CreateServerPayload(varCreateServerPayload) + + return err +} + +type NullableCreateServerPayload struct { + value *CreateServerPayload + isSet bool +} + +func (v NullableCreateServerPayload) Get() *CreateServerPayload { + return v.value +} + +func (v *NullableCreateServerPayload) Set(val *CreateServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerPayload(val *CreateServerPayload) *NullableCreateServerPayload { + return &NullableCreateServerPayload{value: val, isSet: true} +} + +func (v NullableCreateServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_server_payload_all_of_networking.go b/services/iaas/v2api/model_create_server_payload_all_of_networking.go new file mode 100644 index 000000000..fe8dad0cf --- /dev/null +++ b/services/iaas/v2api/model_create_server_payload_all_of_networking.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// CreateServerPayloadAllOfNetworking - struct for CreateServerPayloadAllOfNetworking +type CreateServerPayloadAllOfNetworking struct { + CreateServerNetworking *CreateServerNetworking + CreateServerNetworkingWithNics *CreateServerNetworkingWithNics +} + +// CreateServerNetworkingAsCreateServerPayloadAllOfNetworking is a convenience function that returns CreateServerNetworking wrapped in CreateServerPayloadAllOfNetworking +func CreateServerNetworkingAsCreateServerPayloadAllOfNetworking(v *CreateServerNetworking) CreateServerPayloadAllOfNetworking { + return CreateServerPayloadAllOfNetworking{ + CreateServerNetworking: v, + } +} + +// CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in CreateServerPayloadAllOfNetworking +func CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking(v *CreateServerNetworkingWithNics) CreateServerPayloadAllOfNetworking { + return CreateServerPayloadAllOfNetworking{ + CreateServerNetworkingWithNics: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateServerPayloadAllOfNetworking) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateServerNetworking + err = json.Unmarshal(data, &dst.CreateServerNetworking) + if err == nil { + jsonCreateServerNetworking, _ := json.Marshal(dst.CreateServerNetworking) + if string(jsonCreateServerNetworking) == "{}" { // empty struct + dst.CreateServerNetworking = nil + } else { + match++ + } + } else { + dst.CreateServerNetworking = nil + } + + // try to unmarshal data into CreateServerNetworkingWithNics + err = json.Unmarshal(data, &dst.CreateServerNetworkingWithNics) + if err == nil { + jsonCreateServerNetworkingWithNics, _ := json.Marshal(dst.CreateServerNetworkingWithNics) + if string(jsonCreateServerNetworkingWithNics) == "{}" { // empty struct + dst.CreateServerNetworkingWithNics = nil + } else { + match++ + } + } else { + dst.CreateServerNetworkingWithNics = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateServerNetworking = nil + dst.CreateServerNetworkingWithNics = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateServerPayloadAllOfNetworking)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateServerPayloadAllOfNetworking)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { + if src.CreateServerNetworking != nil { + return json.Marshal(&src.CreateServerNetworking) + } + + if src.CreateServerNetworkingWithNics != nil { + return json.Marshal(&src.CreateServerNetworkingWithNics) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateServerPayloadAllOfNetworking) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateServerNetworking != nil { + return obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateServerPayloadAllOfNetworking) GetActualInstanceValue() interface{} { + if obj.CreateServerNetworking != nil { + return *obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return *obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +type NullableCreateServerPayloadAllOfNetworking struct { + value *CreateServerPayloadAllOfNetworking + isSet bool +} + +func (v NullableCreateServerPayloadAllOfNetworking) Get() *CreateServerPayloadAllOfNetworking { + return v.value +} + +func (v *NullableCreateServerPayloadAllOfNetworking) Set(val *CreateServerPayloadAllOfNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerPayloadAllOfNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerPayloadAllOfNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerPayloadAllOfNetworking(val *CreateServerPayloadAllOfNetworking) *NullableCreateServerPayloadAllOfNetworking { + return &NullableCreateServerPayloadAllOfNetworking{value: val, isSet: true} +} + +func (v NullableCreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerPayloadAllOfNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_snapshot_payload.go b/services/iaas/v2api/model_create_snapshot_payload.go new file mode 100644 index 000000000..b7eea34d5 --- /dev/null +++ b/services/iaas/v2api/model_create_snapshot_payload.go @@ -0,0 +1,418 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSnapshotPayload{} + +// CreateSnapshotPayload Object that represents a snapshot. +type CreateSnapshotPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId string `json:"volumeId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _CreateSnapshotPayload CreateSnapshotPayload + +// NewCreateSnapshotPayload instantiates a new CreateSnapshotPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSnapshotPayload(volumeId string) *CreateSnapshotPayload { + this := CreateSnapshotPayload{} + this.VolumeId = volumeId + return &this +} + +// NewCreateSnapshotPayloadWithDefaults instantiates a new CreateSnapshotPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSnapshotPayloadWithDefaults() *CreateSnapshotPayload { + this := CreateSnapshotPayload{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateSnapshotPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSnapshotPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateSnapshotPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateSnapshotPayload) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateSnapshotPayload) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateSnapshotPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSnapshotPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateSnapshotPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateSnapshotPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value +func (o *CreateSnapshotPayload) GetVolumeId() string { + if o == nil { + var ret string + return ret + } + + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value +// and a boolean to check if the value has been set. +func (o *CreateSnapshotPayload) GetVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VolumeId, true +} + +// SetVolumeId sets field value +func (o *CreateSnapshotPayload) SetVolumeId(v string) { + o.VolumeId = v +} + +func (o CreateSnapshotPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + toSerialize["volumeId"] = o.VolumeId + return toSerialize, nil +} + +func (o *CreateSnapshotPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "volumeId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateSnapshotPayload := _CreateSnapshotPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateSnapshotPayload) + + if err != nil { + return err + } + + *o = CreateSnapshotPayload(varCreateSnapshotPayload) + + return err +} + +type NullableCreateSnapshotPayload struct { + value *CreateSnapshotPayload + isSet bool +} + +func (v NullableCreateSnapshotPayload) Get() *CreateSnapshotPayload { + return v.value +} + +func (v *NullableCreateSnapshotPayload) Set(val *CreateSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSnapshotPayload(val *CreateSnapshotPayload) *NullableCreateSnapshotPayload { + return &NullableCreateSnapshotPayload{value: val, isSet: true} +} + +func (v NullableCreateSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_create_volume_payload.go b/services/iaas/v2api/model_create_volume_payload.go new file mode 100644 index 000000000..45898dc84 --- /dev/null +++ b/services/iaas/v2api/model_create_volume_payload.go @@ -0,0 +1,711 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateVolumePayload{} + +// CreateVolumePayload Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. +type CreateVolumePayload struct { + // Object that represents an availability zone. + AvailabilityZone string `json:"availabilityZone"` + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionParameters *VolumeEncryptionParameter `json:"encryptionParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *VolumeSource `json:"source,omitempty"` + // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateVolumePayload CreateVolumePayload + +// NewCreateVolumePayload instantiates a new CreateVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateVolumePayload(availabilityZone string) *CreateVolumePayload { + this := CreateVolumePayload{} + this.AvailabilityZone = availabilityZone + return &this +} + +// NewCreateVolumePayloadWithDefaults instantiates a new CreateVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateVolumePayloadWithDefaults() *CreateVolumePayload { + this := CreateVolumePayload{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value +func (o *CreateVolumePayload) GetAvailabilityZone() string { + if o == nil { + var ret string + return ret + } + + return o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailabilityZone, true +} + +// SetAvailabilityZone sets field value +func (o *CreateVolumePayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = v +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *CreateVolumePayload) SetBootable(v bool) { + o.Bootable = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateVolumePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateVolumePayload) SetDescription(v string) { + o.Description = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *CreateVolumePayload) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetEncryptionParameters returns the EncryptionParameters field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetEncryptionParameters() VolumeEncryptionParameter { + if o == nil || IsNil(o.EncryptionParameters) { + var ret VolumeEncryptionParameter + return ret + } + return *o.EncryptionParameters +} + +// GetEncryptionParametersOk returns a tuple with the EncryptionParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetEncryptionParametersOk() (*VolumeEncryptionParameter, bool) { + if o == nil || IsNil(o.EncryptionParameters) { + return nil, false + } + return o.EncryptionParameters, true +} + +// HasEncryptionParameters returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasEncryptionParameters() bool { + if o != nil && !IsNil(o.EncryptionParameters) { + return true + } + + return false +} + +// SetEncryptionParameters gets a reference to the given VolumeEncryptionParameter and assigns it to the EncryptionParameters field. +func (o *CreateVolumePayload) SetEncryptionParameters(v VolumeEncryptionParameter) { + o.EncryptionParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateVolumePayload) SetId(v string) { + o.Id = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *CreateVolumePayload) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateVolumePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateVolumePayload) SetName(v string) { + o.Name = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *CreateVolumePayload) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *CreateVolumePayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateVolumePayload) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetSource() VolumeSource { + if o == nil || IsNil(o.Source) { + var ret VolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetSourceOk() (*VolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given VolumeSource and assigns it to the Source field. +func (o *CreateVolumePayload) SetSource(v VolumeSource) { + o.Source = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateVolumePayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateVolumePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["availabilityZone"] = o.AvailabilityZone + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.EncryptionParameters) { + toSerialize["encryptionParameters"] = o.EncryptionParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateVolumePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "availabilityZone", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateVolumePayload := _CreateVolumePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateVolumePayload) + + if err != nil { + return err + } + + *o = CreateVolumePayload(varCreateVolumePayload) + + return err +} + +type NullableCreateVolumePayload struct { + value *CreateVolumePayload + isSet bool +} + +func (v NullableCreateVolumePayload) Get() *CreateVolumePayload { + return v.value +} + +func (v *NullableCreateVolumePayload) Set(val *CreateVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateVolumePayload(val *CreateVolumePayload) *NullableCreateVolumePayload { + return &NullableCreateVolumePayload{value: val, isSet: true} +} + +func (v NullableCreateVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_destination_cidrv4.go b/services/iaas/v2api/model_destination_cidrv4.go new file mode 100644 index 000000000..3645e671e --- /dev/null +++ b/services/iaas/v2api/model_destination_cidrv4.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DestinationCIDRv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DestinationCIDRv4{} + +// DestinationCIDRv4 IPv4 Classless Inter-Domain Routing (CIDR) Object. +type DestinationCIDRv4 struct { + Type string `json:"type"` + // An CIDRv4 string. + Value string `json:"value" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` +} + +type _DestinationCIDRv4 DestinationCIDRv4 + +// NewDestinationCIDRv4 instantiates a new DestinationCIDRv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDestinationCIDRv4(types string, value string) *DestinationCIDRv4 { + this := DestinationCIDRv4{} + this.Type = types + this.Value = value + return &this +} + +// NewDestinationCIDRv4WithDefaults instantiates a new DestinationCIDRv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDestinationCIDRv4WithDefaults() *DestinationCIDRv4 { + this := DestinationCIDRv4{} + return &this +} + +// GetType returns the Type field value +func (o *DestinationCIDRv4) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv4) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DestinationCIDRv4) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *DestinationCIDRv4) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv4) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *DestinationCIDRv4) SetValue(v string) { + o.Value = v +} + +func (o DestinationCIDRv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DestinationCIDRv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *DestinationCIDRv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDestinationCIDRv4 := _DestinationCIDRv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDestinationCIDRv4) + + if err != nil { + return err + } + + *o = DestinationCIDRv4(varDestinationCIDRv4) + + return err +} + +type NullableDestinationCIDRv4 struct { + value *DestinationCIDRv4 + isSet bool +} + +func (v NullableDestinationCIDRv4) Get() *DestinationCIDRv4 { + return v.value +} + +func (v *NullableDestinationCIDRv4) Set(val *DestinationCIDRv4) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationCIDRv4) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationCIDRv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationCIDRv4(val *DestinationCIDRv4) *NullableDestinationCIDRv4 { + return &NullableDestinationCIDRv4{value: val, isSet: true} +} + +func (v NullableDestinationCIDRv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationCIDRv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_destination_cidrv6.go b/services/iaas/v2api/model_destination_cidrv6.go new file mode 100644 index 000000000..845199503 --- /dev/null +++ b/services/iaas/v2api/model_destination_cidrv6.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DestinationCIDRv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DestinationCIDRv6{} + +// DestinationCIDRv6 IPv6 Classless Inter-Domain Routing (CIDR) Object. +type DestinationCIDRv6 struct { + Type string `json:"type"` + // An CIDRv6 string. + Value string `json:"value" validate:"regexp=^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +type _DestinationCIDRv6 DestinationCIDRv6 + +// NewDestinationCIDRv6 instantiates a new DestinationCIDRv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDestinationCIDRv6(types string, value string) *DestinationCIDRv6 { + this := DestinationCIDRv6{} + this.Type = types + this.Value = value + return &this +} + +// NewDestinationCIDRv6WithDefaults instantiates a new DestinationCIDRv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDestinationCIDRv6WithDefaults() *DestinationCIDRv6 { + this := DestinationCIDRv6{} + return &this +} + +// GetType returns the Type field value +func (o *DestinationCIDRv6) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv6) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DestinationCIDRv6) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *DestinationCIDRv6) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv6) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *DestinationCIDRv6) SetValue(v string) { + o.Value = v +} + +func (o DestinationCIDRv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DestinationCIDRv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *DestinationCIDRv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDestinationCIDRv6 := _DestinationCIDRv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDestinationCIDRv6) + + if err != nil { + return err + } + + *o = DestinationCIDRv6(varDestinationCIDRv6) + + return err +} + +type NullableDestinationCIDRv6 struct { + value *DestinationCIDRv6 + isSet bool +} + +func (v NullableDestinationCIDRv6) Get() *DestinationCIDRv6 { + return v.value +} + +func (v *NullableDestinationCIDRv6) Set(val *DestinationCIDRv6) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationCIDRv6) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationCIDRv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationCIDRv6(val *DestinationCIDRv6) *NullableDestinationCIDRv6 { + return &NullableDestinationCIDRv6{value: val, isSet: true} +} + +func (v NullableDestinationCIDRv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationCIDRv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_error.go b/services/iaas/v2api/model_error.go new file mode 100644 index 000000000..05d1a3dc3 --- /dev/null +++ b/services/iaas/v2api/model_error.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error Error with HTTP error code and an error message. +type Error struct { + Code int64 `json:"code"` + // An error message. + Msg string `json:"msg"` +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(code int64, msg string) *Error { + this := Error{} + this.Code = code + this.Msg = msg + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetCode returns the Code field value +func (o *Error) GetCode() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *Error) GetCodeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *Error) SetCode(v int64) { + o.Code = v +} + +// GetMsg returns the Msg field value +func (o *Error) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *Error) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *Error) SetMsg(v string) { + o.Msg = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "msg", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varError) + + if err != nil { + return err + } + + *o = Error(varError) + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_get_server_log_200_response.go b/services/iaas/v2api/model_get_server_log_200_response.go new file mode 100644 index 000000000..612fe61bb --- /dev/null +++ b/services/iaas/v2api/model_get_server_log_200_response.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the GetServerLog200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetServerLog200Response{} + +// GetServerLog200Response struct for GetServerLog200Response +type GetServerLog200Response struct { + Output *string `json:"output,omitempty"` +} + +// NewGetServerLog200Response instantiates a new GetServerLog200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetServerLog200Response() *GetServerLog200Response { + this := GetServerLog200Response{} + return &this +} + +// NewGetServerLog200ResponseWithDefaults instantiates a new GetServerLog200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetServerLog200ResponseWithDefaults() *GetServerLog200Response { + this := GetServerLog200Response{} + return &this +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *GetServerLog200Response) GetOutput() string { + if o == nil || IsNil(o.Output) { + var ret string + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServerLog200Response) GetOutputOk() (*string, bool) { + if o == nil || IsNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *GetServerLog200Response) HasOutput() bool { + if o != nil && !IsNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given string and assigns it to the Output field. +func (o *GetServerLog200Response) SetOutput(v string) { + o.Output = &v +} + +func (o GetServerLog200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetServerLog200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Output) { + toSerialize["output"] = o.Output + } + return toSerialize, nil +} + +type NullableGetServerLog200Response struct { + value *GetServerLog200Response + isSet bool +} + +func (v NullableGetServerLog200Response) Get() *GetServerLog200Response { + return v.value +} + +func (v *NullableGetServerLog200Response) Set(val *GetServerLog200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetServerLog200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServerLog200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServerLog200Response(val *GetServerLog200Response) *NullableGetServerLog200Response { + return &NullableGetServerLog200Response{value: val, isSet: true} +} + +func (v NullableGetServerLog200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServerLog200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_icmp_parameters.go b/services/iaas/v2api/model_icmp_parameters.go new file mode 100644 index 000000000..35404219e --- /dev/null +++ b/services/iaas/v2api/model_icmp_parameters.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ICMPParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ICMPParameters{} + +// ICMPParameters Object that represents ICMP parameters. +type ICMPParameters struct { + // ICMP code. Can be set if the protocol is ICMP. + Code int64 `json:"code"` + // ICMP type. Can be set if the protocol is ICMP. + Type int64 `json:"type"` +} + +type _ICMPParameters ICMPParameters + +// NewICMPParameters instantiates a new ICMPParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewICMPParameters(code int64, types int64) *ICMPParameters { + this := ICMPParameters{} + this.Code = code + this.Type = types + return &this +} + +// NewICMPParametersWithDefaults instantiates a new ICMPParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewICMPParametersWithDefaults() *ICMPParameters { + this := ICMPParameters{} + return &this +} + +// GetCode returns the Code field value +func (o *ICMPParameters) GetCode() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *ICMPParameters) GetCodeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *ICMPParameters) SetCode(v int64) { + o.Code = v +} + +// GetType returns the Type field value +func (o *ICMPParameters) GetType() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ICMPParameters) GetTypeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ICMPParameters) SetType(v int64) { + o.Type = v +} + +func (o ICMPParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ICMPParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *ICMPParameters) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varICMPParameters := _ICMPParameters{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varICMPParameters) + + if err != nil { + return err + } + + *o = ICMPParameters(varICMPParameters) + + return err +} + +type NullableICMPParameters struct { + value *ICMPParameters + isSet bool +} + +func (v NullableICMPParameters) Get() *ICMPParameters { + return v.value +} + +func (v *NullableICMPParameters) Set(val *ICMPParameters) { + v.value = val + v.isSet = true +} + +func (v NullableICMPParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableICMPParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableICMPParameters(val *ICMPParameters) *NullableICMPParameters { + return &NullableICMPParameters{value: val, isSet: true} +} + +func (v NullableICMPParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableICMPParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image.go b/services/iaas/v2api/model_image.go new file mode 100644 index 000000000..471669c02 --- /dev/null +++ b/services/iaas/v2api/model_image.go @@ -0,0 +1,740 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Image type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Image{} + +// Image Object that represents an Image and its parameters. Used for Creating and returning (get/list). +type Image struct { + Agent *ImageAgent `json:"agent,omitempty"` + Checksum *ImageChecksum `json:"checksum,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat string `json:"diskFormat"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Indicates Image Import Progress in percent. + ImportProgress *int64 `json:"importProgress,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + Owner *string `json:"owner,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` + // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. + Scope *string `json:"scope,omitempty"` + // Size in bytes. + Size *int64 `json:"size,omitempty"` + // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Image Image + +// NewImage instantiates a new Image object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImage(diskFormat string, name string) *Image { + this := Image{} + this.DiskFormat = diskFormat + this.Name = name + return &this +} + +// NewImageWithDefaults instantiates a new Image object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageWithDefaults() *Image { + this := Image{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *Image) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *Image) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *Image) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *Image) GetChecksum() ImageChecksum { + if o == nil || IsNil(o.Checksum) { + var ret ImageChecksum + return ret + } + return *o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetChecksumOk() (*ImageChecksum, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *Image) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +func (o *Image) SetChecksum(v ImageChecksum) { + o.Checksum = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *Image) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *Image) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *Image) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Image) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Image) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Image) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDiskFormat returns the DiskFormat field value +func (o *Image) GetDiskFormat() string { + if o == nil { + var ret string + return ret + } + + return o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value +// and a boolean to check if the value has been set. +func (o *Image) GetDiskFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DiskFormat, true +} + +// SetDiskFormat sets field value +func (o *Image) SetDiskFormat(v string) { + o.DiskFormat = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Image) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Image) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Image) SetId(v string) { + o.Id = &v +} + +// GetImportProgress returns the ImportProgress field value if set, zero value otherwise. +func (o *Image) GetImportProgress() int64 { + if o == nil || IsNil(o.ImportProgress) { + var ret int64 + return ret + } + return *o.ImportProgress +} + +// GetImportProgressOk returns a tuple with the ImportProgress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetImportProgressOk() (*int64, bool) { + if o == nil || IsNil(o.ImportProgress) { + return nil, false + } + return o.ImportProgress, true +} + +// HasImportProgress returns a boolean if a field has been set. +func (o *Image) HasImportProgress() bool { + if o != nil && !IsNil(o.ImportProgress) { + return true + } + + return false +} + +// SetImportProgress gets a reference to the given int64 and assigns it to the ImportProgress field. +func (o *Image) SetImportProgress(v int64) { + o.ImportProgress = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Image) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Image) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Image) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *Image) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *Image) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *Image) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *Image) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *Image) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *Image) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value +func (o *Image) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Image) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Image) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *Image) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *Image) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *Image) SetOwner(v string) { + o.Owner = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *Image) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *Image) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *Image) SetProtected(v bool) { + o.Protected = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *Image) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *Image) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *Image) SetScope(v string) { + o.Scope = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Image) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Image) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Image) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Image) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Image) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Image) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Image) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Image) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Image) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Image) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Image) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["diskFormat"] = o.DiskFormat + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImportProgress) { + toSerialize["importProgress"] = o.ImportProgress + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Image) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "diskFormat", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImage := _Image{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImage) + + if err != nil { + return err + } + + *o = Image(varImage) + + return err +} + +type NullableImage struct { + value *Image + isSet bool +} + +func (v NullableImage) Get() *Image { + return v.value +} + +func (v *NullableImage) Set(val *Image) { + v.value = val + v.isSet = true +} + +func (v NullableImage) IsSet() bool { + return v.isSet +} + +func (v *NullableImage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImage(val *Image) *NullableImage { + return &NullableImage{value: val, isSet: true} +} + +func (v NullableImage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image_agent.go b/services/iaas/v2api/model_image_agent.go new file mode 100644 index 000000000..660f8b41f --- /dev/null +++ b/services/iaas/v2api/model_image_agent.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ImageAgent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageAgent{} + +// ImageAgent Support status and default provioning setting for the STACKIT server agent. +type ImageAgent struct { + // Default provioning of the STACKIT server agent for new servers. The default for new images is false. Can only be enabled when supported is also true. + ProvisionByDefault *bool `json:"provisionByDefault,omitempty"` + // Indicates the STACKIT server agent for the image. The default for new images is false. + Supported *bool `json:"supported,omitempty"` +} + +// NewImageAgent instantiates a new ImageAgent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageAgent() *ImageAgent { + this := ImageAgent{} + return &this +} + +// NewImageAgentWithDefaults instantiates a new ImageAgent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageAgentWithDefaults() *ImageAgent { + this := ImageAgent{} + return &this +} + +// GetProvisionByDefault returns the ProvisionByDefault field value if set, zero value otherwise. +func (o *ImageAgent) GetProvisionByDefault() bool { + if o == nil || IsNil(o.ProvisionByDefault) { + var ret bool + return ret + } + return *o.ProvisionByDefault +} + +// GetProvisionByDefaultOk returns a tuple with the ProvisionByDefault field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAgent) GetProvisionByDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.ProvisionByDefault) { + return nil, false + } + return o.ProvisionByDefault, true +} + +// HasProvisionByDefault returns a boolean if a field has been set. +func (o *ImageAgent) HasProvisionByDefault() bool { + if o != nil && !IsNil(o.ProvisionByDefault) { + return true + } + + return false +} + +// SetProvisionByDefault gets a reference to the given bool and assigns it to the ProvisionByDefault field. +func (o *ImageAgent) SetProvisionByDefault(v bool) { + o.ProvisionByDefault = &v +} + +// GetSupported returns the Supported field value if set, zero value otherwise. +func (o *ImageAgent) GetSupported() bool { + if o == nil || IsNil(o.Supported) { + var ret bool + return ret + } + return *o.Supported +} + +// GetSupportedOk returns a tuple with the Supported field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAgent) GetSupportedOk() (*bool, bool) { + if o == nil || IsNil(o.Supported) { + return nil, false + } + return o.Supported, true +} + +// HasSupported returns a boolean if a field has been set. +func (o *ImageAgent) HasSupported() bool { + if o != nil && !IsNil(o.Supported) { + return true + } + + return false +} + +// SetSupported gets a reference to the given bool and assigns it to the Supported field. +func (o *ImageAgent) SetSupported(v bool) { + o.Supported = &v +} + +func (o ImageAgent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageAgent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ProvisionByDefault) { + toSerialize["provisionByDefault"] = o.ProvisionByDefault + } + if !IsNil(o.Supported) { + toSerialize["supported"] = o.Supported + } + return toSerialize, nil +} + +type NullableImageAgent struct { + value *ImageAgent + isSet bool +} + +func (v NullableImageAgent) Get() *ImageAgent { + return v.value +} + +func (v *NullableImageAgent) Set(val *ImageAgent) { + v.value = val + v.isSet = true +} + +func (v NullableImageAgent) IsSet() bool { + return v.isSet +} + +func (v *NullableImageAgent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageAgent(val *ImageAgent) *NullableImageAgent { + return &NullableImageAgent{value: val, isSet: true} +} + +func (v NullableImageAgent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageAgent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image_checksum.go b/services/iaas/v2api/model_image_checksum.go new file mode 100644 index 000000000..7f0e5fc2d --- /dev/null +++ b/services/iaas/v2api/model_image_checksum.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageChecksum type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageChecksum{} + +// ImageChecksum Representation of an image checksum. +type ImageChecksum struct { + // Algorithm for the checksum of the image data. Possible values: `md5`, `sha512`. + Algorithm string `json:"algorithm"` + // Hexdigest of the checksum of the image data. + Digest string `json:"digest" validate:"regexp=^[0-9a-f]+$"` +} + +type _ImageChecksum ImageChecksum + +// NewImageChecksum instantiates a new ImageChecksum object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageChecksum(algorithm string, digest string) *ImageChecksum { + this := ImageChecksum{} + this.Algorithm = algorithm + this.Digest = digest + return &this +} + +// NewImageChecksumWithDefaults instantiates a new ImageChecksum object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageChecksumWithDefaults() *ImageChecksum { + this := ImageChecksum{} + return &this +} + +// GetAlgorithm returns the Algorithm field value +func (o *ImageChecksum) GetAlgorithm() string { + if o == nil { + var ret string + return ret + } + + return o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value +// and a boolean to check if the value has been set. +func (o *ImageChecksum) GetAlgorithmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Algorithm, true +} + +// SetAlgorithm sets field value +func (o *ImageChecksum) SetAlgorithm(v string) { + o.Algorithm = v +} + +// GetDigest returns the Digest field value +func (o *ImageChecksum) GetDigest() string { + if o == nil { + var ret string + return ret + } + + return o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value +// and a boolean to check if the value has been set. +func (o *ImageChecksum) GetDigestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Digest, true +} + +// SetDigest sets field value +func (o *ImageChecksum) SetDigest(v string) { + o.Digest = v +} + +func (o ImageChecksum) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageChecksum) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["algorithm"] = o.Algorithm + toSerialize["digest"] = o.Digest + return toSerialize, nil +} + +func (o *ImageChecksum) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "algorithm", + "digest", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageChecksum := _ImageChecksum{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageChecksum) + + if err != nil { + return err + } + + *o = ImageChecksum(varImageChecksum) + + return err +} + +type NullableImageChecksum struct { + value *ImageChecksum + isSet bool +} + +func (v NullableImageChecksum) Get() *ImageChecksum { + return v.value +} + +func (v *NullableImageChecksum) Set(val *ImageChecksum) { + v.value = val + v.isSet = true +} + +func (v NullableImageChecksum) IsSet() bool { + return v.isSet +} + +func (v *NullableImageChecksum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageChecksum(val *ImageChecksum) *NullableImageChecksum { + return &NullableImageChecksum{value: val, isSet: true} +} + +func (v NullableImageChecksum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageChecksum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image_config.go b/services/iaas/v2api/model_image_config.go new file mode 100644 index 000000000..379569c3f --- /dev/null +++ b/services/iaas/v2api/model_image_config.go @@ -0,0 +1,695 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ImageConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageConfig{} + +// ImageConfig Properties to set hardware and scheduling settings for an Image. +type ImageConfig struct { + // Represents CPU architecture. The default for new images is x86. Possible values: `arm64`, `x86`. + Architecture *string `json:"architecture,omitempty"` + // Enables the BIOS bootmenu. The default for new images is disabled. + BootMenu *bool `json:"bootMenu,omitempty"` + // Sets CDROM bus controller type. Possible values: `scsi`, `virtio`, `ide`, `usb`. + CdromBus NullableString `json:"cdromBus,omitempty"` + // Sets Disk bus controller type. Possible values: `scsi`, `virtio`, `ide`, `usb`. + DiskBus NullableString `json:"diskBus,omitempty"` + // Sets virtual nic model. Possible values: `e1000`, `e1000e`, `ne2k_pci`, `pcnet`, `rtl8139`, `virtio`, `vmxnet3`. + NicModel NullableString `json:"nicModel,omitempty"` + // Enables OS specific optimizations. Possible values: `windows`, `linux`. + OperatingSystem *string `json:"operatingSystem,omitempty"` + // Operating System Distribution. + OperatingSystemDistro NullableString `json:"operatingSystemDistro,omitempty"` + // Version of the OS. + OperatingSystemVersion NullableString `json:"operatingSystemVersion,omitempty"` + // Sets the device bus when the image is used as a rescue image. Possible values: `sata`, `scsi`, `virtio`, `usb`. + RescueBus NullableString `json:"rescueBus,omitempty"` + // Sets the device when the image is used as a rescue image. Possible values: `cdrom`, `disk`. + RescueDevice NullableString `json:"rescueDevice,omitempty"` + // Enables Secure Boot. The default for new images is disabled. + SecureBoot *bool `json:"secureBoot,omitempty"` + // Configure UEFI boot. The default for new images is enabled. + Uefi *bool `json:"uefi,omitempty"` + // Sets Graphic device model. Possible values: `vga`, `cirrus`, `vmvga`, `qxl`, `virtio`, `none`. + VideoModel NullableString `json:"videoModel,omitempty"` + // Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO Block. + VirtioScsi *bool `json:"virtioScsi,omitempty"` +} + +// NewImageConfig instantiates a new ImageConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageConfig() *ImageConfig { + this := ImageConfig{} + return &this +} + +// NewImageConfigWithDefaults instantiates a new ImageConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageConfigWithDefaults() *ImageConfig { + this := ImageConfig{} + return &this +} + +// GetArchitecture returns the Architecture field value if set, zero value otherwise. +func (o *ImageConfig) GetArchitecture() string { + if o == nil || IsNil(o.Architecture) { + var ret string + return ret + } + return *o.Architecture +} + +// GetArchitectureOk returns a tuple with the Architecture field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetArchitectureOk() (*string, bool) { + if o == nil || IsNil(o.Architecture) { + return nil, false + } + return o.Architecture, true +} + +// HasArchitecture returns a boolean if a field has been set. +func (o *ImageConfig) HasArchitecture() bool { + if o != nil && !IsNil(o.Architecture) { + return true + } + + return false +} + +// SetArchitecture gets a reference to the given string and assigns it to the Architecture field. +func (o *ImageConfig) SetArchitecture(v string) { + o.Architecture = &v +} + +// GetBootMenu returns the BootMenu field value if set, zero value otherwise. +func (o *ImageConfig) GetBootMenu() bool { + if o == nil || IsNil(o.BootMenu) { + var ret bool + return ret + } + return *o.BootMenu +} + +// GetBootMenuOk returns a tuple with the BootMenu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetBootMenuOk() (*bool, bool) { + if o == nil || IsNil(o.BootMenu) { + return nil, false + } + return o.BootMenu, true +} + +// HasBootMenu returns a boolean if a field has been set. +func (o *ImageConfig) HasBootMenu() bool { + if o != nil && !IsNil(o.BootMenu) { + return true + } + + return false +} + +// SetBootMenu gets a reference to the given bool and assigns it to the BootMenu field. +func (o *ImageConfig) SetBootMenu(v bool) { + o.BootMenu = &v +} + +// GetCdromBus returns the CdromBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetCdromBus() string { + if o == nil || IsNil(o.CdromBus.Get()) { + var ret string + return ret + } + return *o.CdromBus.Get() +} + +// GetCdromBusOk returns a tuple with the CdromBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetCdromBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CdromBus.Get(), o.CdromBus.IsSet() +} + +// HasCdromBus returns a boolean if a field has been set. +func (o *ImageConfig) HasCdromBus() bool { + if o != nil && o.CdromBus.IsSet() { + return true + } + + return false +} + +// SetCdromBus gets a reference to the given NullableString and assigns it to the CdromBus field. +func (o *ImageConfig) SetCdromBus(v string) { + o.CdromBus.Set(&v) +} + +// SetCdromBusNil sets the value for CdromBus to be an explicit nil +func (o *ImageConfig) SetCdromBusNil() { + o.CdromBus.Set(nil) +} + +// UnsetCdromBus ensures that no value is present for CdromBus, not even an explicit nil +func (o *ImageConfig) UnsetCdromBus() { + o.CdromBus.Unset() +} + +// GetDiskBus returns the DiskBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetDiskBus() string { + if o == nil || IsNil(o.DiskBus.Get()) { + var ret string + return ret + } + return *o.DiskBus.Get() +} + +// GetDiskBusOk returns a tuple with the DiskBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetDiskBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DiskBus.Get(), o.DiskBus.IsSet() +} + +// HasDiskBus returns a boolean if a field has been set. +func (o *ImageConfig) HasDiskBus() bool { + if o != nil && o.DiskBus.IsSet() { + return true + } + + return false +} + +// SetDiskBus gets a reference to the given NullableString and assigns it to the DiskBus field. +func (o *ImageConfig) SetDiskBus(v string) { + o.DiskBus.Set(&v) +} + +// SetDiskBusNil sets the value for DiskBus to be an explicit nil +func (o *ImageConfig) SetDiskBusNil() { + o.DiskBus.Set(nil) +} + +// UnsetDiskBus ensures that no value is present for DiskBus, not even an explicit nil +func (o *ImageConfig) UnsetDiskBus() { + o.DiskBus.Unset() +} + +// GetNicModel returns the NicModel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetNicModel() string { + if o == nil || IsNil(o.NicModel.Get()) { + var ret string + return ret + } + return *o.NicModel.Get() +} + +// GetNicModelOk returns a tuple with the NicModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetNicModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NicModel.Get(), o.NicModel.IsSet() +} + +// HasNicModel returns a boolean if a field has been set. +func (o *ImageConfig) HasNicModel() bool { + if o != nil && o.NicModel.IsSet() { + return true + } + + return false +} + +// SetNicModel gets a reference to the given NullableString and assigns it to the NicModel field. +func (o *ImageConfig) SetNicModel(v string) { + o.NicModel.Set(&v) +} + +// SetNicModelNil sets the value for NicModel to be an explicit nil +func (o *ImageConfig) SetNicModelNil() { + o.NicModel.Set(nil) +} + +// UnsetNicModel ensures that no value is present for NicModel, not even an explicit nil +func (o *ImageConfig) UnsetNicModel() { + o.NicModel.Unset() +} + +// GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. +func (o *ImageConfig) GetOperatingSystem() string { + if o == nil || IsNil(o.OperatingSystem) { + var ret string + return ret + } + return *o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetOperatingSystemOk() (*string, bool) { + if o == nil || IsNil(o.OperatingSystem) { + return nil, false + } + return o.OperatingSystem, true +} + +// HasOperatingSystem returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystem() bool { + if o != nil && !IsNil(o.OperatingSystem) { + return true + } + + return false +} + +// SetOperatingSystem gets a reference to the given string and assigns it to the OperatingSystem field. +func (o *ImageConfig) SetOperatingSystem(v string) { + o.OperatingSystem = &v +} + +// GetOperatingSystemDistro returns the OperatingSystemDistro field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetOperatingSystemDistro() string { + if o == nil || IsNil(o.OperatingSystemDistro.Get()) { + var ret string + return ret + } + return *o.OperatingSystemDistro.Get() +} + +// GetOperatingSystemDistroOk returns a tuple with the OperatingSystemDistro field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetOperatingSystemDistroOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OperatingSystemDistro.Get(), o.OperatingSystemDistro.IsSet() +} + +// HasOperatingSystemDistro returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystemDistro() bool { + if o != nil && o.OperatingSystemDistro.IsSet() { + return true + } + + return false +} + +// SetOperatingSystemDistro gets a reference to the given NullableString and assigns it to the OperatingSystemDistro field. +func (o *ImageConfig) SetOperatingSystemDistro(v string) { + o.OperatingSystemDistro.Set(&v) +} + +// SetOperatingSystemDistroNil sets the value for OperatingSystemDistro to be an explicit nil +func (o *ImageConfig) SetOperatingSystemDistroNil() { + o.OperatingSystemDistro.Set(nil) +} + +// UnsetOperatingSystemDistro ensures that no value is present for OperatingSystemDistro, not even an explicit nil +func (o *ImageConfig) UnsetOperatingSystemDistro() { + o.OperatingSystemDistro.Unset() +} + +// GetOperatingSystemVersion returns the OperatingSystemVersion field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetOperatingSystemVersion() string { + if o == nil || IsNil(o.OperatingSystemVersion.Get()) { + var ret string + return ret + } + return *o.OperatingSystemVersion.Get() +} + +// GetOperatingSystemVersionOk returns a tuple with the OperatingSystemVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetOperatingSystemVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OperatingSystemVersion.Get(), o.OperatingSystemVersion.IsSet() +} + +// HasOperatingSystemVersion returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystemVersion() bool { + if o != nil && o.OperatingSystemVersion.IsSet() { + return true + } + + return false +} + +// SetOperatingSystemVersion gets a reference to the given NullableString and assigns it to the OperatingSystemVersion field. +func (o *ImageConfig) SetOperatingSystemVersion(v string) { + o.OperatingSystemVersion.Set(&v) +} + +// SetOperatingSystemVersionNil sets the value for OperatingSystemVersion to be an explicit nil +func (o *ImageConfig) SetOperatingSystemVersionNil() { + o.OperatingSystemVersion.Set(nil) +} + +// UnsetOperatingSystemVersion ensures that no value is present for OperatingSystemVersion, not even an explicit nil +func (o *ImageConfig) UnsetOperatingSystemVersion() { + o.OperatingSystemVersion.Unset() +} + +// GetRescueBus returns the RescueBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetRescueBus() string { + if o == nil || IsNil(o.RescueBus.Get()) { + var ret string + return ret + } + return *o.RescueBus.Get() +} + +// GetRescueBusOk returns a tuple with the RescueBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetRescueBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RescueBus.Get(), o.RescueBus.IsSet() +} + +// HasRescueBus returns a boolean if a field has been set. +func (o *ImageConfig) HasRescueBus() bool { + if o != nil && o.RescueBus.IsSet() { + return true + } + + return false +} + +// SetRescueBus gets a reference to the given NullableString and assigns it to the RescueBus field. +func (o *ImageConfig) SetRescueBus(v string) { + o.RescueBus.Set(&v) +} + +// SetRescueBusNil sets the value for RescueBus to be an explicit nil +func (o *ImageConfig) SetRescueBusNil() { + o.RescueBus.Set(nil) +} + +// UnsetRescueBus ensures that no value is present for RescueBus, not even an explicit nil +func (o *ImageConfig) UnsetRescueBus() { + o.RescueBus.Unset() +} + +// GetRescueDevice returns the RescueDevice field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetRescueDevice() string { + if o == nil || IsNil(o.RescueDevice.Get()) { + var ret string + return ret + } + return *o.RescueDevice.Get() +} + +// GetRescueDeviceOk returns a tuple with the RescueDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetRescueDeviceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RescueDevice.Get(), o.RescueDevice.IsSet() +} + +// HasRescueDevice returns a boolean if a field has been set. +func (o *ImageConfig) HasRescueDevice() bool { + if o != nil && o.RescueDevice.IsSet() { + return true + } + + return false +} + +// SetRescueDevice gets a reference to the given NullableString and assigns it to the RescueDevice field. +func (o *ImageConfig) SetRescueDevice(v string) { + o.RescueDevice.Set(&v) +} + +// SetRescueDeviceNil sets the value for RescueDevice to be an explicit nil +func (o *ImageConfig) SetRescueDeviceNil() { + o.RescueDevice.Set(nil) +} + +// UnsetRescueDevice ensures that no value is present for RescueDevice, not even an explicit nil +func (o *ImageConfig) UnsetRescueDevice() { + o.RescueDevice.Unset() +} + +// GetSecureBoot returns the SecureBoot field value if set, zero value otherwise. +func (o *ImageConfig) GetSecureBoot() bool { + if o == nil || IsNil(o.SecureBoot) { + var ret bool + return ret + } + return *o.SecureBoot +} + +// GetSecureBootOk returns a tuple with the SecureBoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetSecureBootOk() (*bool, bool) { + if o == nil || IsNil(o.SecureBoot) { + return nil, false + } + return o.SecureBoot, true +} + +// HasSecureBoot returns a boolean if a field has been set. +func (o *ImageConfig) HasSecureBoot() bool { + if o != nil && !IsNil(o.SecureBoot) { + return true + } + + return false +} + +// SetSecureBoot gets a reference to the given bool and assigns it to the SecureBoot field. +func (o *ImageConfig) SetSecureBoot(v bool) { + o.SecureBoot = &v +} + +// GetUefi returns the Uefi field value if set, zero value otherwise. +func (o *ImageConfig) GetUefi() bool { + if o == nil || IsNil(o.Uefi) { + var ret bool + return ret + } + return *o.Uefi +} + +// GetUefiOk returns a tuple with the Uefi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetUefiOk() (*bool, bool) { + if o == nil || IsNil(o.Uefi) { + return nil, false + } + return o.Uefi, true +} + +// HasUefi returns a boolean if a field has been set. +func (o *ImageConfig) HasUefi() bool { + if o != nil && !IsNil(o.Uefi) { + return true + } + + return false +} + +// SetUefi gets a reference to the given bool and assigns it to the Uefi field. +func (o *ImageConfig) SetUefi(v bool) { + o.Uefi = &v +} + +// GetVideoModel returns the VideoModel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetVideoModel() string { + if o == nil || IsNil(o.VideoModel.Get()) { + var ret string + return ret + } + return *o.VideoModel.Get() +} + +// GetVideoModelOk returns a tuple with the VideoModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetVideoModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VideoModel.Get(), o.VideoModel.IsSet() +} + +// HasVideoModel returns a boolean if a field has been set. +func (o *ImageConfig) HasVideoModel() bool { + if o != nil && o.VideoModel.IsSet() { + return true + } + + return false +} + +// SetVideoModel gets a reference to the given NullableString and assigns it to the VideoModel field. +func (o *ImageConfig) SetVideoModel(v string) { + o.VideoModel.Set(&v) +} + +// SetVideoModelNil sets the value for VideoModel to be an explicit nil +func (o *ImageConfig) SetVideoModelNil() { + o.VideoModel.Set(nil) +} + +// UnsetVideoModel ensures that no value is present for VideoModel, not even an explicit nil +func (o *ImageConfig) UnsetVideoModel() { + o.VideoModel.Unset() +} + +// GetVirtioScsi returns the VirtioScsi field value if set, zero value otherwise. +func (o *ImageConfig) GetVirtioScsi() bool { + if o == nil || IsNil(o.VirtioScsi) { + var ret bool + return ret + } + return *o.VirtioScsi +} + +// GetVirtioScsiOk returns a tuple with the VirtioScsi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetVirtioScsiOk() (*bool, bool) { + if o == nil || IsNil(o.VirtioScsi) { + return nil, false + } + return o.VirtioScsi, true +} + +// HasVirtioScsi returns a boolean if a field has been set. +func (o *ImageConfig) HasVirtioScsi() bool { + if o != nil && !IsNil(o.VirtioScsi) { + return true + } + + return false +} + +// SetVirtioScsi gets a reference to the given bool and assigns it to the VirtioScsi field. +func (o *ImageConfig) SetVirtioScsi(v bool) { + o.VirtioScsi = &v +} + +func (o ImageConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Architecture) { + toSerialize["architecture"] = o.Architecture + } + if !IsNil(o.BootMenu) { + toSerialize["bootMenu"] = o.BootMenu + } + if o.CdromBus.IsSet() { + toSerialize["cdromBus"] = o.CdromBus.Get() + } + if o.DiskBus.IsSet() { + toSerialize["diskBus"] = o.DiskBus.Get() + } + if o.NicModel.IsSet() { + toSerialize["nicModel"] = o.NicModel.Get() + } + if !IsNil(o.OperatingSystem) { + toSerialize["operatingSystem"] = o.OperatingSystem + } + if o.OperatingSystemDistro.IsSet() { + toSerialize["operatingSystemDistro"] = o.OperatingSystemDistro.Get() + } + if o.OperatingSystemVersion.IsSet() { + toSerialize["operatingSystemVersion"] = o.OperatingSystemVersion.Get() + } + if o.RescueBus.IsSet() { + toSerialize["rescueBus"] = o.RescueBus.Get() + } + if o.RescueDevice.IsSet() { + toSerialize["rescueDevice"] = o.RescueDevice.Get() + } + if !IsNil(o.SecureBoot) { + toSerialize["secureBoot"] = o.SecureBoot + } + if !IsNil(o.Uefi) { + toSerialize["uefi"] = o.Uefi + } + if o.VideoModel.IsSet() { + toSerialize["videoModel"] = o.VideoModel.Get() + } + if !IsNil(o.VirtioScsi) { + toSerialize["virtioScsi"] = o.VirtioScsi + } + return toSerialize, nil +} + +type NullableImageConfig struct { + value *ImageConfig + isSet bool +} + +func (v NullableImageConfig) Get() *ImageConfig { + return v.value +} + +func (v *NullableImageConfig) Set(val *ImageConfig) { + v.value = val + v.isSet = true +} + +func (v NullableImageConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableImageConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageConfig(val *ImageConfig) *NullableImageConfig { + return &NullableImageConfig{value: val, isSet: true} +} + +func (v NullableImageConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image_create_response.go b/services/iaas/v2api/model_image_create_response.go new file mode 100644 index 000000000..528ee929c --- /dev/null +++ b/services/iaas/v2api/model_image_create_response.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageCreateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageCreateResponse{} + +// ImageCreateResponse Image creation response. +type ImageCreateResponse struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + UploadUrl string `json:"uploadUrl"` +} + +type _ImageCreateResponse ImageCreateResponse + +// NewImageCreateResponse instantiates a new ImageCreateResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageCreateResponse(id string, uploadUrl string) *ImageCreateResponse { + this := ImageCreateResponse{} + this.Id = id + this.UploadUrl = uploadUrl + return &this +} + +// NewImageCreateResponseWithDefaults instantiates a new ImageCreateResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageCreateResponseWithDefaults() *ImageCreateResponse { + this := ImageCreateResponse{} + return &this +} + +// GetId returns the Id field value +func (o *ImageCreateResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ImageCreateResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ImageCreateResponse) SetId(v string) { + o.Id = v +} + +// GetUploadUrl returns the UploadUrl field value +func (o *ImageCreateResponse) GetUploadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.UploadUrl +} + +// GetUploadUrlOk returns a tuple with the UploadUrl field value +// and a boolean to check if the value has been set. +func (o *ImageCreateResponse) GetUploadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UploadUrl, true +} + +// SetUploadUrl sets field value +func (o *ImageCreateResponse) SetUploadUrl(v string) { + o.UploadUrl = v +} + +func (o ImageCreateResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageCreateResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["uploadUrl"] = o.UploadUrl + return toSerialize, nil +} + +func (o *ImageCreateResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uploadUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageCreateResponse := _ImageCreateResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageCreateResponse) + + if err != nil { + return err + } + + *o = ImageCreateResponse(varImageCreateResponse) + + return err +} + +type NullableImageCreateResponse struct { + value *ImageCreateResponse + isSet bool +} + +func (v NullableImageCreateResponse) Get() *ImageCreateResponse { + return v.value +} + +func (v *NullableImageCreateResponse) Set(val *ImageCreateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableImageCreateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableImageCreateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageCreateResponse(val *ImageCreateResponse) *NullableImageCreateResponse { + return &NullableImageCreateResponse{value: val, isSet: true} +} + +func (v NullableImageCreateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageCreateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image_from_volume_payload.go b/services/iaas/v2api/model_image_from_volume_payload.go new file mode 100644 index 000000000..27cb2c069 --- /dev/null +++ b/services/iaas/v2api/model_image_from_volume_payload.go @@ -0,0 +1,228 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageFromVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageFromVolumePayload{} + +// ImageFromVolumePayload Object that represents the upload request of an image to a volume. Used for creating an image from a volume. +type ImageFromVolumePayload struct { + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat string `json:"diskFormat"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // When true the created image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` +} + +type _ImageFromVolumePayload ImageFromVolumePayload + +// NewImageFromVolumePayload instantiates a new ImageFromVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageFromVolumePayload(diskFormat string, name string) *ImageFromVolumePayload { + this := ImageFromVolumePayload{} + this.DiskFormat = diskFormat + this.Name = name + var protected bool = false + this.Protected = &protected + return &this +} + +// NewImageFromVolumePayloadWithDefaults instantiates a new ImageFromVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageFromVolumePayloadWithDefaults() *ImageFromVolumePayload { + this := ImageFromVolumePayload{} + var protected bool = false + this.Protected = &protected + return &this +} + +// GetDiskFormat returns the DiskFormat field value +func (o *ImageFromVolumePayload) GetDiskFormat() string { + if o == nil { + var ret string + return ret + } + + return o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value +// and a boolean to check if the value has been set. +func (o *ImageFromVolumePayload) GetDiskFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DiskFormat, true +} + +// SetDiskFormat sets field value +func (o *ImageFromVolumePayload) SetDiskFormat(v string) { + o.DiskFormat = v +} + +// GetName returns the Name field value +func (o *ImageFromVolumePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *ImageFromVolumePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *ImageFromVolumePayload) SetName(v string) { + o.Name = v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *ImageFromVolumePayload) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageFromVolumePayload) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *ImageFromVolumePayload) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *ImageFromVolumePayload) SetProtected(v bool) { + o.Protected = &v +} + +func (o ImageFromVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageFromVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["diskFormat"] = o.DiskFormat + toSerialize["name"] = o.Name + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + return toSerialize, nil +} + +func (o *ImageFromVolumePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "diskFormat", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageFromVolumePayload := _ImageFromVolumePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageFromVolumePayload) + + if err != nil { + return err + } + + *o = ImageFromVolumePayload(varImageFromVolumePayload) + + return err +} + +type NullableImageFromVolumePayload struct { + value *ImageFromVolumePayload + isSet bool +} + +func (v NullableImageFromVolumePayload) Get() *ImageFromVolumePayload { + return v.value +} + +func (v *NullableImageFromVolumePayload) Set(val *ImageFromVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableImageFromVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableImageFromVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageFromVolumePayload(val *ImageFromVolumePayload) *NullableImageFromVolumePayload { + return &NullableImageFromVolumePayload{value: val, isSet: true} +} + +func (v NullableImageFromVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageFromVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image_list_response.go b/services/iaas/v2api/model_image_list_response.go new file mode 100644 index 000000000..8b4d7bd66 --- /dev/null +++ b/services/iaas/v2api/model_image_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageListResponse{} + +// ImageListResponse Image list response. +type ImageListResponse struct { + // A list containing image objects. + Items []Image `json:"items"` +} + +type _ImageListResponse ImageListResponse + +// NewImageListResponse instantiates a new ImageListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageListResponse(items []Image) *ImageListResponse { + this := ImageListResponse{} + this.Items = items + return &this +} + +// NewImageListResponseWithDefaults instantiates a new ImageListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageListResponseWithDefaults() *ImageListResponse { + this := ImageListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ImageListResponse) GetItems() []Image { + if o == nil { + var ret []Image + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ImageListResponse) GetItemsOk() ([]Image, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ImageListResponse) SetItems(v []Image) { + o.Items = v +} + +func (o ImageListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ImageListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageListResponse := _ImageListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageListResponse) + + if err != nil { + return err + } + + *o = ImageListResponse(varImageListResponse) + + return err +} + +type NullableImageListResponse struct { + value *ImageListResponse + isSet bool +} + +func (v NullableImageListResponse) Get() *ImageListResponse { + return v.value +} + +func (v *NullableImageListResponse) Set(val *ImageListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableImageListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableImageListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageListResponse(val *ImageListResponse) *NullableImageListResponse { + return &NullableImageListResponse{value: val, isSet: true} +} + +func (v NullableImageListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image_share.go b/services/iaas/v2api/model_image_share.go new file mode 100644 index 000000000..5185deea5 --- /dev/null +++ b/services/iaas/v2api/model_image_share.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ImageShare type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageShare{} + +// ImageShare Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type ImageShare struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewImageShare instantiates a new ImageShare object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageShare() *ImageShare { + this := ImageShare{} + return &this +} + +// NewImageShareWithDefaults instantiates a new ImageShare object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageShareWithDefaults() *ImageShare { + this := ImageShare{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *ImageShare) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShare) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *ImageShare) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *ImageShare) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *ImageShare) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShare) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *ImageShare) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *ImageShare) SetProjects(v []string) { + o.Projects = v +} + +func (o ImageShare) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageShare) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableImageShare struct { + value *ImageShare + isSet bool +} + +func (v NullableImageShare) Get() *ImageShare { + return v.value +} + +func (v *NullableImageShare) Set(val *ImageShare) { + v.value = val + v.isSet = true +} + +func (v NullableImageShare) IsSet() bool { + return v.isSet +} + +func (v *NullableImageShare) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageShare(val *ImageShare) *NullableImageShare { + return &NullableImageShare{value: val, isSet: true} +} + +func (v NullableImageShare) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageShare) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_image_share_consumer.go b/services/iaas/v2api/model_image_share_consumer.go new file mode 100644 index 000000000..e731d6e3d --- /dev/null +++ b/services/iaas/v2api/model_image_share_consumer.go @@ -0,0 +1,238 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "time" +) + +// checks if the ImageShareConsumer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageShareConsumer{} + +// ImageShareConsumer The details of an Image share consumer. +type ImageShareConsumer struct { + // Universally Unique Identifier (UUID). + ConsumerProjectId *string `json:"consumerProjectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +// NewImageShareConsumer instantiates a new ImageShareConsumer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageShareConsumer() *ImageShareConsumer { + this := ImageShareConsumer{} + return &this +} + +// NewImageShareConsumerWithDefaults instantiates a new ImageShareConsumer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageShareConsumerWithDefaults() *ImageShareConsumer { + this := ImageShareConsumer{} + return &this +} + +// GetConsumerProjectId returns the ConsumerProjectId field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetConsumerProjectId() string { + if o == nil || IsNil(o.ConsumerProjectId) { + var ret string + return ret + } + return *o.ConsumerProjectId +} + +// GetConsumerProjectIdOk returns a tuple with the ConsumerProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetConsumerProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ConsumerProjectId) { + return nil, false + } + return o.ConsumerProjectId, true +} + +// HasConsumerProjectId returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasConsumerProjectId() bool { + if o != nil && !IsNil(o.ConsumerProjectId) { + return true + } + + return false +} + +// SetConsumerProjectId gets a reference to the given string and assigns it to the ConsumerProjectId field. +func (o *ImageShareConsumer) SetConsumerProjectId(v string) { + o.ConsumerProjectId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ImageShareConsumer) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *ImageShareConsumer) SetImageId(v string) { + o.ImageId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *ImageShareConsumer) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o ImageShareConsumer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageShareConsumer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConsumerProjectId) { + toSerialize["consumerProjectId"] = o.ConsumerProjectId + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableImageShareConsumer struct { + value *ImageShareConsumer + isSet bool +} + +func (v NullableImageShareConsumer) Get() *ImageShareConsumer { + return v.value +} + +func (v *NullableImageShareConsumer) Set(val *ImageShareConsumer) { + v.value = val + v.isSet = true +} + +func (v NullableImageShareConsumer) IsSet() bool { + return v.isSet +} + +func (v *NullableImageShareConsumer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageShareConsumer(val *ImageShareConsumer) *NullableImageShareConsumer { + return &NullableImageShareConsumer{value: val, isSet: true} +} + +func (v NullableImageShareConsumer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageShareConsumer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_key_pair_list_response.go b/services/iaas/v2api/model_key_pair_list_response.go new file mode 100644 index 000000000..ced17a7a0 --- /dev/null +++ b/services/iaas/v2api/model_key_pair_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the KeyPairListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyPairListResponse{} + +// KeyPairListResponse SSH keypair list response. +type KeyPairListResponse struct { + // A list of SSH keypairs. + Items []Keypair `json:"items"` +} + +type _KeyPairListResponse KeyPairListResponse + +// NewKeyPairListResponse instantiates a new KeyPairListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeyPairListResponse(items []Keypair) *KeyPairListResponse { + this := KeyPairListResponse{} + this.Items = items + return &this +} + +// NewKeyPairListResponseWithDefaults instantiates a new KeyPairListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyPairListResponseWithDefaults() *KeyPairListResponse { + this := KeyPairListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *KeyPairListResponse) GetItems() []Keypair { + if o == nil { + var ret []Keypair + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *KeyPairListResponse) GetItemsOk() ([]Keypair, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *KeyPairListResponse) SetItems(v []Keypair) { + o.Items = v +} + +func (o KeyPairListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyPairListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *KeyPairListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeyPairListResponse := _KeyPairListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeyPairListResponse) + + if err != nil { + return err + } + + *o = KeyPairListResponse(varKeyPairListResponse) + + return err +} + +type NullableKeyPairListResponse struct { + value *KeyPairListResponse + isSet bool +} + +func (v NullableKeyPairListResponse) Get() *KeyPairListResponse { + return v.value +} + +func (v *NullableKeyPairListResponse) Set(val *KeyPairListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeyPairListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyPairListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyPairListResponse(val *KeyPairListResponse) *NullableKeyPairListResponse { + return &NullableKeyPairListResponse{value: val, isSet: true} +} + +func (v NullableKeyPairListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyPairListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_keypair.go b/services/iaas/v2api/model_keypair.go new file mode 100644 index 000000000..01b4f16b8 --- /dev/null +++ b/services/iaas/v2api/model_keypair.go @@ -0,0 +1,344 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Keypair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Keypair{} + +// Keypair Object that represents the public key of an SSH keypair and its name. +type Keypair struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents an SSH keypair MD5 fingerprint. + Fingerprint *string `json:"fingerprint,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // Object that represents a public SSH key. + PublicKey string `json:"publicKey" validate:"regexp=^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\\\\s+[A-Za-z0-9+\\/]+[=]{0,3}(\\\\s+.+)?\\\\s*$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Keypair Keypair + +// NewKeypair instantiates a new Keypair object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeypair(publicKey string) *Keypair { + this := Keypair{} + this.PublicKey = publicKey + return &this +} + +// NewKeypairWithDefaults instantiates a new Keypair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeypairWithDefaults() *Keypair { + this := Keypair{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Keypair) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Keypair) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Keypair) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *Keypair) GetFingerprint() string { + if o == nil || IsNil(o.Fingerprint) { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetFingerprintOk() (*string, bool) { + if o == nil || IsNil(o.Fingerprint) { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *Keypair) HasFingerprint() bool { + if o != nil && !IsNil(o.Fingerprint) { + return true + } + + return false +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *Keypair) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Keypair) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Keypair) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Keypair) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Keypair) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Keypair) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Keypair) SetName(v string) { + o.Name = &v +} + +// GetPublicKey returns the PublicKey field value +func (o *Keypair) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *Keypair) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *Keypair) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Keypair) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Keypair) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Keypair) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Keypair) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Keypair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Fingerprint) { + toSerialize["fingerprint"] = o.Fingerprint + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["publicKey"] = o.PublicKey + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Keypair) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "publicKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeypair := _Keypair{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeypair) + + if err != nil { + return err + } + + *o = Keypair(varKeypair) + + return err +} + +type NullableKeypair struct { + value *Keypair + isSet bool +} + +func (v NullableKeypair) Get() *Keypair { + return v.value +} + +func (v *NullableKeypair) Set(val *Keypair) { + v.value = val + v.isSet = true +} + +func (v NullableKeypair) IsSet() bool { + return v.isSet +} + +func (v *NullableKeypair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeypair(val *Keypair) *NullableKeypair { + return &NullableKeypair{value: val, isSet: true} +} + +func (v NullableKeypair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeypair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_machine_type.go b/services/iaas/v2api/model_machine_type.go new file mode 100644 index 000000000..58220dad9 --- /dev/null +++ b/services/iaas/v2api/model_machine_type.go @@ -0,0 +1,319 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the MachineType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MachineType{} + +// MachineType Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, `ram`, `vcpus`. +type MachineType struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Size in Gigabyte. + Disk int64 `json:"disk"` + // Properties to control certain aspects or scheduling behavior for an object. + ExtraSpecs map[string]interface{} `json:"extraSpecs,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Megabyte. + Ram int64 `json:"ram"` + // The number of virtual CPUs of a server. + Vcpus int64 `json:"vcpus"` +} + +type _MachineType MachineType + +// NewMachineType instantiates a new MachineType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMachineType(disk int64, name string, ram int64, vcpus int64) *MachineType { + this := MachineType{} + this.Disk = disk + this.Name = name + this.Ram = ram + this.Vcpus = vcpus + return &this +} + +// NewMachineTypeWithDefaults instantiates a new MachineType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMachineTypeWithDefaults() *MachineType { + this := MachineType{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MachineType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MachineType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *MachineType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *MachineType) SetDescription(v string) { + o.Description = &v +} + +// GetDisk returns the Disk field value +func (o *MachineType) GetDisk() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Disk +} + +// GetDiskOk returns a tuple with the Disk field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetDiskOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Disk, true +} + +// SetDisk sets field value +func (o *MachineType) SetDisk(v int64) { + o.Disk = v +} + +// GetExtraSpecs returns the ExtraSpecs field value if set, zero value otherwise. +func (o *MachineType) GetExtraSpecs() map[string]interface{} { + if o == nil || IsNil(o.ExtraSpecs) { + var ret map[string]interface{} + return ret + } + return o.ExtraSpecs +} + +// GetExtraSpecsOk returns a tuple with the ExtraSpecs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MachineType) GetExtraSpecsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ExtraSpecs) { + return map[string]interface{}{}, false + } + return o.ExtraSpecs, true +} + +// HasExtraSpecs returns a boolean if a field has been set. +func (o *MachineType) HasExtraSpecs() bool { + if o != nil && !IsNil(o.ExtraSpecs) { + return true + } + + return false +} + +// SetExtraSpecs gets a reference to the given map[string]interface{} and assigns it to the ExtraSpecs field. +func (o *MachineType) SetExtraSpecs(v map[string]interface{}) { + o.ExtraSpecs = v +} + +// GetName returns the Name field value +func (o *MachineType) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MachineType) SetName(v string) { + o.Name = v +} + +// GetRam returns the Ram field value +func (o *MachineType) GetRam() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Ram +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetRamOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Ram, true +} + +// SetRam sets field value +func (o *MachineType) SetRam(v int64) { + o.Ram = v +} + +// GetVcpus returns the Vcpus field value +func (o *MachineType) GetVcpus() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Vcpus +} + +// GetVcpusOk returns a tuple with the Vcpus field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetVcpusOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Vcpus, true +} + +// SetVcpus sets field value +func (o *MachineType) SetVcpus(v int64) { + o.Vcpus = v +} + +func (o MachineType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MachineType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["disk"] = o.Disk + if !IsNil(o.ExtraSpecs) { + toSerialize["extraSpecs"] = o.ExtraSpecs + } + toSerialize["name"] = o.Name + toSerialize["ram"] = o.Ram + toSerialize["vcpus"] = o.Vcpus + return toSerialize, nil +} + +func (o *MachineType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "disk", + "name", + "ram", + "vcpus", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMachineType := _MachineType{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMachineType) + + if err != nil { + return err + } + + *o = MachineType(varMachineType) + + return err +} + +type NullableMachineType struct { + value *MachineType + isSet bool +} + +func (v NullableMachineType) Get() *MachineType { + return v.value +} + +func (v *NullableMachineType) Set(val *MachineType) { + v.value = val + v.isSet = true +} + +func (v NullableMachineType) IsSet() bool { + return v.isSet +} + +func (v *NullableMachineType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMachineType(val *MachineType) *NullableMachineType { + return &NullableMachineType{value: val, isSet: true} +} + +func (v NullableMachineType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMachineType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_machine_type_list_response.go b/services/iaas/v2api/model_machine_type_list_response.go new file mode 100644 index 000000000..43ed2d1a7 --- /dev/null +++ b/services/iaas/v2api/model_machine_type_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the MachineTypeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MachineTypeListResponse{} + +// MachineTypeListResponse Machine type list response. +type MachineTypeListResponse struct { + // Machine type list. + Items []MachineType `json:"items"` +} + +type _MachineTypeListResponse MachineTypeListResponse + +// NewMachineTypeListResponse instantiates a new MachineTypeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMachineTypeListResponse(items []MachineType) *MachineTypeListResponse { + this := MachineTypeListResponse{} + this.Items = items + return &this +} + +// NewMachineTypeListResponseWithDefaults instantiates a new MachineTypeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMachineTypeListResponseWithDefaults() *MachineTypeListResponse { + this := MachineTypeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *MachineTypeListResponse) GetItems() []MachineType { + if o == nil { + var ret []MachineType + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *MachineTypeListResponse) GetItemsOk() ([]MachineType, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *MachineTypeListResponse) SetItems(v []MachineType) { + o.Items = v +} + +func (o MachineTypeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MachineTypeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *MachineTypeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMachineTypeListResponse := _MachineTypeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMachineTypeListResponse) + + if err != nil { + return err + } + + *o = MachineTypeListResponse(varMachineTypeListResponse) + + return err +} + +type NullableMachineTypeListResponse struct { + value *MachineTypeListResponse + isSet bool +} + +func (v NullableMachineTypeListResponse) Get() *MachineTypeListResponse { + return v.value +} + +func (v *NullableMachineTypeListResponse) Set(val *MachineTypeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMachineTypeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMachineTypeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMachineTypeListResponse(val *MachineTypeListResponse) *NullableMachineTypeListResponse { + return &NullableMachineTypeListResponse{value: val, isSet: true} +} + +func (v NullableMachineTypeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMachineTypeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_network.go b/services/iaas/v2api/model_network.go new file mode 100644 index 000000000..4a9710077 --- /dev/null +++ b/services/iaas/v2api/model_network.go @@ -0,0 +1,510 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Network type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Network{} + +// Network Object that represents a network. If no routing table is specified, the default routing table is used. +type Network struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Ipv4 *NetworkIPv4 `json:"ipv4,omitempty"` + Ipv6 *NetworkIPv6 `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Network Network + +// NewNetwork instantiates a new Network object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetwork(id string, name string, status string) *Network { + this := Network{} + this.Id = id + this.Name = name + this.Status = status + return &this +} + +// NewNetworkWithDefaults instantiates a new Network object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkWithDefaults() *Network { + this := Network{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Network) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Network) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Network) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *Network) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *Network) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *Network) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetId returns the Id field value +func (o *Network) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Network) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Network) SetId(v string) { + o.Id = v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *Network) GetIpv4() NetworkIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret NetworkIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetIpv4Ok() (*NetworkIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *Network) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given NetworkIPv4 and assigns it to the Ipv4 field. +func (o *Network) SetIpv4(v NetworkIPv4) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *Network) GetIpv6() NetworkIPv6 { + if o == nil || IsNil(o.Ipv6) { + var ret NetworkIPv6 + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetIpv6Ok() (*NetworkIPv6, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *Network) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given NetworkIPv6 and assigns it to the Ipv6 field. +func (o *Network) SetIpv6(v NetworkIPv6) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Network) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Network) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Network) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *Network) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Network) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Network) SetName(v string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *Network) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *Network) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *Network) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *Network) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *Network) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *Network) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +// GetStatus returns the Status field value +func (o *Network) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Network) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Network) SetStatus(v string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Network) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Network) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Network) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Network) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Network) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + toSerialize["id"] = o.Id + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + toSerialize["status"] = o.Status + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Network) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetwork := _Network{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetwork) + + if err != nil { + return err + } + + *o = Network(varNetwork) + + return err +} + +type NullableNetwork struct { + value *Network + isSet bool +} + +func (v NullableNetwork) Get() *Network { + return v.value +} + +func (v *NullableNetwork) Set(val *Network) { + v.value = val + v.isSet = true +} + +func (v NullableNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetwork(val *Network) *NullableNetwork { + return &NullableNetwork{value: val, isSet: true} +} + +func (v NullableNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_network_area.go b/services/iaas/v2api/model_network_area.go new file mode 100644 index 000000000..9bcdadd3c --- /dev/null +++ b/services/iaas/v2api/model_network_area.go @@ -0,0 +1,343 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the NetworkArea type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkArea{} + +// NetworkArea Object that represents a network area. +type NetworkArea struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` + // The amount of projects currently referencing a specific area. + ProjectCount *int64 `json:"projectCount,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _NetworkArea NetworkArea + +// NewNetworkArea instantiates a new NetworkArea object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkArea(name string) *NetworkArea { + this := NetworkArea{} + this.Name = name + return &this +} + +// NewNetworkAreaWithDefaults instantiates a new NetworkArea object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkAreaWithDefaults() *NetworkArea { + this := NetworkArea{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *NetworkArea) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *NetworkArea) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *NetworkArea) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NetworkArea) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkArea) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NetworkArea) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *NetworkArea) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *NetworkArea) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *NetworkArea) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *NetworkArea) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NetworkArea) SetName(v string) { + o.Name = v +} + +// GetProjectCount returns the ProjectCount field value if set, zero value otherwise. +func (o *NetworkArea) GetProjectCount() int64 { + if o == nil || IsNil(o.ProjectCount) { + var ret int64 + return ret + } + return *o.ProjectCount +} + +// GetProjectCountOk returns a tuple with the ProjectCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetProjectCountOk() (*int64, bool) { + if o == nil || IsNil(o.ProjectCount) { + return nil, false + } + return o.ProjectCount, true +} + +// HasProjectCount returns a boolean if a field has been set. +func (o *NetworkArea) HasProjectCount() bool { + if o != nil && !IsNil(o.ProjectCount) { + return true + } + + return false +} + +// SetProjectCount gets a reference to the given int64 and assigns it to the ProjectCount field. +func (o *NetworkArea) SetProjectCount(v int64) { + o.ProjectCount = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *NetworkArea) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *NetworkArea) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *NetworkArea) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o NetworkArea) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkArea) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.ProjectCount) { + toSerialize["projectCount"] = o.ProjectCount + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *NetworkArea) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkArea := _NetworkArea{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkArea) + + if err != nil { + return err + } + + *o = NetworkArea(varNetworkArea) + + return err +} + +type NullableNetworkArea struct { + value *NetworkArea + isSet bool +} + +func (v NullableNetworkArea) Get() *NetworkArea { + return v.value +} + +func (v *NullableNetworkArea) Set(val *NetworkArea) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkArea) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkArea) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkArea(val *NetworkArea) *NullableNetworkArea { + return &NullableNetworkArea{value: val, isSet: true} +} + +func (v NullableNetworkArea) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkArea) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_network_area_list_response.go b/services/iaas/v2api/model_network_area_list_response.go new file mode 100644 index 000000000..e3bc13918 --- /dev/null +++ b/services/iaas/v2api/model_network_area_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkAreaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkAreaListResponse{} + +// NetworkAreaListResponse Network area list response. +type NetworkAreaListResponse struct { + // A list of network areas. + Items []NetworkArea `json:"items"` +} + +type _NetworkAreaListResponse NetworkAreaListResponse + +// NewNetworkAreaListResponse instantiates a new NetworkAreaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkAreaListResponse(items []NetworkArea) *NetworkAreaListResponse { + this := NetworkAreaListResponse{} + this.Items = items + return &this +} + +// NewNetworkAreaListResponseWithDefaults instantiates a new NetworkAreaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkAreaListResponseWithDefaults() *NetworkAreaListResponse { + this := NetworkAreaListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkAreaListResponse) GetItems() []NetworkArea { + if o == nil { + var ret []NetworkArea + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkAreaListResponse) GetItemsOk() ([]NetworkArea, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkAreaListResponse) SetItems(v []NetworkArea) { + o.Items = v +} + +func (o NetworkAreaListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkAreaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkAreaListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkAreaListResponse := _NetworkAreaListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkAreaListResponse) + + if err != nil { + return err + } + + *o = NetworkAreaListResponse(varNetworkAreaListResponse) + + return err +} + +type NullableNetworkAreaListResponse struct { + value *NetworkAreaListResponse + isSet bool +} + +func (v NullableNetworkAreaListResponse) Get() *NetworkAreaListResponse { + return v.value +} + +func (v *NullableNetworkAreaListResponse) Set(val *NetworkAreaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkAreaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkAreaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkAreaListResponse(val *NetworkAreaListResponse) *NullableNetworkAreaListResponse { + return &NullableNetworkAreaListResponse{value: val, isSet: true} +} + +func (v NullableNetworkAreaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkAreaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_network_ipv4.go b/services/iaas/v2api/model_network_ipv4.go new file mode 100644 index 000000000..ef9f35cf5 --- /dev/null +++ b/services/iaas/v2api/model_network_ipv4.go @@ -0,0 +1,279 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv4{} + +// NetworkIPv4 Object that represents the IPv4 part of a network. +type NetworkIPv4 struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + Prefixes []string `json:"prefixes"` + // String that represents an IPv4 address. + PublicIp *string `json:"publicIp,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` +} + +type _NetworkIPv4 NetworkIPv4 + +// NewNetworkIPv4 instantiates a new NetworkIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkIPv4(prefixes []string) *NetworkIPv4 { + this := NetworkIPv4{} + this.Prefixes = prefixes + return &this +} + +// NewNetworkIPv4WithDefaults instantiates a new NetworkIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkIPv4WithDefaults() *NetworkIPv4 { + this := NetworkIPv4{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NetworkIPv4) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkIPv4) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkIPv4) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *NetworkIPv4) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *NetworkIPv4) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *NetworkIPv4) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *NetworkIPv4) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *NetworkIPv4) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *NetworkIPv4) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixes returns the Prefixes field value +func (o *NetworkIPv4) GetPrefixes() []string { + if o == nil { + var ret []string + return ret + } + + return o.Prefixes +} + +// GetPrefixesOk returns a tuple with the Prefixes field value +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetPrefixesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Prefixes, true +} + +// SetPrefixes sets field value +func (o *NetworkIPv4) SetPrefixes(v []string) { + o.Prefixes = v +} + +// GetPublicIp returns the PublicIp field value if set, zero value otherwise. +func (o *NetworkIPv4) GetPublicIp() string { + if o == nil || IsNil(o.PublicIp) { + var ret string + return ret + } + return *o.PublicIp +} + +// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetPublicIpOk() (*string, bool) { + if o == nil || IsNil(o.PublicIp) { + return nil, false + } + return o.PublicIp, true +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *NetworkIPv4) HasPublicIp() bool { + if o != nil && !IsNil(o.PublicIp) { + return true + } + + return false +} + +// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +func (o *NetworkIPv4) SetPublicIp(v string) { + o.PublicIp = &v +} + +func (o NetworkIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixes"] = o.Prefixes + if !IsNil(o.PublicIp) { + toSerialize["publicIp"] = o.PublicIp + } + return toSerialize, nil +} + +func (o *NetworkIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkIPv4 := _NetworkIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkIPv4) + + if err != nil { + return err + } + + *o = NetworkIPv4(varNetworkIPv4) + + return err +} + +type NullableNetworkIPv4 struct { + value *NetworkIPv4 + isSet bool +} + +func (v NullableNetworkIPv4) Get() *NetworkIPv4 { + return v.value +} + +func (v *NullableNetworkIPv4) Set(val *NetworkIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkIPv4(val *NetworkIPv4) *NullableNetworkIPv4 { + return &NullableNetworkIPv4{value: val, isSet: true} +} + +func (v NullableNetworkIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_network_ipv6.go b/services/iaas/v2api/model_network_ipv6.go new file mode 100644 index 000000000..314eb1044 --- /dev/null +++ b/services/iaas/v2api/model_network_ipv6.go @@ -0,0 +1,242 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv6{} + +// NetworkIPv6 Object that represents the IPv6 part of a network. +type NetworkIPv6 struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + Prefixes []string `json:"prefixes"` +} + +type _NetworkIPv6 NetworkIPv6 + +// NewNetworkIPv6 instantiates a new NetworkIPv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkIPv6(prefixes []string) *NetworkIPv6 { + this := NetworkIPv6{} + this.Prefixes = prefixes + return &this +} + +// NewNetworkIPv6WithDefaults instantiates a new NetworkIPv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkIPv6WithDefaults() *NetworkIPv6 { + this := NetworkIPv6{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NetworkIPv6) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkIPv6) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkIPv6) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *NetworkIPv6) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *NetworkIPv6) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *NetworkIPv6) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *NetworkIPv6) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv6) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *NetworkIPv6) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *NetworkIPv6) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixes returns the Prefixes field value +func (o *NetworkIPv6) GetPrefixes() []string { + if o == nil { + var ret []string + return ret + } + + return o.Prefixes +} + +// GetPrefixesOk returns a tuple with the Prefixes field value +// and a boolean to check if the value has been set. +func (o *NetworkIPv6) GetPrefixesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Prefixes, true +} + +// SetPrefixes sets field value +func (o *NetworkIPv6) SetPrefixes(v []string) { + o.Prefixes = v +} + +func (o NetworkIPv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixes"] = o.Prefixes + return toSerialize, nil +} + +func (o *NetworkIPv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkIPv6 := _NetworkIPv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkIPv6) + + if err != nil { + return err + } + + *o = NetworkIPv6(varNetworkIPv6) + + return err +} + +type NullableNetworkIPv6 struct { + value *NetworkIPv6 + isSet bool +} + +func (v NullableNetworkIPv6) Get() *NetworkIPv6 { + return v.value +} + +func (v *NullableNetworkIPv6) Set(val *NetworkIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkIPv6(val *NetworkIPv6) *NullableNetworkIPv6 { + return &NullableNetworkIPv6{value: val, isSet: true} +} + +func (v NullableNetworkIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_network_list_response.go b/services/iaas/v2api/model_network_list_response.go new file mode 100644 index 000000000..aba6eb34e --- /dev/null +++ b/services/iaas/v2api/model_network_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkListResponse{} + +// NetworkListResponse Network list response. +type NetworkListResponse struct { + // A list of networks. + Items []Network `json:"items"` +} + +type _NetworkListResponse NetworkListResponse + +// NewNetworkListResponse instantiates a new NetworkListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkListResponse(items []Network) *NetworkListResponse { + this := NetworkListResponse{} + this.Items = items + return &this +} + +// NewNetworkListResponseWithDefaults instantiates a new NetworkListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkListResponseWithDefaults() *NetworkListResponse { + this := NetworkListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkListResponse) GetItems() []Network { + if o == nil { + var ret []Network + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkListResponse) GetItemsOk() ([]Network, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkListResponse) SetItems(v []Network) { + o.Items = v +} + +func (o NetworkListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkListResponse := _NetworkListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkListResponse) + + if err != nil { + return err + } + + *o = NetworkListResponse(varNetworkListResponse) + + return err +} + +type NullableNetworkListResponse struct { + value *NetworkListResponse + isSet bool +} + +func (v NullableNetworkListResponse) Get() *NetworkListResponse { + return v.value +} + +func (v *NullableNetworkListResponse) Set(val *NetworkListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkListResponse(val *NetworkListResponse) *NullableNetworkListResponse { + return &NullableNetworkListResponse{value: val, isSet: true} +} + +func (v NullableNetworkListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_network_range.go b/services/iaas/v2api/model_network_range.go new file mode 100644 index 000000000..8b175a27b --- /dev/null +++ b/services/iaas/v2api/model_network_range.go @@ -0,0 +1,270 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the NetworkRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkRange{} + +// NetworkRange Object that represents a network range. +type NetworkRange struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Classless Inter-Domain Routing (CIDR). + Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _NetworkRange NetworkRange + +// NewNetworkRange instantiates a new NetworkRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkRange(prefix string) *NetworkRange { + this := NetworkRange{} + this.Prefix = prefix + return &this +} + +// NewNetworkRangeWithDefaults instantiates a new NetworkRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkRangeWithDefaults() *NetworkRange { + this := NetworkRange{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *NetworkRange) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *NetworkRange) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *NetworkRange) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NetworkRange) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkRange) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NetworkRange) SetId(v string) { + o.Id = &v +} + +// GetPrefix returns the Prefix field value +func (o *NetworkRange) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *NetworkRange) SetPrefix(v string) { + o.Prefix = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *NetworkRange) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *NetworkRange) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *NetworkRange) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o NetworkRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["prefix"] = o.Prefix + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *NetworkRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkRange := _NetworkRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkRange) + + if err != nil { + return err + } + + *o = NetworkRange(varNetworkRange) + + return err +} + +type NullableNetworkRange struct { + value *NetworkRange + isSet bool +} + +func (v NullableNetworkRange) Get() *NetworkRange { + return v.value +} + +func (v *NullableNetworkRange) Set(val *NetworkRange) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRange) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRange(val *NetworkRange) *NullableNetworkRange { + return &NullableNetworkRange{value: val, isSet: true} +} + +func (v NullableNetworkRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_network_range_list_response.go b/services/iaas/v2api/model_network_range_list_response.go new file mode 100644 index 000000000..49e41f6ee --- /dev/null +++ b/services/iaas/v2api/model_network_range_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkRangeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkRangeListResponse{} + +// NetworkRangeListResponse Network Range list response. +type NetworkRangeListResponse struct { + // A list of network ranges. + Items []NetworkRange `json:"items"` +} + +type _NetworkRangeListResponse NetworkRangeListResponse + +// NewNetworkRangeListResponse instantiates a new NetworkRangeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkRangeListResponse(items []NetworkRange) *NetworkRangeListResponse { + this := NetworkRangeListResponse{} + this.Items = items + return &this +} + +// NewNetworkRangeListResponseWithDefaults instantiates a new NetworkRangeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkRangeListResponseWithDefaults() *NetworkRangeListResponse { + this := NetworkRangeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkRangeListResponse) GetItems() []NetworkRange { + if o == nil { + var ret []NetworkRange + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkRangeListResponse) GetItemsOk() ([]NetworkRange, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkRangeListResponse) SetItems(v []NetworkRange) { + o.Items = v +} + +func (o NetworkRangeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkRangeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkRangeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkRangeListResponse := _NetworkRangeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkRangeListResponse) + + if err != nil { + return err + } + + *o = NetworkRangeListResponse(varNetworkRangeListResponse) + + return err +} + +type NullableNetworkRangeListResponse struct { + value *NetworkRangeListResponse + isSet bool +} + +func (v NullableNetworkRangeListResponse) Get() *NetworkRangeListResponse { + return v.value +} + +func (v *NullableNetworkRangeListResponse) Set(val *NetworkRangeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRangeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRangeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRangeListResponse(val *NetworkRangeListResponse) *NullableNetworkRangeListResponse { + return &NullableNetworkRangeListResponse{value: val, isSet: true} +} + +func (v NullableNetworkRangeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRangeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_nexthop_blackhole.go b/services/iaas/v2api/model_nexthop_blackhole.go new file mode 100644 index 000000000..f5cf18fef --- /dev/null +++ b/services/iaas/v2api/model_nexthop_blackhole.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopBlackhole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopBlackhole{} + +// NexthopBlackhole Object that represents a blackhole route. +type NexthopBlackhole struct { + Type string `json:"type"` +} + +type _NexthopBlackhole NexthopBlackhole + +// NewNexthopBlackhole instantiates a new NexthopBlackhole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopBlackhole(types string) *NexthopBlackhole { + this := NexthopBlackhole{} + this.Type = types + return &this +} + +// NewNexthopBlackholeWithDefaults instantiates a new NexthopBlackhole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopBlackholeWithDefaults() *NexthopBlackhole { + this := NexthopBlackhole{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopBlackhole) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopBlackhole) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopBlackhole) SetType(v string) { + o.Type = v +} + +func (o NexthopBlackhole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopBlackhole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *NexthopBlackhole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopBlackhole := _NexthopBlackhole{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopBlackhole) + + if err != nil { + return err + } + + *o = NexthopBlackhole(varNexthopBlackhole) + + return err +} + +type NullableNexthopBlackhole struct { + value *NexthopBlackhole + isSet bool +} + +func (v NullableNexthopBlackhole) Get() *NexthopBlackhole { + return v.value +} + +func (v *NullableNexthopBlackhole) Set(val *NexthopBlackhole) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopBlackhole) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopBlackhole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopBlackhole(val *NexthopBlackhole) *NullableNexthopBlackhole { + return &NullableNexthopBlackhole{value: val, isSet: true} +} + +func (v NullableNexthopBlackhole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopBlackhole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_nexthop_internet.go b/services/iaas/v2api/model_nexthop_internet.go new file mode 100644 index 000000000..44ed0b926 --- /dev/null +++ b/services/iaas/v2api/model_nexthop_internet.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopInternet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopInternet{} + +// NexthopInternet Object that represents a route to the internet. +type NexthopInternet struct { + Type string `json:"type"` +} + +type _NexthopInternet NexthopInternet + +// NewNexthopInternet instantiates a new NexthopInternet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopInternet(types string) *NexthopInternet { + this := NexthopInternet{} + this.Type = types + return &this +} + +// NewNexthopInternetWithDefaults instantiates a new NexthopInternet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopInternetWithDefaults() *NexthopInternet { + this := NexthopInternet{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopInternet) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopInternet) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopInternet) SetType(v string) { + o.Type = v +} + +func (o NexthopInternet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopInternet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *NexthopInternet) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopInternet := _NexthopInternet{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopInternet) + + if err != nil { + return err + } + + *o = NexthopInternet(varNexthopInternet) + + return err +} + +type NullableNexthopInternet struct { + value *NexthopInternet + isSet bool +} + +func (v NullableNexthopInternet) Get() *NexthopInternet { + return v.value +} + +func (v *NullableNexthopInternet) Set(val *NexthopInternet) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopInternet) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopInternet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopInternet(val *NexthopInternet) *NullableNexthopInternet { + return &NullableNexthopInternet{value: val, isSet: true} +} + +func (v NullableNexthopInternet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopInternet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_nexthop_ipv4.go b/services/iaas/v2api/model_nexthop_ipv4.go new file mode 100644 index 000000000..22bfdf029 --- /dev/null +++ b/services/iaas/v2api/model_nexthop_ipv4.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopIPv4{} + +// NexthopIPv4 Object that represents an IPv4 address. +type NexthopIPv4 struct { + Type string `json:"type"` + // An IPv4 address. + Value string `json:"value" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` +} + +type _NexthopIPv4 NexthopIPv4 + +// NewNexthopIPv4 instantiates a new NexthopIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopIPv4(types string, value string) *NexthopIPv4 { + this := NexthopIPv4{} + this.Type = types + this.Value = value + return &this +} + +// NewNexthopIPv4WithDefaults instantiates a new NexthopIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopIPv4WithDefaults() *NexthopIPv4 { + this := NexthopIPv4{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopIPv4) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv4) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopIPv4) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *NexthopIPv4) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv4) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *NexthopIPv4) SetValue(v string) { + o.Value = v +} + +func (o NexthopIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *NexthopIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopIPv4 := _NexthopIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopIPv4) + + if err != nil { + return err + } + + *o = NexthopIPv4(varNexthopIPv4) + + return err +} + +type NullableNexthopIPv4 struct { + value *NexthopIPv4 + isSet bool +} + +func (v NullableNexthopIPv4) Get() *NexthopIPv4 { + return v.value +} + +func (v *NullableNexthopIPv4) Set(val *NexthopIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopIPv4(val *NexthopIPv4) *NullableNexthopIPv4 { + return &NullableNexthopIPv4{value: val, isSet: true} +} + +func (v NullableNexthopIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_nexthop_ipv6.go b/services/iaas/v2api/model_nexthop_ipv6.go new file mode 100644 index 000000000..f6f77dd65 --- /dev/null +++ b/services/iaas/v2api/model_nexthop_ipv6.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopIPv6{} + +// NexthopIPv6 Object that represents an IPv6 address. +type NexthopIPv6 struct { + Type string `json:"type"` + // An IPv6 address. + Value string `json:"value" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` +} + +type _NexthopIPv6 NexthopIPv6 + +// NewNexthopIPv6 instantiates a new NexthopIPv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopIPv6(types string, value string) *NexthopIPv6 { + this := NexthopIPv6{} + this.Type = types + this.Value = value + return &this +} + +// NewNexthopIPv6WithDefaults instantiates a new NexthopIPv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopIPv6WithDefaults() *NexthopIPv6 { + this := NexthopIPv6{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopIPv6) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv6) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopIPv6) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *NexthopIPv6) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv6) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *NexthopIPv6) SetValue(v string) { + o.Value = v +} + +func (o NexthopIPv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *NexthopIPv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopIPv6 := _NexthopIPv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopIPv6) + + if err != nil { + return err + } + + *o = NexthopIPv6(varNexthopIPv6) + + return err +} + +type NullableNexthopIPv6 struct { + value *NexthopIPv6 + isSet bool +} + +func (v NullableNexthopIPv6) Get() *NexthopIPv6 { + return v.value +} + +func (v *NullableNexthopIPv6) Set(val *NexthopIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopIPv6(val *NexthopIPv6) *NullableNexthopIPv6 { + return &NullableNexthopIPv6{value: val, isSet: true} +} + +func (v NullableNexthopIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_nic.go b/services/iaas/v2api/model_nic.go new file mode 100644 index 000000000..690741cf4 --- /dev/null +++ b/services/iaas/v2api/model_nic.go @@ -0,0 +1,611 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the NIC type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NIC{} + +// NIC Object that represents a network interface. +type NIC struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Device *string `json:"device,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents an MAC address. + Mac *string `json:"mac,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` + // Possible values: `ACTIVE`, `DOWN`. + Status *string `json:"status,omitempty"` + // Possible values: `server`, `metadata`, `gateway`, `none`. + Type *string `json:"type,omitempty"` +} + +// NewNIC instantiates a new NIC object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNIC() *NIC { + this := NIC{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// NewNICWithDefaults instantiates a new NIC object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNICWithDefaults() *NIC { + this := NIC{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *NIC) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *NIC) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *NIC) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *NIC) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *NIC) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *NIC) SetDescription(v string) { + o.Description = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *NIC) GetDevice() string { + if o == nil || IsNil(o.Device) { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetDeviceOk() (*string, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *NIC) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *NIC) SetDevice(v string) { + o.Device = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NIC) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NIC) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NIC) SetId(v string) { + o.Id = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *NIC) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *NIC) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *NIC) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *NIC) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *NIC) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *NIC) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *NIC) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *NIC) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *NIC) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMac returns the Mac field value if set, zero value otherwise. +func (o *NIC) GetMac() string { + if o == nil || IsNil(o.Mac) { + var ret string + return ret + } + return *o.Mac +} + +// GetMacOk returns a tuple with the Mac field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetMacOk() (*string, bool) { + if o == nil || IsNil(o.Mac) { + return nil, false + } + return o.Mac, true +} + +// HasMac returns a boolean if a field has been set. +func (o *NIC) HasMac() bool { + if o != nil && !IsNil(o.Mac) { + return true + } + + return false +} + +// SetMac gets a reference to the given string and assigns it to the Mac field. +func (o *NIC) SetMac(v string) { + o.Mac = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *NIC) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *NIC) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *NIC) SetName(v string) { + o.Name = &v +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *NIC) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *NIC) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *NIC) SetNetworkId(v string) { + o.NetworkId = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *NIC) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *NIC) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *NIC) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *NIC) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *NIC) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *NIC) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *NIC) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *NIC) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *NIC) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *NIC) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *NIC) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *NIC) SetType(v string) { + o.Type = &v +} + +func (o NIC) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NIC) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Mac) { + toSerialize["mac"] = o.Mac + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableNIC struct { + value *NIC + isSet bool +} + +func (v NullableNIC) Get() *NIC { + return v.value +} + +func (v *NullableNIC) Set(val *NIC) { + v.value = val + v.isSet = true +} + +func (v NullableNIC) IsSet() bool { + return v.isSet +} + +func (v *NullableNIC) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNIC(val *NIC) *NullableNIC { + return &NullableNIC{value: val, isSet: true} +} + +func (v NullableNIC) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNIC) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_nic_list_response.go b/services/iaas/v2api/model_nic_list_response.go new file mode 100644 index 000000000..7872db08f --- /dev/null +++ b/services/iaas/v2api/model_nic_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NICListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NICListResponse{} + +// NICListResponse NIC list response. +type NICListResponse struct { + // A list of network interfaces. + Items []NIC `json:"items"` +} + +type _NICListResponse NICListResponse + +// NewNICListResponse instantiates a new NICListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNICListResponse(items []NIC) *NICListResponse { + this := NICListResponse{} + this.Items = items + return &this +} + +// NewNICListResponseWithDefaults instantiates a new NICListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNICListResponseWithDefaults() *NICListResponse { + this := NICListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NICListResponse) GetItems() []NIC { + if o == nil { + var ret []NIC + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NICListResponse) GetItemsOk() ([]NIC, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NICListResponse) SetItems(v []NIC) { + o.Items = v +} + +func (o NICListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NICListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NICListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNICListResponse := _NICListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNICListResponse) + + if err != nil { + return err + } + + *o = NICListResponse(varNICListResponse) + + return err +} + +type NullableNICListResponse struct { + value *NICListResponse + isSet bool +} + +func (v NullableNICListResponse) Get() *NICListResponse { + return v.value +} + +func (v *NullableNICListResponse) Set(val *NICListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNICListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNICListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNICListResponse(val *NICListResponse) *NullableNICListResponse { + return &NullableNICListResponse{value: val, isSet: true} +} + +func (v NullableNICListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNICListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_partial_update_network_area_payload.go b/services/iaas/v2api/model_partial_update_network_area_payload.go new file mode 100644 index 000000000..99c12ab85 --- /dev/null +++ b/services/iaas/v2api/model_partial_update_network_area_payload.go @@ -0,0 +1,162 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateNetworkAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkAreaPayload{} + +// PartialUpdateNetworkAreaPayload Object that represents the network area update request. +type PartialUpdateNetworkAreaPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewPartialUpdateNetworkAreaPayload instantiates a new PartialUpdateNetworkAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateNetworkAreaPayload() *PartialUpdateNetworkAreaPayload { + this := PartialUpdateNetworkAreaPayload{} + return &this +} + +// NewPartialUpdateNetworkAreaPayloadWithDefaults instantiates a new PartialUpdateNetworkAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateNetworkAreaPayloadWithDefaults() *PartialUpdateNetworkAreaPayload { + this := PartialUpdateNetworkAreaPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkAreaPayload) SetName(v string) { + o.Name = &v +} + +func (o PartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkAreaPayload struct { + value *PartialUpdateNetworkAreaPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkAreaPayload) Get() *PartialUpdateNetworkAreaPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkAreaPayload) Set(val *PartialUpdateNetworkAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkAreaPayload(val *PartialUpdateNetworkAreaPayload) *NullablePartialUpdateNetworkAreaPayload { + return &NullablePartialUpdateNetworkAreaPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_partial_update_network_payload.go b/services/iaas/v2api/model_partial_update_network_payload.go new file mode 100644 index 000000000..155e6dddc --- /dev/null +++ b/services/iaas/v2api/model_partial_update_network_payload.go @@ -0,0 +1,346 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkPayload{} + +// PartialUpdateNetworkPayload Object that represents the request body for a network update. +type PartialUpdateNetworkPayload struct { + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + Ipv4 *UpdateNetworkIPv4Body `json:"ipv4,omitempty"` + Ipv6 *UpdateNetworkIPv6Body `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewPartialUpdateNetworkPayload instantiates a new PartialUpdateNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateNetworkPayload() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// NewPartialUpdateNetworkPayloadWithDefaults instantiates a new PartialUpdateNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *PartialUpdateNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetIpv4() UpdateNetworkIPv4Body { + if o == nil || IsNil(o.Ipv4) { + var ret UpdateNetworkIPv4Body + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetIpv4Ok() (*UpdateNetworkIPv4Body, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. +func (o *PartialUpdateNetworkPayload) SetIpv4(v UpdateNetworkIPv4Body) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetIpv6() UpdateNetworkIPv6Body { + if o == nil || IsNil(o.Ipv6) { + var ret UpdateNetworkIPv6Body + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetIpv6Ok() (*UpdateNetworkIPv6Body, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. +func (o *PartialUpdateNetworkPayload) SetIpv6(v UpdateNetworkIPv6Body) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkPayload) SetName(v string) { + o.Name = &v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *PartialUpdateNetworkPayload) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *PartialUpdateNetworkPayload) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +func (o PartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkPayload struct { + value *PartialUpdateNetworkPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkPayload) Get() *PartialUpdateNetworkPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkPayload) Set(val *PartialUpdateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkPayload(val *PartialUpdateNetworkPayload) *NullablePartialUpdateNetworkPayload { + return &NullablePartialUpdateNetworkPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_port_range.go b/services/iaas/v2api/model_port_range.go new file mode 100644 index 000000000..8e16f84f9 --- /dev/null +++ b/services/iaas/v2api/model_port_range.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PortRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortRange{} + +// PortRange Object that represents a range of ports. +type PortRange struct { + // The maximum port number. Should be greater or equal to the minimum. + Max int64 `json:"max"` + // The minimum port number. Should be less or equal to the maximum. + Min int64 `json:"min"` +} + +type _PortRange PortRange + +// NewPortRange instantiates a new PortRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortRange(max int64, min int64) *PortRange { + this := PortRange{} + this.Max = max + this.Min = min + return &this +} + +// NewPortRangeWithDefaults instantiates a new PortRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortRangeWithDefaults() *PortRange { + this := PortRange{} + return &this +} + +// GetMax returns the Max field value +func (o *PortRange) GetMax() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Max +} + +// GetMaxOk returns a tuple with the Max field value +// and a boolean to check if the value has been set. +func (o *PortRange) GetMaxOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value +func (o *PortRange) SetMax(v int64) { + o.Max = v +} + +// GetMin returns the Min field value +func (o *PortRange) GetMin() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Min +} + +// GetMinOk returns a tuple with the Min field value +// and a boolean to check if the value has been set. +func (o *PortRange) GetMinOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value +func (o *PortRange) SetMin(v int64) { + o.Min = v +} + +func (o PortRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + return toSerialize, nil +} + +func (o *PortRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "max", + "min", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPortRange := _PortRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPortRange) + + if err != nil { + return err + } + + *o = PortRange(varPortRange) + + return err +} + +type NullablePortRange struct { + value *PortRange + isSet bool +} + +func (v NullablePortRange) Get() *PortRange { + return v.value +} + +func (v *NullablePortRange) Set(val *PortRange) { + v.value = val + v.isSet = true +} + +func (v NullablePortRange) IsSet() bool { + return v.isSet +} + +func (v *NullablePortRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortRange(val *PortRange) *NullablePortRange { + return &NullablePortRange{value: val, isSet: true} +} + +func (v NullablePortRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_project.go b/services/iaas/v2api/model_project.go new file mode 100644 index 000000000..6ca0c6615 --- /dev/null +++ b/services/iaas/v2api/model_project.go @@ -0,0 +1,326 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Project type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Project{} + +// Project Object that represents a STACKIT project. +type Project struct { + AreaId AreaId `json:"areaId"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + InternetAccess *bool `json:"internetAccess,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Project Project + +// NewProject instantiates a new Project object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProject(areaId AreaId, id string, status string) *Project { + this := Project{} + this.AreaId = areaId + this.Id = id + this.Status = status + return &this +} + +// NewProjectWithDefaults instantiates a new Project object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectWithDefaults() *Project { + this := Project{} + return &this +} + +// GetAreaId returns the AreaId field value +func (o *Project) GetAreaId() AreaId { + if o == nil { + var ret AreaId + return ret + } + + return o.AreaId +} + +// GetAreaIdOk returns a tuple with the AreaId field value +// and a boolean to check if the value has been set. +func (o *Project) GetAreaIdOk() (*AreaId, bool) { + if o == nil { + return nil, false + } + return &o.AreaId, true +} + +// SetAreaId sets field value +func (o *Project) SetAreaId(v AreaId) { + o.AreaId = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Project) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Project) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Project) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value +func (o *Project) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Project) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Project) SetId(v string) { + o.Id = v +} + +// GetInternetAccess returns the InternetAccess field value if set, zero value otherwise. +func (o *Project) GetInternetAccess() bool { + if o == nil || IsNil(o.InternetAccess) { + var ret bool + return ret + } + return *o.InternetAccess +} + +// GetInternetAccessOk returns a tuple with the InternetAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetInternetAccessOk() (*bool, bool) { + if o == nil || IsNil(o.InternetAccess) { + return nil, false + } + return o.InternetAccess, true +} + +// HasInternetAccess returns a boolean if a field has been set. +func (o *Project) HasInternetAccess() bool { + if o != nil && !IsNil(o.InternetAccess) { + return true + } + + return false +} + +// SetInternetAccess gets a reference to the given bool and assigns it to the InternetAccess field. +func (o *Project) SetInternetAccess(v bool) { + o.InternetAccess = &v +} + +// GetStatus returns the Status field value +func (o *Project) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Project) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Project) SetStatus(v string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Project) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Project) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Project) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Project) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Project) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["areaId"] = o.AreaId + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["id"] = o.Id + if !IsNil(o.InternetAccess) { + toSerialize["internetAccess"] = o.InternetAccess + } + toSerialize["status"] = o.Status + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Project) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "areaId", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProject := _Project{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProject) + + if err != nil { + return err + } + + *o = Project(varProject) + + return err +} + +type NullableProject struct { + value *Project + isSet bool +} + +func (v NullableProject) Get() *Project { + return v.value +} + +func (v *NullableProject) Set(val *Project) { + v.value = val + v.isSet = true +} + +func (v NullableProject) IsSet() bool { + return v.isSet +} + +func (v *NullableProject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProject(val *Project) *NullableProject { + return &NullableProject{value: val, isSet: true} +} + +func (v NullableProject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_project_list_response.go b/services/iaas/v2api/model_project_list_response.go new file mode 100644 index 000000000..1cd757529 --- /dev/null +++ b/services/iaas/v2api/model_project_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ProjectListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectListResponse{} + +// ProjectListResponse Project list response. +type ProjectListResponse struct { + // A list of STACKIT projects. + Items []string `json:"items"` +} + +type _ProjectListResponse ProjectListResponse + +// NewProjectListResponse instantiates a new ProjectListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectListResponse(items []string) *ProjectListResponse { + this := ProjectListResponse{} + this.Items = items + return &this +} + +// NewProjectListResponseWithDefaults instantiates a new ProjectListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectListResponseWithDefaults() *ProjectListResponse { + this := ProjectListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ProjectListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ProjectListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ProjectListResponse) SetItems(v []string) { + o.Items = v +} + +func (o ProjectListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ProjectListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectListResponse := _ProjectListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProjectListResponse) + + if err != nil { + return err + } + + *o = ProjectListResponse(varProjectListResponse) + + return err +} + +type NullableProjectListResponse struct { + value *ProjectListResponse + isSet bool +} + +func (v NullableProjectListResponse) Get() *ProjectListResponse { + return v.value +} + +func (v *NullableProjectListResponse) Set(val *ProjectListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableProjectListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectListResponse(val *ProjectListResponse) *NullableProjectListResponse { + return &NullableProjectListResponse{value: val, isSet: true} +} + +func (v NullableProjectListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_protocol.go b/services/iaas/v2api/model_protocol.go new file mode 100644 index 000000000..1b13c1102 --- /dev/null +++ b/services/iaas/v2api/model_protocol.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the Protocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Protocol{} + +// Protocol The schema for a protocol of a security group rule. +type Protocol struct { + // The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`. + Name *string `json:"name,omitempty"` + // The protocol number which the rule should match. + Number *int64 `json:"number,omitempty"` +} + +// NewProtocol instantiates a new Protocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProtocol() *Protocol { + this := Protocol{} + return &this +} + +// NewProtocolWithDefaults instantiates a new Protocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProtocolWithDefaults() *Protocol { + this := Protocol{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Protocol) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Protocol) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Protocol) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Protocol) SetName(v string) { + o.Name = &v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *Protocol) GetNumber() int64 { + if o == nil || IsNil(o.Number) { + var ret int64 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Protocol) GetNumberOk() (*int64, bool) { + if o == nil || IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *Protocol) HasNumber() bool { + if o != nil && !IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given int64 and assigns it to the Number field. +func (o *Protocol) SetNumber(v int64) { + o.Number = &v +} + +func (o Protocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Protocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Number) { + toSerialize["number"] = o.Number + } + return toSerialize, nil +} + +type NullableProtocol struct { + value *Protocol + isSet bool +} + +func (v NullableProtocol) Get() *Protocol { + return v.value +} + +func (v *NullableProtocol) Set(val *Protocol) { + v.value = val + v.isSet = true +} + +func (v NullableProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocol(val *Protocol) *NullableProtocol { + return &NullableProtocol{value: val, isSet: true} +} + +func (v NullableProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_public_ip.go b/services/iaas/v2api/model_public_ip.go new file mode 100644 index 000000000..dc04d3cf2 --- /dev/null +++ b/services/iaas/v2api/model_public_ip.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the PublicIp type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicIp{} + +// PublicIp Object that represents a public IP. +type PublicIp struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // String that represents an IPv4 address. + Ip *string `json:"ip,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewPublicIp instantiates a new PublicIp object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicIp() *PublicIp { + this := PublicIp{} + return &this +} + +// NewPublicIpWithDefaults instantiates a new PublicIp object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicIpWithDefaults() *PublicIp { + this := PublicIp{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PublicIp) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PublicIp) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PublicIp) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *PublicIp) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *PublicIp) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *PublicIp) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PublicIp) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PublicIp) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PublicIp) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PublicIp) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PublicIp) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *PublicIp) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *PublicIp) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *PublicIp) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *PublicIp) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o PublicIp) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicIp) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullablePublicIp struct { + value *PublicIp + isSet bool +} + +func (v NullablePublicIp) Get() *PublicIp { + return v.value +} + +func (v *NullablePublicIp) Set(val *PublicIp) { + v.value = val + v.isSet = true +} + +func (v NullablePublicIp) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicIp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicIp(val *PublicIp) *NullablePublicIp { + return &NullablePublicIp{value: val, isSet: true} +} + +func (v NullablePublicIp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicIp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_public_ip_list_response.go b/services/iaas/v2api/model_public_ip_list_response.go new file mode 100644 index 000000000..8a01f5d8b --- /dev/null +++ b/services/iaas/v2api/model_public_ip_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicIpListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicIpListResponse{} + +// PublicIpListResponse Public IP list response. +type PublicIpListResponse struct { + // A list of public IPs. + Items []PublicIp `json:"items"` +} + +type _PublicIpListResponse PublicIpListResponse + +// NewPublicIpListResponse instantiates a new PublicIpListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicIpListResponse(items []PublicIp) *PublicIpListResponse { + this := PublicIpListResponse{} + this.Items = items + return &this +} + +// NewPublicIpListResponseWithDefaults instantiates a new PublicIpListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicIpListResponseWithDefaults() *PublicIpListResponse { + this := PublicIpListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *PublicIpListResponse) GetItems() []PublicIp { + if o == nil { + var ret []PublicIp + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *PublicIpListResponse) GetItemsOk() ([]PublicIp, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *PublicIpListResponse) SetItems(v []PublicIp) { + o.Items = v +} + +func (o PublicIpListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicIpListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *PublicIpListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicIpListResponse := _PublicIpListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicIpListResponse) + + if err != nil { + return err + } + + *o = PublicIpListResponse(varPublicIpListResponse) + + return err +} + +type NullablePublicIpListResponse struct { + value *PublicIpListResponse + isSet bool +} + +func (v NullablePublicIpListResponse) Get() *PublicIpListResponse { + return v.value +} + +func (v *NullablePublicIpListResponse) Set(val *PublicIpListResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePublicIpListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicIpListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicIpListResponse(val *PublicIpListResponse) *NullablePublicIpListResponse { + return &NullablePublicIpListResponse{value: val, isSet: true} +} + +func (v NullablePublicIpListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicIpListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_public_network.go b/services/iaas/v2api/model_public_network.go new file mode 100644 index 000000000..7698053da --- /dev/null +++ b/services/iaas/v2api/model_public_network.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicNetwork{} + +// PublicNetwork Public network. +type PublicNetwork struct { + // Classless Inter-Domain Routing (CIDR). + Cidr string `json:"cidr" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + // Name of the region. + Region string `json:"region"` +} + +type _PublicNetwork PublicNetwork + +// NewPublicNetwork instantiates a new PublicNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicNetwork(cidr string, region string) *PublicNetwork { + this := PublicNetwork{} + this.Cidr = cidr + this.Region = region + return &this +} + +// NewPublicNetworkWithDefaults instantiates a new PublicNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicNetworkWithDefaults() *PublicNetwork { + this := PublicNetwork{} + return &this +} + +// GetCidr returns the Cidr field value +func (o *PublicNetwork) GetCidr() string { + if o == nil { + var ret string + return ret + } + + return o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value +// and a boolean to check if the value has been set. +func (o *PublicNetwork) GetCidrOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cidr, true +} + +// SetCidr sets field value +func (o *PublicNetwork) SetCidr(v string) { + o.Cidr = v +} + +// GetRegion returns the Region field value +func (o *PublicNetwork) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *PublicNetwork) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *PublicNetwork) SetRegion(v string) { + o.Region = v +} + +func (o PublicNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cidr"] = o.Cidr + toSerialize["region"] = o.Region + return toSerialize, nil +} + +func (o *PublicNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cidr", + "region", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicNetwork := _PublicNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicNetwork) + + if err != nil { + return err + } + + *o = PublicNetwork(varPublicNetwork) + + return err +} + +type NullablePublicNetwork struct { + value *PublicNetwork + isSet bool +} + +func (v NullablePublicNetwork) Get() *PublicNetwork { + return v.value +} + +func (v *NullablePublicNetwork) Set(val *PublicNetwork) { + v.value = val + v.isSet = true +} + +func (v NullablePublicNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicNetwork(val *PublicNetwork) *NullablePublicNetwork { + return &NullablePublicNetwork{value: val, isSet: true} +} + +func (v NullablePublicNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_public_network_list_response.go b/services/iaas/v2api/model_public_network_list_response.go new file mode 100644 index 000000000..603f08157 --- /dev/null +++ b/services/iaas/v2api/model_public_network_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicNetworkListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicNetworkListResponse{} + +// PublicNetworkListResponse Public network list response. +type PublicNetworkListResponse struct { + // A list of public networks. + Items []PublicNetwork `json:"items"` +} + +type _PublicNetworkListResponse PublicNetworkListResponse + +// NewPublicNetworkListResponse instantiates a new PublicNetworkListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicNetworkListResponse(items []PublicNetwork) *PublicNetworkListResponse { + this := PublicNetworkListResponse{} + this.Items = items + return &this +} + +// NewPublicNetworkListResponseWithDefaults instantiates a new PublicNetworkListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicNetworkListResponseWithDefaults() *PublicNetworkListResponse { + this := PublicNetworkListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *PublicNetworkListResponse) GetItems() []PublicNetwork { + if o == nil { + var ret []PublicNetwork + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *PublicNetworkListResponse) GetItemsOk() ([]PublicNetwork, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *PublicNetworkListResponse) SetItems(v []PublicNetwork) { + o.Items = v +} + +func (o PublicNetworkListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicNetworkListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *PublicNetworkListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicNetworkListResponse := _PublicNetworkListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicNetworkListResponse) + + if err != nil { + return err + } + + *o = PublicNetworkListResponse(varPublicNetworkListResponse) + + return err +} + +type NullablePublicNetworkListResponse struct { + value *PublicNetworkListResponse + isSet bool +} + +func (v NullablePublicNetworkListResponse) Get() *PublicNetworkListResponse { + return v.value +} + +func (v *NullablePublicNetworkListResponse) Set(val *PublicNetworkListResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePublicNetworkListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicNetworkListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicNetworkListResponse(val *PublicNetworkListResponse) *NullablePublicNetworkListResponse { + return &NullablePublicNetworkListResponse{value: val, isSet: true} +} + +func (v NullablePublicNetworkListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicNetworkListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_quota.go b/services/iaas/v2api/model_quota.go new file mode 100644 index 000000000..20cf4eb9f --- /dev/null +++ b/services/iaas/v2api/model_quota.go @@ -0,0 +1,185 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Quota type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Quota{} + +// Quota Object that represents a single resource quota. +type Quota struct { + Limit int64 `json:"limit"` + Usage int64 `json:"usage"` +} + +type _Quota Quota + +// NewQuota instantiates a new Quota object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuota(limit int64, usage int64) *Quota { + this := Quota{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaWithDefaults instantiates a new Quota object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaWithDefaults() *Quota { + this := Quota{} + return &this +} + +// GetLimit returns the Limit field value +func (o *Quota) GetLimit() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *Quota) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *Quota) SetLimit(v int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *Quota) GetUsage() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *Quota) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Usage, true +} + +// SetUsage sets field value +func (o *Quota) SetUsage(v int64) { + o.Usage = v +} + +func (o Quota) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Quota) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +func (o *Quota) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "limit", + "usage", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuota := _Quota{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuota) + + if err != nil { + return err + } + + *o = Quota(varQuota) + + return err +} + +type NullableQuota struct { + value *Quota + isSet bool +} + +func (v NullableQuota) Get() *Quota { + return v.value +} + +func (v *NullableQuota) Set(val *Quota) { + v.value = val + v.isSet = true +} + +func (v NullableQuota) IsSet() bool { + return v.isSet +} + +func (v *NullableQuota) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuota(val *Quota) *NullableQuota { + return &NullableQuota{value: val, isSet: true} +} + +func (v NullableQuota) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuota) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_quota_list.go b/services/iaas/v2api/model_quota_list.go new file mode 100644 index 000000000..84bc35882 --- /dev/null +++ b/services/iaas/v2api/model_quota_list.go @@ -0,0 +1,477 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the QuotaList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaList{} + +// QuotaList Object that represents the quotas for a project. +type QuotaList struct { + // Total size in GiB of backups. + BackupGigabytes Quota `json:"backupGigabytes"` + // Number of backups. + Backups Quota `json:"backups"` + // Total size in GiB of volumes and snapshots. + Gigabytes Quota `json:"gigabytes"` + // Number of networks. + Networks Quota `json:"networks"` + // Number of network interfaces. + Nics Quota `json:"nics"` + // Number of public IP addresses. + PublicIps Quota `json:"publicIps"` + // Amount of server RAM in MiB. + Ram Quota `json:"ram"` + // Number of security group rules. + SecurityGroupRules Quota `json:"securityGroupRules"` + // Number of security groups. + SecurityGroups Quota `json:"securityGroups"` + // Number of snapshots. + Snapshots Quota `json:"snapshots"` + // Number of server cores. + Vcpu Quota `json:"vcpu"` + // Number of volumes. + Volumes Quota `json:"volumes"` +} + +type _QuotaList QuotaList + +// NewQuotaList instantiates a new QuotaList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuotaList(backupGigabytes Quota, backups Quota, gigabytes Quota, networks Quota, nics Quota, publicIps Quota, ram Quota, securityGroupRules Quota, securityGroups Quota, snapshots Quota, vcpu Quota, volumes Quota) *QuotaList { + this := QuotaList{} + this.BackupGigabytes = backupGigabytes + this.Backups = backups + this.Gigabytes = gigabytes + this.Networks = networks + this.Nics = nics + this.PublicIps = publicIps + this.Ram = ram + this.SecurityGroupRules = securityGroupRules + this.SecurityGroups = securityGroups + this.Snapshots = snapshots + this.Vcpu = vcpu + this.Volumes = volumes + return &this +} + +// NewQuotaListWithDefaults instantiates a new QuotaList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaListWithDefaults() *QuotaList { + this := QuotaList{} + return &this +} + +// GetBackupGigabytes returns the BackupGigabytes field value +func (o *QuotaList) GetBackupGigabytes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.BackupGigabytes +} + +// GetBackupGigabytesOk returns a tuple with the BackupGigabytes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetBackupGigabytesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.BackupGigabytes, true +} + +// SetBackupGigabytes sets field value +func (o *QuotaList) SetBackupGigabytes(v Quota) { + o.BackupGigabytes = v +} + +// GetBackups returns the Backups field value +func (o *QuotaList) GetBackups() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Backups +} + +// GetBackupsOk returns a tuple with the Backups field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetBackupsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Backups, true +} + +// SetBackups sets field value +func (o *QuotaList) SetBackups(v Quota) { + o.Backups = v +} + +// GetGigabytes returns the Gigabytes field value +func (o *QuotaList) GetGigabytes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Gigabytes +} + +// GetGigabytesOk returns a tuple with the Gigabytes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetGigabytesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Gigabytes, true +} + +// SetGigabytes sets field value +func (o *QuotaList) SetGigabytes(v Quota) { + o.Gigabytes = v +} + +// GetNetworks returns the Networks field value +func (o *QuotaList) GetNetworks() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetNetworksOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Networks, true +} + +// SetNetworks sets field value +func (o *QuotaList) SetNetworks(v Quota) { + o.Networks = v +} + +// GetNics returns the Nics field value +func (o *QuotaList) GetNics() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetNicsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Nics, true +} + +// SetNics sets field value +func (o *QuotaList) SetNics(v Quota) { + o.Nics = v +} + +// GetPublicIps returns the PublicIps field value +func (o *QuotaList) GetPublicIps() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.PublicIps +} + +// GetPublicIpsOk returns a tuple with the PublicIps field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetPublicIpsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.PublicIps, true +} + +// SetPublicIps sets field value +func (o *QuotaList) SetPublicIps(v Quota) { + o.PublicIps = v +} + +// GetRam returns the Ram field value +func (o *QuotaList) GetRam() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Ram +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetRamOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Ram, true +} + +// SetRam sets field value +func (o *QuotaList) SetRam(v Quota) { + o.Ram = v +} + +// GetSecurityGroupRules returns the SecurityGroupRules field value +func (o *QuotaList) GetSecurityGroupRules() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.SecurityGroupRules +} + +// GetSecurityGroupRulesOk returns a tuple with the SecurityGroupRules field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSecurityGroupRulesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.SecurityGroupRules, true +} + +// SetSecurityGroupRules sets field value +func (o *QuotaList) SetSecurityGroupRules(v Quota) { + o.SecurityGroupRules = v +} + +// GetSecurityGroups returns the SecurityGroups field value +func (o *QuotaList) GetSecurityGroups() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSecurityGroupsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.SecurityGroups, true +} + +// SetSecurityGroups sets field value +func (o *QuotaList) SetSecurityGroups(v Quota) { + o.SecurityGroups = v +} + +// GetSnapshots returns the Snapshots field value +func (o *QuotaList) GetSnapshots() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Snapshots +} + +// GetSnapshotsOk returns a tuple with the Snapshots field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSnapshotsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Snapshots, true +} + +// SetSnapshots sets field value +func (o *QuotaList) SetSnapshots(v Quota) { + o.Snapshots = v +} + +// GetVcpu returns the Vcpu field value +func (o *QuotaList) GetVcpu() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Vcpu +} + +// GetVcpuOk returns a tuple with the Vcpu field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetVcpuOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Vcpu, true +} + +// SetVcpu sets field value +func (o *QuotaList) SetVcpu(v Quota) { + o.Vcpu = v +} + +// GetVolumes returns the Volumes field value +func (o *QuotaList) GetVolumes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetVolumesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Volumes, true +} + +// SetVolumes sets field value +func (o *QuotaList) SetVolumes(v Quota) { + o.Volumes = v +} + +func (o QuotaList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuotaList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupGigabytes"] = o.BackupGigabytes + toSerialize["backups"] = o.Backups + toSerialize["gigabytes"] = o.Gigabytes + toSerialize["networks"] = o.Networks + toSerialize["nics"] = o.Nics + toSerialize["publicIps"] = o.PublicIps + toSerialize["ram"] = o.Ram + toSerialize["securityGroupRules"] = o.SecurityGroupRules + toSerialize["securityGroups"] = o.SecurityGroups + toSerialize["snapshots"] = o.Snapshots + toSerialize["vcpu"] = o.Vcpu + toSerialize["volumes"] = o.Volumes + return toSerialize, nil +} + +func (o *QuotaList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupGigabytes", + "backups", + "gigabytes", + "networks", + "nics", + "publicIps", + "ram", + "securityGroupRules", + "securityGroups", + "snapshots", + "vcpu", + "volumes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuotaList := _QuotaList{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuotaList) + + if err != nil { + return err + } + + *o = QuotaList(varQuotaList) + + return err +} + +type NullableQuotaList struct { + value *QuotaList + isSet bool +} + +func (v NullableQuotaList) Get() *QuotaList { + return v.value +} + +func (v *NullableQuotaList) Set(val *QuotaList) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaList) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaList(val *QuotaList) *NullableQuotaList { + return &NullableQuotaList{value: val, isSet: true} +} + +func (v NullableQuotaList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_quota_list_response.go b/services/iaas/v2api/model_quota_list_response.go new file mode 100644 index 000000000..8fd4e98a3 --- /dev/null +++ b/services/iaas/v2api/model_quota_list_response.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the QuotaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListResponse{} + +// QuotaListResponse Quotas list response. +type QuotaListResponse struct { + Quotas QuotaList `json:"quotas"` +} + +type _QuotaListResponse QuotaListResponse + +// NewQuotaListResponse instantiates a new QuotaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuotaListResponse(quotas QuotaList) *QuotaListResponse { + this := QuotaListResponse{} + this.Quotas = quotas + return &this +} + +// NewQuotaListResponseWithDefaults instantiates a new QuotaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaListResponseWithDefaults() *QuotaListResponse { + this := QuotaListResponse{} + return &this +} + +// GetQuotas returns the Quotas field value +func (o *QuotaListResponse) GetQuotas() QuotaList { + if o == nil { + var ret QuotaList + return ret + } + + return o.Quotas +} + +// GetQuotasOk returns a tuple with the Quotas field value +// and a boolean to check if the value has been set. +func (o *QuotaListResponse) GetQuotasOk() (*QuotaList, bool) { + if o == nil { + return nil, false + } + return &o.Quotas, true +} + +// SetQuotas sets field value +func (o *QuotaListResponse) SetQuotas(v QuotaList) { + o.Quotas = v +} + +func (o QuotaListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuotaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["quotas"] = o.Quotas + return toSerialize, nil +} + +func (o *QuotaListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "quotas", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuotaListResponse := _QuotaListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuotaListResponse) + + if err != nil { + return err + } + + *o = QuotaListResponse(varQuotaListResponse) + + return err +} + +type NullableQuotaListResponse struct { + value *QuotaListResponse + isSet bool +} + +func (v NullableQuotaListResponse) Get() *QuotaListResponse { + return v.value +} + +func (v *NullableQuotaListResponse) Set(val *QuotaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListResponse(val *QuotaListResponse) *NullableQuotaListResponse { + return &NullableQuotaListResponse{value: val, isSet: true} +} + +func (v NullableQuotaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_regional_area.go b/services/iaas/v2api/model_regional_area.go new file mode 100644 index 000000000..67b49d1bd --- /dev/null +++ b/services/iaas/v2api/model_regional_area.go @@ -0,0 +1,162 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the RegionalArea type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalArea{} + +// RegionalArea The basic properties of a regional network area. +type RegionalArea struct { + Ipv4 *RegionalAreaIPv4 `json:"ipv4,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status *string `json:"status,omitempty"` +} + +// NewRegionalArea instantiates a new RegionalArea object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalArea() *RegionalArea { + this := RegionalArea{} + return &this +} + +// NewRegionalAreaWithDefaults instantiates a new RegionalArea object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaWithDefaults() *RegionalArea { + this := RegionalArea{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *RegionalArea) GetIpv4() RegionalAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret RegionalAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalArea) GetIpv4Ok() (*RegionalAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *RegionalArea) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given RegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *RegionalArea) SetIpv4(v RegionalAreaIPv4) { + o.Ipv4 = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *RegionalArea) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalArea) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *RegionalArea) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *RegionalArea) SetStatus(v string) { + o.Status = &v +} + +func (o RegionalArea) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegionalArea) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableRegionalArea struct { + value *RegionalArea + isSet bool +} + +func (v NullableRegionalArea) Get() *RegionalArea { + return v.value +} + +func (v *NullableRegionalArea) Set(val *RegionalArea) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalArea) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalArea) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalArea(val *RegionalArea) *NullableRegionalArea { + return &NullableRegionalArea{value: val, isSet: true} +} + +func (v NullableRegionalArea) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalArea) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_regional_area_ipv4.go b/services/iaas/v2api/model_regional_area_ipv4.go new file mode 100644 index 000000000..a42e6354e --- /dev/null +++ b/services/iaas/v2api/model_regional_area_ipv4.go @@ -0,0 +1,316 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RegionalAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalAreaIPv4{} + +// RegionalAreaIPv4 The regional IPv4 config of a network area. +type RegionalAreaIPv4 struct { + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // The default prefix length for networks in the network area. + DefaultPrefixLen int64 `json:"defaultPrefixLen"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen int64 `json:"maxPrefixLen"` + // The minimal prefix length for networks in the network area. + MinPrefixLen int64 `json:"minPrefixLen"` + // A list of network ranges. + NetworkRanges []NetworkRange `json:"networkRanges"` + // IPv4 Classless Inter-Domain Routing (CIDR). + TransferNetwork string `json:"transferNetwork" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` +} + +type _RegionalAreaIPv4 RegionalAreaIPv4 + +// NewRegionalAreaIPv4 instantiates a new RegionalAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalAreaIPv4(defaultPrefixLen int64, maxPrefixLen int64, minPrefixLen int64, networkRanges []NetworkRange, transferNetwork string) *RegionalAreaIPv4 { + this := RegionalAreaIPv4{} + this.DefaultPrefixLen = defaultPrefixLen + this.MaxPrefixLen = maxPrefixLen + this.MinPrefixLen = minPrefixLen + this.NetworkRanges = networkRanges + this.TransferNetwork = transferNetwork + return &this +} + +// NewRegionalAreaIPv4WithDefaults instantiates a new RegionalAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaIPv4WithDefaults() *RegionalAreaIPv4 { + this := RegionalAreaIPv4{} + var defaultPrefixLen int64 = 25 + this.DefaultPrefixLen = defaultPrefixLen + var maxPrefixLen int64 = 29 + this.MaxPrefixLen = maxPrefixLen + var minPrefixLen int64 = 24 + this.MinPrefixLen = minPrefixLen + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *RegionalAreaIPv4) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *RegionalAreaIPv4) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *RegionalAreaIPv4) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value +func (o *RegionalAreaIPv4) GetDefaultPrefixLen() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DefaultPrefixLen +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DefaultPrefixLen, true +} + +// SetDefaultPrefixLen sets field value +func (o *RegionalAreaIPv4) SetDefaultPrefixLen(v int64) { + o.DefaultPrefixLen = v +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value +func (o *RegionalAreaIPv4) GetMaxPrefixLen() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MaxPrefixLen +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MaxPrefixLen, true +} + +// SetMaxPrefixLen sets field value +func (o *RegionalAreaIPv4) SetMaxPrefixLen(v int64) { + o.MaxPrefixLen = v +} + +// GetMinPrefixLen returns the MinPrefixLen field value +func (o *RegionalAreaIPv4) GetMinPrefixLen() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MinPrefixLen +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MinPrefixLen, true +} + +// SetMinPrefixLen sets field value +func (o *RegionalAreaIPv4) SetMinPrefixLen(v int64) { + o.MinPrefixLen = v +} + +// GetNetworkRanges returns the NetworkRanges field value +func (o *RegionalAreaIPv4) GetNetworkRanges() []NetworkRange { + if o == nil { + var ret []NetworkRange + return ret + } + + return o.NetworkRanges +} + +// GetNetworkRangesOk returns a tuple with the NetworkRanges field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetNetworkRangesOk() ([]NetworkRange, bool) { + if o == nil { + return nil, false + } + return o.NetworkRanges, true +} + +// SetNetworkRanges sets field value +func (o *RegionalAreaIPv4) SetNetworkRanges(v []NetworkRange) { + o.NetworkRanges = v +} + +// GetTransferNetwork returns the TransferNetwork field value +func (o *RegionalAreaIPv4) GetTransferNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.TransferNetwork +} + +// GetTransferNetworkOk returns a tuple with the TransferNetwork field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetTransferNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransferNetwork, true +} + +// SetTransferNetwork sets field value +func (o *RegionalAreaIPv4) SetTransferNetwork(v string) { + o.TransferNetwork = v +} + +func (o RegionalAreaIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegionalAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + toSerialize["maxPrefixLen"] = o.MaxPrefixLen + toSerialize["minPrefixLen"] = o.MinPrefixLen + toSerialize["networkRanges"] = o.NetworkRanges + toSerialize["transferNetwork"] = o.TransferNetwork + return toSerialize, nil +} + +func (o *RegionalAreaIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "defaultPrefixLen", + "maxPrefixLen", + "minPrefixLen", + "networkRanges", + "transferNetwork", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRegionalAreaIPv4 := _RegionalAreaIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRegionalAreaIPv4) + + if err != nil { + return err + } + + *o = RegionalAreaIPv4(varRegionalAreaIPv4) + + return err +} + +type NullableRegionalAreaIPv4 struct { + value *RegionalAreaIPv4 + isSet bool +} + +func (v NullableRegionalAreaIPv4) Get() *RegionalAreaIPv4 { + return v.value +} + +func (v *NullableRegionalAreaIPv4) Set(val *RegionalAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalAreaIPv4(val *RegionalAreaIPv4) *NullableRegionalAreaIPv4 { + return &NullableRegionalAreaIPv4{value: val, isSet: true} +} + +func (v NullableRegionalAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_regional_area_list_response.go b/services/iaas/v2api/model_regional_area_list_response.go new file mode 100644 index 000000000..60d4dbbce --- /dev/null +++ b/services/iaas/v2api/model_regional_area_list_response.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RegionalAreaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalAreaListResponse{} + +// RegionalAreaListResponse Regional area list response. +type RegionalAreaListResponse struct { + Regions map[string]RegionalArea `json:"regions"` +} + +type _RegionalAreaListResponse RegionalAreaListResponse + +// NewRegionalAreaListResponse instantiates a new RegionalAreaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalAreaListResponse(regions map[string]RegionalArea) *RegionalAreaListResponse { + this := RegionalAreaListResponse{} + this.Regions = regions + return &this +} + +// NewRegionalAreaListResponseWithDefaults instantiates a new RegionalAreaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaListResponseWithDefaults() *RegionalAreaListResponse { + this := RegionalAreaListResponse{} + return &this +} + +// GetRegions returns the Regions field value +func (o *RegionalAreaListResponse) GetRegions() map[string]RegionalArea { + if o == nil { + var ret map[string]RegionalArea + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaListResponse) GetRegionsOk() (*map[string]RegionalArea, bool) { + if o == nil { + return nil, false + } + return &o.Regions, true +} + +// SetRegions sets field value +func (o *RegionalAreaListResponse) SetRegions(v map[string]RegionalArea) { + o.Regions = v +} + +func (o RegionalAreaListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegionalAreaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["regions"] = o.Regions + return toSerialize, nil +} + +func (o *RegionalAreaListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "regions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRegionalAreaListResponse := _RegionalAreaListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRegionalAreaListResponse) + + if err != nil { + return err + } + + *o = RegionalAreaListResponse(varRegionalAreaListResponse) + + return err +} + +type NullableRegionalAreaListResponse struct { + value *RegionalAreaListResponse + isSet bool +} + +func (v NullableRegionalAreaListResponse) Get() *RegionalAreaListResponse { + return v.value +} + +func (v *NullableRegionalAreaListResponse) Set(val *RegionalAreaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalAreaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalAreaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalAreaListResponse(val *RegionalAreaListResponse) *NullableRegionalAreaListResponse { + return &NullableRegionalAreaListResponse{value: val, isSet: true} +} + +func (v NullableRegionalAreaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalAreaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_request.go b/services/iaas/v2api/model_request.go new file mode 100644 index 000000000..bd1015804 --- /dev/null +++ b/services/iaas/v2api/model_request.go @@ -0,0 +1,309 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Request{} + +// Request Object that represents a request. +type Request struct { + Details *string `json:"details,omitempty"` + // Object that represents a resource action. Possible values: `CREATE`, `DELETE`, `UPDATE`. + RequestAction string `json:"requestAction"` + // Identifier (ID) representing a single API request. + RequestId string `json:"requestId" validate:"regexp=^req-[0-9a-f]{32}$"` + // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. + RequestType string `json:"requestType"` + Resources []RequestResource `json:"resources"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` +} + +type _Request Request + +// NewRequest instantiates a new Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequest(requestAction string, requestId string, requestType string, resources []RequestResource, status string) *Request { + this := Request{} + this.RequestAction = requestAction + this.RequestId = requestId + this.RequestType = requestType + this.Resources = resources + this.Status = status + return &this +} + +// NewRequestWithDefaults instantiates a new Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestWithDefaults() *Request { + this := Request{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Request) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *Request) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *Request) SetDetails(v string) { + o.Details = &v +} + +// GetRequestAction returns the RequestAction field value +func (o *Request) GetRequestAction() string { + if o == nil { + var ret string + return ret + } + + return o.RequestAction +} + +// GetRequestActionOk returns a tuple with the RequestAction field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestActionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestAction, true +} + +// SetRequestAction sets field value +func (o *Request) SetRequestAction(v string) { + o.RequestAction = v +} + +// GetRequestId returns the RequestId field value +func (o *Request) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *Request) SetRequestId(v string) { + o.RequestId = v +} + +// GetRequestType returns the RequestType field value +func (o *Request) GetRequestType() string { + if o == nil { + var ret string + return ret + } + + return o.RequestType +} + +// GetRequestTypeOk returns a tuple with the RequestType field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestType, true +} + +// SetRequestType sets field value +func (o *Request) SetRequestType(v string) { + o.RequestType = v +} + +// GetResources returns the Resources field value +func (o *Request) GetResources() []RequestResource { + if o == nil { + var ret []RequestResource + return ret + } + + return o.Resources +} + +// GetResourcesOk returns a tuple with the Resources field value +// and a boolean to check if the value has been set. +func (o *Request) GetResourcesOk() ([]RequestResource, bool) { + if o == nil { + return nil, false + } + return o.Resources, true +} + +// SetResources sets field value +func (o *Request) SetResources(v []RequestResource) { + o.Resources = v +} + +// GetStatus returns the Status field value +func (o *Request) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Request) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Request) SetStatus(v string) { + o.Status = v +} + +func (o Request) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["requestAction"] = o.RequestAction + toSerialize["requestId"] = o.RequestId + toSerialize["requestType"] = o.RequestType + toSerialize["resources"] = o.Resources + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *Request) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "requestAction", + "requestId", + "requestType", + "resources", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequest := _Request{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequest) + + if err != nil { + return err + } + + *o = Request(varRequest) + + return err +} + +type NullableRequest struct { + value *Request + isSet bool +} + +func (v NullableRequest) Get() *Request { + return v.value +} + +func (v *NullableRequest) Set(val *Request) { + v.value = val + v.isSet = true +} + +func (v NullableRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequest(val *Request) *NullableRequest { + return &NullableRequest{value: val, isSet: true} +} + +func (v NullableRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_request_resource.go b/services/iaas/v2api/model_request_resource.go new file mode 100644 index 000000000..ed9a8a199 --- /dev/null +++ b/services/iaas/v2api/model_request_resource.go @@ -0,0 +1,216 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RequestResource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestResource{} + +// RequestResource Object that represents a resource as part of a request. +type RequestResource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` + // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. + Type string `json:"type"` +} + +type _RequestResource RequestResource + +// NewRequestResource instantiates a new RequestResource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestResource(id string, status string, types string) *RequestResource { + this := RequestResource{} + this.Id = id + this.Status = status + this.Type = types + return &this +} + +// NewRequestResourceWithDefaults instantiates a new RequestResource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestResourceWithDefaults() *RequestResource { + this := RequestResource{} + return &this +} + +// GetId returns the Id field value +func (o *RequestResource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RequestResource) SetId(v string) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *RequestResource) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *RequestResource) SetStatus(v string) { + o.Status = v +} + +// GetType returns the Type field value +func (o *RequestResource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *RequestResource) SetType(v string) { + o.Type = v +} + +func (o RequestResource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestResource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *RequestResource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestResource := _RequestResource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestResource) + + if err != nil { + return err + } + + *o = RequestResource(varRequestResource) + + return err +} + +type NullableRequestResource struct { + value *RequestResource + isSet bool +} + +func (v NullableRequestResource) Get() *RequestResource { + return v.value +} + +func (v *NullableRequestResource) Set(val *RequestResource) { + v.value = val + v.isSet = true +} + +func (v NullableRequestResource) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestResource(val *RequestResource) *NullableRequestResource { + return &NullableRequestResource{value: val, isSet: true} +} + +func (v NullableRequestResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_rescue_server_payload.go b/services/iaas/v2api/model_rescue_server_payload.go new file mode 100644 index 000000000..fb3129c7b --- /dev/null +++ b/services/iaas/v2api/model_rescue_server_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RescueServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RescueServerPayload{} + +// RescueServerPayload struct for RescueServerPayload +type RescueServerPayload struct { + // Universally Unique Identifier (UUID). + Image string `json:"image" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _RescueServerPayload RescueServerPayload + +// NewRescueServerPayload instantiates a new RescueServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRescueServerPayload(image string) *RescueServerPayload { + this := RescueServerPayload{} + this.Image = image + return &this +} + +// NewRescueServerPayloadWithDefaults instantiates a new RescueServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRescueServerPayloadWithDefaults() *RescueServerPayload { + this := RescueServerPayload{} + return &this +} + +// GetImage returns the Image field value +func (o *RescueServerPayload) GetImage() string { + if o == nil { + var ret string + return ret + } + + return o.Image +} + +// GetImageOk returns a tuple with the Image field value +// and a boolean to check if the value has been set. +func (o *RescueServerPayload) GetImageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Image, true +} + +// SetImage sets field value +func (o *RescueServerPayload) SetImage(v string) { + o.Image = v +} + +func (o RescueServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RescueServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["image"] = o.Image + return toSerialize, nil +} + +func (o *RescueServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "image", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRescueServerPayload := _RescueServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRescueServerPayload) + + if err != nil { + return err + } + + *o = RescueServerPayload(varRescueServerPayload) + + return err +} + +type NullableRescueServerPayload struct { + value *RescueServerPayload + isSet bool +} + +func (v NullableRescueServerPayload) Get() *RescueServerPayload { + return v.value +} + +func (v *NullableRescueServerPayload) Set(val *RescueServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableRescueServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableRescueServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRescueServerPayload(val *RescueServerPayload) *NullableRescueServerPayload { + return &NullableRescueServerPayload{value: val, isSet: true} +} + +func (v NullableRescueServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRescueServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_resize_server_payload.go b/services/iaas/v2api/model_resize_server_payload.go new file mode 100644 index 000000000..05a937915 --- /dev/null +++ b/services/iaas/v2api/model_resize_server_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ResizeServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResizeServerPayload{} + +// ResizeServerPayload struct for ResizeServerPayload +type ResizeServerPayload struct { + // The name for a General Object. Matches Names and also UUIDs. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +type _ResizeServerPayload ResizeServerPayload + +// NewResizeServerPayload instantiates a new ResizeServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResizeServerPayload(machineType string) *ResizeServerPayload { + this := ResizeServerPayload{} + this.MachineType = machineType + return &this +} + +// NewResizeServerPayloadWithDefaults instantiates a new ResizeServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResizeServerPayloadWithDefaults() *ResizeServerPayload { + this := ResizeServerPayload{} + return &this +} + +// GetMachineType returns the MachineType field value +func (o *ResizeServerPayload) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *ResizeServerPayload) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *ResizeServerPayload) SetMachineType(v string) { + o.MachineType = v +} + +func (o ResizeServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResizeServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["machineType"] = o.MachineType + return toSerialize, nil +} + +func (o *ResizeServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResizeServerPayload := _ResizeServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResizeServerPayload) + + if err != nil { + return err + } + + *o = ResizeServerPayload(varResizeServerPayload) + + return err +} + +type NullableResizeServerPayload struct { + value *ResizeServerPayload + isSet bool +} + +func (v NullableResizeServerPayload) Get() *ResizeServerPayload { + return v.value +} + +func (v *NullableResizeServerPayload) Set(val *ResizeServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableResizeServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableResizeServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResizeServerPayload(val *ResizeServerPayload) *NullableResizeServerPayload { + return &NullableResizeServerPayload{value: val, isSet: true} +} + +func (v NullableResizeServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResizeServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_resize_volume_payload.go b/services/iaas/v2api/model_resize_volume_payload.go new file mode 100644 index 000000000..d9d31783a --- /dev/null +++ b/services/iaas/v2api/model_resize_volume_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ResizeVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResizeVolumePayload{} + +// ResizeVolumePayload struct for ResizeVolumePayload +type ResizeVolumePayload struct { + // Size in Gigabyte. + Size int64 `json:"size"` +} + +type _ResizeVolumePayload ResizeVolumePayload + +// NewResizeVolumePayload instantiates a new ResizeVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResizeVolumePayload(size int64) *ResizeVolumePayload { + this := ResizeVolumePayload{} + this.Size = size + return &this +} + +// NewResizeVolumePayloadWithDefaults instantiates a new ResizeVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResizeVolumePayloadWithDefaults() *ResizeVolumePayload { + this := ResizeVolumePayload{} + return &this +} + +// GetSize returns the Size field value +func (o *ResizeVolumePayload) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *ResizeVolumePayload) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *ResizeVolumePayload) SetSize(v int64) { + o.Size = v +} + +func (o ResizeVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResizeVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["size"] = o.Size + return toSerialize, nil +} + +func (o *ResizeVolumePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "size", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResizeVolumePayload := _ResizeVolumePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResizeVolumePayload) + + if err != nil { + return err + } + + *o = ResizeVolumePayload(varResizeVolumePayload) + + return err +} + +type NullableResizeVolumePayload struct { + value *ResizeVolumePayload + isSet bool +} + +func (v NullableResizeVolumePayload) Get() *ResizeVolumePayload { + return v.value +} + +func (v *NullableResizeVolumePayload) Set(val *ResizeVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableResizeVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableResizeVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResizeVolumePayload(val *ResizeVolumePayload) *NullableResizeVolumePayload { + return &NullableResizeVolumePayload{value: val, isSet: true} +} + +func (v NullableResizeVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResizeVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_route.go b/services/iaas/v2api/model_route.go new file mode 100644 index 000000000..b2c862467 --- /dev/null +++ b/services/iaas/v2api/model_route.go @@ -0,0 +1,334 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Route type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Route{} + +// Route Object represents a network route. +type Route struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + Destination RouteDestination `json:"destination"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Nexthop RouteNexthop `json:"nexthop"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Route Route + +// NewRoute instantiates a new Route object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoute(destination RouteDestination, nexthop RouteNexthop) *Route { + this := Route{} + this.Destination = destination + this.Nexthop = nexthop + return &this +} + +// NewRouteWithDefaults instantiates a new Route object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteWithDefaults() *Route { + this := Route{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Route) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Route) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Route) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDestination returns the Destination field value +func (o *Route) GetDestination() RouteDestination { + if o == nil { + var ret RouteDestination + return ret + } + + return o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value +// and a boolean to check if the value has been set. +func (o *Route) GetDestinationOk() (*RouteDestination, bool) { + if o == nil { + return nil, false + } + return &o.Destination, true +} + +// SetDestination sets field value +func (o *Route) SetDestination(v RouteDestination) { + o.Destination = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Route) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Route) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Route) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Route) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Route) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Route) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNexthop returns the Nexthop field value +func (o *Route) GetNexthop() RouteNexthop { + if o == nil { + var ret RouteNexthop + return ret + } + + return o.Nexthop +} + +// GetNexthopOk returns a tuple with the Nexthop field value +// and a boolean to check if the value has been set. +func (o *Route) GetNexthopOk() (*RouteNexthop, bool) { + if o == nil { + return nil, false + } + return &o.Nexthop, true +} + +// SetNexthop sets field value +func (o *Route) SetNexthop(v RouteNexthop) { + o.Nexthop = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Route) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Route) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Route) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Route) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Route) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["destination"] = o.Destination + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["nexthop"] = o.Nexthop + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Route) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "destination", + "nexthop", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoute := _Route{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoute) + + if err != nil { + return err + } + + *o = Route(varRoute) + + return err +} + +type NullableRoute struct { + value *Route + isSet bool +} + +func (v NullableRoute) Get() *Route { + return v.value +} + +func (v *NullableRoute) Set(val *Route) { + v.value = val + v.isSet = true +} + +func (v NullableRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoute(val *Route) *NullableRoute { + return &NullableRoute{value: val, isSet: true} +} + +func (v NullableRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_route_destination.go b/services/iaas/v2api/model_route_destination.go new file mode 100644 index 000000000..78bd9ee92 --- /dev/null +++ b/services/iaas/v2api/model_route_destination.go @@ -0,0 +1,154 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// RouteDestination - struct for RouteDestination +type RouteDestination struct { + DestinationCIDRv4 *DestinationCIDRv4 + DestinationCIDRv6 *DestinationCIDRv6 +} + +// DestinationCIDRv4AsRouteDestination is a convenience function that returns DestinationCIDRv4 wrapped in RouteDestination +func DestinationCIDRv4AsRouteDestination(v *DestinationCIDRv4) RouteDestination { + return RouteDestination{ + DestinationCIDRv4: v, + } +} + +// DestinationCIDRv6AsRouteDestination is a convenience function that returns DestinationCIDRv6 wrapped in RouteDestination +func DestinationCIDRv6AsRouteDestination(v *DestinationCIDRv6) RouteDestination { + return RouteDestination{ + DestinationCIDRv6: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RouteDestination) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'cidrv4' + if jsonDict["type"] == "cidrv4" { + // try to unmarshal JSON data into DestinationCIDRv4 + err = json.Unmarshal(data, &dst.DestinationCIDRv4) + if err == nil { + return nil // data stored in dst.DestinationCIDRv4, return on the first match + } else { + dst.DestinationCIDRv4 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'cidrv6' + if jsonDict["type"] == "cidrv6" { + // try to unmarshal JSON data into DestinationCIDRv6 + err = json.Unmarshal(data, &dst.DestinationCIDRv6) + if err == nil { + return nil // data stored in dst.DestinationCIDRv6, return on the first match + } else { + dst.DestinationCIDRv6 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv6: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RouteDestination) MarshalJSON() ([]byte, error) { + if src.DestinationCIDRv4 != nil { + return json.Marshal(&src.DestinationCIDRv4) + } + + if src.DestinationCIDRv6 != nil { + return json.Marshal(&src.DestinationCIDRv6) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RouteDestination) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.DestinationCIDRv4 != nil { + return obj.DestinationCIDRv4 + } + + if obj.DestinationCIDRv6 != nil { + return obj.DestinationCIDRv6 + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj RouteDestination) GetActualInstanceValue() interface{} { + if obj.DestinationCIDRv4 != nil { + return *obj.DestinationCIDRv4 + } + + if obj.DestinationCIDRv6 != nil { + return *obj.DestinationCIDRv6 + } + + // all schemas are nil + return nil +} + +type NullableRouteDestination struct { + value *RouteDestination + isSet bool +} + +func (v NullableRouteDestination) Get() *RouteDestination { + return v.value +} + +func (v *NullableRouteDestination) Set(val *RouteDestination) { + v.value = val + v.isSet = true +} + +func (v NullableRouteDestination) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteDestination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteDestination(val *RouteDestination) *NullableRouteDestination { + return &NullableRouteDestination{value: val, isSet: true} +} + +func (v NullableRouteDestination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteDestination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_route_list_response.go b/services/iaas/v2api/model_route_list_response.go new file mode 100644 index 000000000..5c9cf0e66 --- /dev/null +++ b/services/iaas/v2api/model_route_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RouteListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RouteListResponse{} + +// RouteListResponse Route list response. +type RouteListResponse struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _RouteListResponse RouteListResponse + +// NewRouteListResponse instantiates a new RouteListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRouteListResponse(items []Route) *RouteListResponse { + this := RouteListResponse{} + this.Items = items + return &this +} + +// NewRouteListResponseWithDefaults instantiates a new RouteListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteListResponseWithDefaults() *RouteListResponse { + this := RouteListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RouteListResponse) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RouteListResponse) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RouteListResponse) SetItems(v []Route) { + o.Items = v +} + +func (o RouteListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RouteListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RouteListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRouteListResponse := _RouteListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRouteListResponse) + + if err != nil { + return err + } + + *o = RouteListResponse(varRouteListResponse) + + return err +} + +type NullableRouteListResponse struct { + value *RouteListResponse + isSet bool +} + +func (v NullableRouteListResponse) Get() *RouteListResponse { + return v.value +} + +func (v *NullableRouteListResponse) Set(val *RouteListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRouteListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteListResponse(val *RouteListResponse) *NullableRouteListResponse { + return &NullableRouteListResponse{value: val, isSet: true} +} + +func (v NullableRouteListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_route_nexthop.go b/services/iaas/v2api/model_route_nexthop.go new file mode 100644 index 000000000..024ed3622 --- /dev/null +++ b/services/iaas/v2api/model_route_nexthop.go @@ -0,0 +1,218 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// RouteNexthop - struct for RouteNexthop +type RouteNexthop struct { + NexthopBlackhole *NexthopBlackhole + NexthopIPv4 *NexthopIPv4 + NexthopIPv6 *NexthopIPv6 + NexthopInternet *NexthopInternet +} + +// NexthopBlackholeAsRouteNexthop is a convenience function that returns NexthopBlackhole wrapped in RouteNexthop +func NexthopBlackholeAsRouteNexthop(v *NexthopBlackhole) RouteNexthop { + return RouteNexthop{ + NexthopBlackhole: v, + } +} + +// NexthopIPv4AsRouteNexthop is a convenience function that returns NexthopIPv4 wrapped in RouteNexthop +func NexthopIPv4AsRouteNexthop(v *NexthopIPv4) RouteNexthop { + return RouteNexthop{ + NexthopIPv4: v, + } +} + +// NexthopIPv6AsRouteNexthop is a convenience function that returns NexthopIPv6 wrapped in RouteNexthop +func NexthopIPv6AsRouteNexthop(v *NexthopIPv6) RouteNexthop { + return RouteNexthop{ + NexthopIPv6: v, + } +} + +// NexthopInternetAsRouteNexthop is a convenience function that returns NexthopInternet wrapped in RouteNexthop +func NexthopInternetAsRouteNexthop(v *NexthopInternet) RouteNexthop { + return RouteNexthop{ + NexthopInternet: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RouteNexthop) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'blackhole' + if jsonDict["type"] == "blackhole" { + // try to unmarshal JSON data into NexthopBlackhole + err = json.Unmarshal(data, &dst.NexthopBlackhole) + if err == nil { + return nil // data stored in dst.NexthopBlackhole, return on the first match + } else { + dst.NexthopBlackhole = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopBlackhole: %s", err.Error()) + } + } + + // check if the discriminator value is 'internet' + if jsonDict["type"] == "internet" { + // try to unmarshal JSON data into NexthopInternet + err = json.Unmarshal(data, &dst.NexthopInternet) + if err == nil { + return nil // data stored in dst.NexthopInternet, return on the first match + } else { + dst.NexthopInternet = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopInternet: %s", err.Error()) + } + } + + // check if the discriminator value is 'ipv4' + if jsonDict["type"] == "ipv4" { + // try to unmarshal JSON data into NexthopIPv4 + err = json.Unmarshal(data, &dst.NexthopIPv4) + if err == nil { + return nil // data stored in dst.NexthopIPv4, return on the first match + } else { + dst.NexthopIPv4 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'ipv6' + if jsonDict["type"] == "ipv6" { + // try to unmarshal JSON data into NexthopIPv6 + err = json.Unmarshal(data, &dst.NexthopIPv6) + if err == nil { + return nil // data stored in dst.NexthopIPv6, return on the first match + } else { + dst.NexthopIPv6 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv6: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RouteNexthop) MarshalJSON() ([]byte, error) { + if src.NexthopBlackhole != nil { + return json.Marshal(&src.NexthopBlackhole) + } + + if src.NexthopIPv4 != nil { + return json.Marshal(&src.NexthopIPv4) + } + + if src.NexthopIPv6 != nil { + return json.Marshal(&src.NexthopIPv6) + } + + if src.NexthopInternet != nil { + return json.Marshal(&src.NexthopInternet) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RouteNexthop) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.NexthopBlackhole != nil { + return obj.NexthopBlackhole + } + + if obj.NexthopIPv4 != nil { + return obj.NexthopIPv4 + } + + if obj.NexthopIPv6 != nil { + return obj.NexthopIPv6 + } + + if obj.NexthopInternet != nil { + return obj.NexthopInternet + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj RouteNexthop) GetActualInstanceValue() interface{} { + if obj.NexthopBlackhole != nil { + return *obj.NexthopBlackhole + } + + if obj.NexthopIPv4 != nil { + return *obj.NexthopIPv4 + } + + if obj.NexthopIPv6 != nil { + return *obj.NexthopIPv6 + } + + if obj.NexthopInternet != nil { + return *obj.NexthopInternet + } + + // all schemas are nil + return nil +} + +type NullableRouteNexthop struct { + value *RouteNexthop + isSet bool +} + +func (v NullableRouteNexthop) Get() *RouteNexthop { + return v.value +} + +func (v *NullableRouteNexthop) Set(val *RouteNexthop) { + v.value = val + v.isSet = true +} + +func (v NullableRouteNexthop) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteNexthop) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteNexthop(val *RouteNexthop) *NullableRouteNexthop { + return &NullableRouteNexthop{value: val, isSet: true} +} + +func (v NullableRouteNexthop) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteNexthop) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_routing_table.go b/services/iaas/v2api/model_routing_table.go new file mode 100644 index 000000000..45d5186a6 --- /dev/null +++ b/services/iaas/v2api/model_routing_table.go @@ -0,0 +1,463 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the RoutingTable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoutingTable{} + +// RoutingTable An object representing a routing table. +type RoutingTable struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. + Default *bool `json:"default,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _RoutingTable RoutingTable + +// NewRoutingTable instantiates a new RoutingTable object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoutingTable(name string) *RoutingTable { + this := RoutingTable{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + this.Name = name + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// NewRoutingTableWithDefaults instantiates a new RoutingTable object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoutingTableWithDefaults() *RoutingTable { + this := RoutingTable{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *RoutingTable) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *RoutingTable) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *RoutingTable) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *RoutingTable) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *RoutingTable) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *RoutingTable) SetDefault(v bool) { + o.Default = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RoutingTable) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RoutingTable) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RoutingTable) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *RoutingTable) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *RoutingTable) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *RoutingTable) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RoutingTable) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *RoutingTable) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RoutingTable) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *RoutingTable) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *RoutingTable) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *RoutingTable) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *RoutingTable) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RoutingTable) SetName(v string) { + o.Name = v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *RoutingTable) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *RoutingTable) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *RoutingTable) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *RoutingTable) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *RoutingTable) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *RoutingTable) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o RoutingTable) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoutingTable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *RoutingTable) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoutingTable := _RoutingTable{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoutingTable) + + if err != nil { + return err + } + + *o = RoutingTable(varRoutingTable) + + return err +} + +type NullableRoutingTable struct { + value *RoutingTable + isSet bool +} + +func (v NullableRoutingTable) Get() *RoutingTable { + return v.value +} + +func (v *NullableRoutingTable) Set(val *RoutingTable) { + v.value = val + v.isSet = true +} + +func (v NullableRoutingTable) IsSet() bool { + return v.isSet +} + +func (v *NullableRoutingTable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoutingTable(val *RoutingTable) *NullableRoutingTable { + return &NullableRoutingTable{value: val, isSet: true} +} + +func (v NullableRoutingTable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoutingTable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_routing_table_list_response.go b/services/iaas/v2api/model_routing_table_list_response.go new file mode 100644 index 000000000..cb1fa23b4 --- /dev/null +++ b/services/iaas/v2api/model_routing_table_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RoutingTableListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoutingTableListResponse{} + +// RoutingTableListResponse Routing table response. +type RoutingTableListResponse struct { + // A list of routing tables. + Items []RoutingTable `json:"items"` +} + +type _RoutingTableListResponse RoutingTableListResponse + +// NewRoutingTableListResponse instantiates a new RoutingTableListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoutingTableListResponse(items []RoutingTable) *RoutingTableListResponse { + this := RoutingTableListResponse{} + this.Items = items + return &this +} + +// NewRoutingTableListResponseWithDefaults instantiates a new RoutingTableListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoutingTableListResponseWithDefaults() *RoutingTableListResponse { + this := RoutingTableListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RoutingTableListResponse) GetItems() []RoutingTable { + if o == nil { + var ret []RoutingTable + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RoutingTableListResponse) GetItemsOk() ([]RoutingTable, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RoutingTableListResponse) SetItems(v []RoutingTable) { + o.Items = v +} + +func (o RoutingTableListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoutingTableListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RoutingTableListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoutingTableListResponse := _RoutingTableListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoutingTableListResponse) + + if err != nil { + return err + } + + *o = RoutingTableListResponse(varRoutingTableListResponse) + + return err +} + +type NullableRoutingTableListResponse struct { + value *RoutingTableListResponse + isSet bool +} + +func (v NullableRoutingTableListResponse) Get() *RoutingTableListResponse { + return v.value +} + +func (v *NullableRoutingTableListResponse) Set(val *RoutingTableListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRoutingTableListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRoutingTableListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoutingTableListResponse(val *RoutingTableListResponse) *NullableRoutingTableListResponse { + return &NullableRoutingTableListResponse{value: val, isSet: true} +} + +func (v NullableRoutingTableListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoutingTableListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_security_group.go b/services/iaas/v2api/model_security_group.go new file mode 100644 index 000000000..538a1c950 --- /dev/null +++ b/services/iaas/v2api/model_security_group.go @@ -0,0 +1,422 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the SecurityGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroup{} + +// SecurityGroup Object that represents a security group. +type SecurityGroup struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A list containing security group rule objects. + Rules []SecurityGroupRule `json:"rules,omitempty"` + // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. + Stateful *bool `json:"stateful,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _SecurityGroup SecurityGroup + +// NewSecurityGroup instantiates a new SecurityGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroup(name string) *SecurityGroup { + this := SecurityGroup{} + this.Name = name + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// NewSecurityGroupWithDefaults instantiates a new SecurityGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupWithDefaults() *SecurityGroup { + this := SecurityGroup{} + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SecurityGroup) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SecurityGroup) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SecurityGroup) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SecurityGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SecurityGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SecurityGroup) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SecurityGroup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SecurityGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SecurityGroup) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *SecurityGroup) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *SecurityGroup) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *SecurityGroup) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *SecurityGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SecurityGroup) SetName(v string) { + o.Name = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *SecurityGroup) GetRules() []SecurityGroupRule { + if o == nil || IsNil(o.Rules) { + var ret []SecurityGroupRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetRulesOk() ([]SecurityGroupRule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *SecurityGroup) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. +func (o *SecurityGroup) SetRules(v []SecurityGroupRule) { + o.Rules = v +} + +// GetStateful returns the Stateful field value if set, zero value otherwise. +func (o *SecurityGroup) GetStateful() bool { + if o == nil || IsNil(o.Stateful) { + var ret bool + return ret + } + return *o.Stateful +} + +// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetStatefulOk() (*bool, bool) { + if o == nil || IsNil(o.Stateful) { + return nil, false + } + return o.Stateful, true +} + +// HasStateful returns a boolean if a field has been set. +func (o *SecurityGroup) HasStateful() bool { + if o != nil && !IsNil(o.Stateful) { + return true + } + + return false +} + +// SetStateful gets a reference to the given bool and assigns it to the Stateful field. +func (o *SecurityGroup) SetStateful(v bool) { + o.Stateful = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *SecurityGroup) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *SecurityGroup) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *SecurityGroup) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o SecurityGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + if !IsNil(o.Stateful) { + toSerialize["stateful"] = o.Stateful + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *SecurityGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroup := _SecurityGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroup) + + if err != nil { + return err + } + + *o = SecurityGroup(varSecurityGroup) + + return err +} + +type NullableSecurityGroup struct { + value *SecurityGroup + isSet bool +} + +func (v NullableSecurityGroup) Get() *SecurityGroup { + return v.value +} + +func (v *NullableSecurityGroup) Set(val *SecurityGroup) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroup(val *SecurityGroup) *NullableSecurityGroup { + return &NullableSecurityGroup{value: val, isSet: true} +} + +func (v NullableSecurityGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_security_group_list_response.go b/services/iaas/v2api/model_security_group_list_response.go new file mode 100644 index 000000000..a48884176 --- /dev/null +++ b/services/iaas/v2api/model_security_group_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SecurityGroupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupListResponse{} + +// SecurityGroupListResponse Security group list response. +type SecurityGroupListResponse struct { + // A list containing security group objects. + Items []SecurityGroup `json:"items"` +} + +type _SecurityGroupListResponse SecurityGroupListResponse + +// NewSecurityGroupListResponse instantiates a new SecurityGroupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupListResponse(items []SecurityGroup) *SecurityGroupListResponse { + this := SecurityGroupListResponse{} + this.Items = items + return &this +} + +// NewSecurityGroupListResponseWithDefaults instantiates a new SecurityGroupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupListResponseWithDefaults() *SecurityGroupListResponse { + this := SecurityGroupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SecurityGroupListResponse) GetItems() []SecurityGroup { + if o == nil { + var ret []SecurityGroup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupListResponse) GetItemsOk() ([]SecurityGroup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SecurityGroupListResponse) SetItems(v []SecurityGroup) { + o.Items = v +} + +func (o SecurityGroupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SecurityGroupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupListResponse := _SecurityGroupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupListResponse) + + if err != nil { + return err + } + + *o = SecurityGroupListResponse(varSecurityGroupListResponse) + + return err +} + +type NullableSecurityGroupListResponse struct { + value *SecurityGroupListResponse + isSet bool +} + +func (v NullableSecurityGroupListResponse) Get() *SecurityGroupListResponse { + return v.value +} + +func (v *NullableSecurityGroupListResponse) Set(val *SecurityGroupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupListResponse(val *SecurityGroupListResponse) *NullableSecurityGroupListResponse { + return &NullableSecurityGroupListResponse{value: val, isSet: true} +} + +func (v NullableSecurityGroupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_security_group_rule.go b/services/iaas/v2api/model_security_group_rule.go new file mode 100644 index 000000000..252e95b3d --- /dev/null +++ b/services/iaas/v2api/model_security_group_rule.go @@ -0,0 +1,567 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the SecurityGroupRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRule{} + +// SecurityGroupRule Object that represents a security group rule. +type SecurityGroupRule struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Protocol *Protocol `json:"protocol,omitempty"` +} + +type _SecurityGroupRule SecurityGroupRule + +// NewSecurityGroupRule instantiates a new SecurityGroupRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRule(direction string) *SecurityGroupRule { + this := SecurityGroupRule{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewSecurityGroupRuleWithDefaults instantiates a new SecurityGroupRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleWithDefaults() *SecurityGroupRule { + this := SecurityGroupRule{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SecurityGroupRule) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SecurityGroupRule) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *SecurityGroupRule) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *SecurityGroupRule) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *SecurityGroupRule) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *SecurityGroupRule) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SecurityGroupRule) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *SecurityGroupRule) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *SecurityGroupRule) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *SecurityGroupRule) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *SecurityGroupRule) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *SecurityGroupRule) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetProtocol() Protocol { + if o == nil || IsNil(o.Protocol) { + var ret Protocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetProtocolOk() (*Protocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +func (o *SecurityGroupRule) SetProtocol(v Protocol) { + o.Protocol = &v +} + +func (o SecurityGroupRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +func (o *SecurityGroupRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupRule := _SecurityGroupRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupRule) + + if err != nil { + return err + } + + *o = SecurityGroupRule(varSecurityGroupRule) + + return err +} + +type NullableSecurityGroupRule struct { + value *SecurityGroupRule + isSet bool +} + +func (v NullableSecurityGroupRule) Get() *SecurityGroupRule { + return v.value +} + +func (v *NullableSecurityGroupRule) Set(val *SecurityGroupRule) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRule) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRule(val *SecurityGroupRule) *NullableSecurityGroupRule { + return &NullableSecurityGroupRule{value: val, isSet: true} +} + +func (v NullableSecurityGroupRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_security_group_rule_list_response.go b/services/iaas/v2api/model_security_group_rule_list_response.go new file mode 100644 index 000000000..a311ac119 --- /dev/null +++ b/services/iaas/v2api/model_security_group_rule_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SecurityGroupRuleListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRuleListResponse{} + +// SecurityGroupRuleListResponse Security group rule list response. +type SecurityGroupRuleListResponse struct { + // A list containing security group rule objects. + Items []SecurityGroupRule `json:"items"` +} + +type _SecurityGroupRuleListResponse SecurityGroupRuleListResponse + +// NewSecurityGroupRuleListResponse instantiates a new SecurityGroupRuleListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRuleListResponse(items []SecurityGroupRule) *SecurityGroupRuleListResponse { + this := SecurityGroupRuleListResponse{} + this.Items = items + return &this +} + +// NewSecurityGroupRuleListResponseWithDefaults instantiates a new SecurityGroupRuleListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleListResponseWithDefaults() *SecurityGroupRuleListResponse { + this := SecurityGroupRuleListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SecurityGroupRuleListResponse) GetItems() []SecurityGroupRule { + if o == nil { + var ret []SecurityGroupRule + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupRuleListResponse) GetItemsOk() ([]SecurityGroupRule, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SecurityGroupRuleListResponse) SetItems(v []SecurityGroupRule) { + o.Items = v +} + +func (o SecurityGroupRuleListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRuleListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SecurityGroupRuleListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupRuleListResponse := _SecurityGroupRuleListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupRuleListResponse) + + if err != nil { + return err + } + + *o = SecurityGroupRuleListResponse(varSecurityGroupRuleListResponse) + + return err +} + +type NullableSecurityGroupRuleListResponse struct { + value *SecurityGroupRuleListResponse + isSet bool +} + +func (v NullableSecurityGroupRuleListResponse) Get() *SecurityGroupRuleListResponse { + return v.value +} + +func (v *NullableSecurityGroupRuleListResponse) Set(val *SecurityGroupRuleListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRuleListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRuleListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRuleListResponse(val *SecurityGroupRuleListResponse) *NullableSecurityGroupRuleListResponse { + return &NullableSecurityGroupRuleListResponse{value: val, isSet: true} +} + +func (v NullableSecurityGroupRuleListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRuleListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_security_group_rule_protocol.go b/services/iaas/v2api/model_security_group_rule_protocol.go new file mode 100644 index 000000000..92cc87407 --- /dev/null +++ b/services/iaas/v2api/model_security_group_rule_protocol.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the SecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRuleProtocol{} + +// SecurityGroupRuleProtocol The internet protocol which the rule matches. +type SecurityGroupRuleProtocol struct { + Protocol *Protocol `json:"protocol,omitempty"` +} + +// NewSecurityGroupRuleProtocol instantiates a new SecurityGroupRuleProtocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRuleProtocol() *SecurityGroupRuleProtocol { + this := SecurityGroupRuleProtocol{} + return &this +} + +// NewSecurityGroupRuleProtocolWithDefaults instantiates a new SecurityGroupRuleProtocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleProtocolWithDefaults() *SecurityGroupRuleProtocol { + this := SecurityGroupRuleProtocol{} + return &this +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SecurityGroupRuleProtocol) GetProtocol() Protocol { + if o == nil || IsNil(o.Protocol) { + var ret Protocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRuleProtocol) GetProtocolOk() (*Protocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SecurityGroupRuleProtocol) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +func (o *SecurityGroupRuleProtocol) SetProtocol(v Protocol) { + o.Protocol = &v +} + +func (o SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +type NullableSecurityGroupRuleProtocol struct { + value *SecurityGroupRuleProtocol + isSet bool +} + +func (v NullableSecurityGroupRuleProtocol) Get() *SecurityGroupRuleProtocol { + return v.value +} + +func (v *NullableSecurityGroupRuleProtocol) Set(val *SecurityGroupRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRuleProtocol(val *SecurityGroupRuleProtocol) *NullableSecurityGroupRuleProtocol { + return &NullableSecurityGroupRuleProtocol{value: val, isSet: true} +} + +func (v NullableSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_server.go b/services/iaas/v2api/model_server.go new file mode 100644 index 000000000..29f194ab9 --- /dev/null +++ b/services/iaas/v2api/model_server.go @@ -0,0 +1,998 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Server type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Server{} + +// Server Representation of a single server object. +type Server struct { + // The affinity group the server is assigned to. + AffinityGroup *string `json:"affinityGroup,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Agent *ServerAgent `json:"agent,omitempty"` + // This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + BootVolume *BootVolume `json:"bootVolume,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // An error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The SSH keypair used during the server creation. + KeypairName *string `json:"keypairName,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Date-time when resource was launched. + LaunchedAt *time.Time `json:"launchedAt,omitempty"` + // Name of the machine type the server shall belong to. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + MaintenanceWindow *ServerMaintenance `json:"maintenanceWindow,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name string `json:"name" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` + Networking *ServerNetworking `json:"networking,omitempty"` + // The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested. + Nics []ServerNetwork `json:"nics,omitempty"` + // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. + PowerStatus *string `json:"powerStatus,omitempty"` + // The initial security groups for the server creation. + SecurityGroups []string `json:"securityGroups,omitempty"` + // A list of service account mails. Only shown when detailed information is requested. + ServiceAccountMails []string `json:"serviceAccountMails,omitempty"` + // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. + UserData *string `json:"userData,omitempty"` + // The list of volumes attached to the server. + Volumes []string `json:"volumes,omitempty"` +} + +type _Server Server + +// NewServer instantiates a new Server object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServer(machineType string, name string) *Server { + this := Server{} + this.MachineType = machineType + this.Name = name + return &this +} + +// NewServerWithDefaults instantiates a new Server object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerWithDefaults() *Server { + this := Server{} + return &this +} + +// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +func (o *Server) GetAffinityGroup() string { + if o == nil || IsNil(o.AffinityGroup) { + var ret string + return ret + } + return *o.AffinityGroup +} + +// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAffinityGroupOk() (*string, bool) { + if o == nil || IsNil(o.AffinityGroup) { + return nil, false + } + return o.AffinityGroup, true +} + +// HasAffinityGroup returns a boolean if a field has been set. +func (o *Server) HasAffinityGroup() bool { + if o != nil && !IsNil(o.AffinityGroup) { + return true + } + + return false +} + +// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +func (o *Server) SetAffinityGroup(v string) { + o.AffinityGroup = &v +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *Server) GetAgent() ServerAgent { + if o == nil || IsNil(o.Agent) { + var ret ServerAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAgentOk() (*ServerAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *Server) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ServerAgent and assigns it to the Agent field. +func (o *Server) SetAgent(v ServerAgent) { + o.Agent = &v +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *Server) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *Server) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *Server) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetBootVolume returns the BootVolume field value if set, zero value otherwise. +func (o *Server) GetBootVolume() BootVolume { + if o == nil || IsNil(o.BootVolume) { + var ret BootVolume + return ret + } + return *o.BootVolume +} + +// GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetBootVolumeOk() (*BootVolume, bool) { + if o == nil || IsNil(o.BootVolume) { + return nil, false + } + return o.BootVolume, true +} + +// HasBootVolume returns a boolean if a field has been set. +func (o *Server) HasBootVolume() bool { + if o != nil && !IsNil(o.BootVolume) { + return true + } + + return false +} + +// SetBootVolume gets a reference to the given BootVolume and assigns it to the BootVolume field. +func (o *Server) SetBootVolume(v BootVolume) { + o.BootVolume = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Server) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Server) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Server) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *Server) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *Server) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *Server) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Server) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Server) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Server) SetId(v string) { + o.Id = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *Server) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *Server) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *Server) SetImageId(v string) { + o.ImageId = &v +} + +// GetKeypairName returns the KeypairName field value if set, zero value otherwise. +func (o *Server) GetKeypairName() string { + if o == nil || IsNil(o.KeypairName) { + var ret string + return ret + } + return *o.KeypairName +} + +// GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetKeypairNameOk() (*string, bool) { + if o == nil || IsNil(o.KeypairName) { + return nil, false + } + return o.KeypairName, true +} + +// HasKeypairName returns a boolean if a field has been set. +func (o *Server) HasKeypairName() bool { + if o != nil && !IsNil(o.KeypairName) { + return true + } + + return false +} + +// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. +func (o *Server) SetKeypairName(v string) { + o.KeypairName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Server) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Server) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Server) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. +func (o *Server) GetLaunchedAt() time.Time { + if o == nil || IsNil(o.LaunchedAt) { + var ret time.Time + return ret + } + return *o.LaunchedAt +} + +// GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetLaunchedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LaunchedAt) { + return nil, false + } + return o.LaunchedAt, true +} + +// HasLaunchedAt returns a boolean if a field has been set. +func (o *Server) HasLaunchedAt() bool { + if o != nil && !IsNil(o.LaunchedAt) { + return true + } + + return false +} + +// SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. +func (o *Server) SetLaunchedAt(v time.Time) { + o.LaunchedAt = &v +} + +// GetMachineType returns the MachineType field value +func (o *Server) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *Server) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *Server) SetMachineType(v string) { + o.MachineType = v +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *Server) GetMaintenanceWindow() ServerMaintenance { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret ServerMaintenance + return ret + } + return *o.MaintenanceWindow +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { + if o == nil || IsNil(o.MaintenanceWindow) { + return nil, false + } + return o.MaintenanceWindow, true +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *Server) HasMaintenanceWindow() bool { + if o != nil && !IsNil(o.MaintenanceWindow) { + return true + } + + return false +} + +// SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. +func (o *Server) SetMaintenanceWindow(v ServerMaintenance) { + o.MaintenanceWindow = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *Server) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *Server) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *Server) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value +func (o *Server) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Server) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Server) SetName(v string) { + o.Name = v +} + +// GetNetworking returns the Networking field value if set, zero value otherwise. +func (o *Server) GetNetworking() ServerNetworking { + if o == nil || IsNil(o.Networking) { + var ret ServerNetworking + return ret + } + return *o.Networking +} + +// GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetNetworkingOk() (*ServerNetworking, bool) { + if o == nil || IsNil(o.Networking) { + return nil, false + } + return o.Networking, true +} + +// HasNetworking returns a boolean if a field has been set. +func (o *Server) HasNetworking() bool { + if o != nil && !IsNil(o.Networking) { + return true + } + + return false +} + +// SetNetworking gets a reference to the given ServerNetworking and assigns it to the Networking field. +func (o *Server) SetNetworking(v ServerNetworking) { + o.Networking = &v +} + +// GetNics returns the Nics field value if set, zero value otherwise. +func (o *Server) GetNics() []ServerNetwork { + if o == nil || IsNil(o.Nics) { + var ret []ServerNetwork + return ret + } + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetNicsOk() ([]ServerNetwork, bool) { + if o == nil || IsNil(o.Nics) { + return nil, false + } + return o.Nics, true +} + +// HasNics returns a boolean if a field has been set. +func (o *Server) HasNics() bool { + if o != nil && !IsNil(o.Nics) { + return true + } + + return false +} + +// SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. +func (o *Server) SetNics(v []ServerNetwork) { + o.Nics = v +} + +// GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. +func (o *Server) GetPowerStatus() string { + if o == nil || IsNil(o.PowerStatus) { + var ret string + return ret + } + return *o.PowerStatus +} + +// GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetPowerStatusOk() (*string, bool) { + if o == nil || IsNil(o.PowerStatus) { + return nil, false + } + return o.PowerStatus, true +} + +// HasPowerStatus returns a boolean if a field has been set. +func (o *Server) HasPowerStatus() bool { + if o != nil && !IsNil(o.PowerStatus) { + return true + } + + return false +} + +// SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. +func (o *Server) SetPowerStatus(v string) { + o.PowerStatus = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *Server) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *Server) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *Server) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. +func (o *Server) GetServiceAccountMails() []string { + if o == nil || IsNil(o.ServiceAccountMails) { + var ret []string + return ret + } + return o.ServiceAccountMails +} + +// GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetServiceAccountMailsOk() ([]string, bool) { + if o == nil || IsNil(o.ServiceAccountMails) { + return nil, false + } + return o.ServiceAccountMails, true +} + +// HasServiceAccountMails returns a boolean if a field has been set. +func (o *Server) HasServiceAccountMails() bool { + if o != nil && !IsNil(o.ServiceAccountMails) { + return true + } + + return false +} + +// SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. +func (o *Server) SetServiceAccountMails(v []string) { + o.ServiceAccountMails = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Server) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Server) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Server) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Server) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Server) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Server) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *Server) GetUserData() string { + if o == nil || IsNil(o.UserData) { + var ret string + return ret + } + return *o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetUserDataOk() (*string, bool) { + if o == nil || IsNil(o.UserData) { + return nil, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *Server) HasUserData() bool { + if o != nil && !IsNil(o.UserData) { + return true + } + + return false +} + +// SetUserData gets a reference to the given string and assigns it to the UserData field. +func (o *Server) SetUserData(v string) { + o.UserData = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *Server) GetVolumes() []string { + if o == nil || IsNil(o.Volumes) { + var ret []string + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetVolumesOk() ([]string, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *Server) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +func (o *Server) SetVolumes(v []string) { + o.Volumes = v +} + +func (o Server) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Server) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AffinityGroup) { + toSerialize["affinityGroup"] = o.AffinityGroup + } + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.BootVolume) { + toSerialize["bootVolume"] = o.BootVolume + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.KeypairName) { + toSerialize["keypairName"] = o.KeypairName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.LaunchedAt) { + toSerialize["launchedAt"] = o.LaunchedAt + } + toSerialize["machineType"] = o.MachineType + if !IsNil(o.MaintenanceWindow) { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + toSerialize["name"] = o.Name + if !IsNil(o.Networking) { + toSerialize["networking"] = o.Networking + } + if !IsNil(o.Nics) { + toSerialize["nics"] = o.Nics + } + if !IsNil(o.PowerStatus) { + toSerialize["powerStatus"] = o.PowerStatus + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.ServiceAccountMails) { + toSerialize["serviceAccountMails"] = o.ServiceAccountMails + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.UserData) { + toSerialize["userData"] = o.UserData + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + return toSerialize, nil +} + +func (o *Server) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServer := _Server{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServer) + + if err != nil { + return err + } + + *o = Server(varServer) + + return err +} + +type NullableServer struct { + value *Server + isSet bool +} + +func (v NullableServer) Get() *Server { + return v.value +} + +func (v *NullableServer) Set(val *Server) { + v.value = val + v.isSet = true +} + +func (v NullableServer) IsSet() bool { + return v.isSet +} + +func (v *NullableServer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServer(val *Server) *NullableServer { + return &NullableServer{value: val, isSet: true} +} + +func (v NullableServer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_server_agent.go b/services/iaas/v2api/model_server_agent.go new file mode 100644 index 000000000..625a99c9d --- /dev/null +++ b/services/iaas/v2api/model_server_agent.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the ServerAgent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerAgent{} + +// ServerAgent STACKIT server agent options for a server. +type ServerAgent struct { + // Configure the STACKIT server agent provisioning during the first boot of the server. Only works when booting from an images that supports the STACKIT server agent. When `false` the agent IS NOT installed. When `true` the agent IS installed. When its not set the result depend on the used image and its default provisioning setting. + Provisioned *bool `json:"provisioned,omitempty"` +} + +// NewServerAgent instantiates a new ServerAgent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerAgent() *ServerAgent { + this := ServerAgent{} + return &this +} + +// NewServerAgentWithDefaults instantiates a new ServerAgent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerAgentWithDefaults() *ServerAgent { + this := ServerAgent{} + return &this +} + +// GetProvisioned returns the Provisioned field value if set, zero value otherwise. +func (o *ServerAgent) GetProvisioned() bool { + if o == nil || IsNil(o.Provisioned) { + var ret bool + return ret + } + return *o.Provisioned +} + +// GetProvisionedOk returns a tuple with the Provisioned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerAgent) GetProvisionedOk() (*bool, bool) { + if o == nil || IsNil(o.Provisioned) { + return nil, false + } + return o.Provisioned, true +} + +// HasProvisioned returns a boolean if a field has been set. +func (o *ServerAgent) HasProvisioned() bool { + if o != nil && !IsNil(o.Provisioned) { + return true + } + + return false +} + +// SetProvisioned gets a reference to the given bool and assigns it to the Provisioned field. +func (o *ServerAgent) SetProvisioned(v bool) { + o.Provisioned = &v +} + +func (o ServerAgent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerAgent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Provisioned) { + toSerialize["provisioned"] = o.Provisioned + } + return toSerialize, nil +} + +type NullableServerAgent struct { + value *ServerAgent + isSet bool +} + +func (v NullableServerAgent) Get() *ServerAgent { + return v.value +} + +func (v *NullableServerAgent) Set(val *ServerAgent) { + v.value = val + v.isSet = true +} + +func (v NullableServerAgent) IsSet() bool { + return v.isSet +} + +func (v *NullableServerAgent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerAgent(val *ServerAgent) *NullableServerAgent { + return &NullableServerAgent{value: val, isSet: true} +} + +func (v NullableServerAgent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerAgent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_server_console_url.go b/services/iaas/v2api/model_server_console_url.go new file mode 100644 index 000000000..203ad56ae --- /dev/null +++ b/services/iaas/v2api/model_server_console_url.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerConsoleUrl type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerConsoleUrl{} + +// ServerConsoleUrl Object that represents a server console URL. +type ServerConsoleUrl struct { + Url string `json:"url"` +} + +type _ServerConsoleUrl ServerConsoleUrl + +// NewServerConsoleUrl instantiates a new ServerConsoleUrl object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerConsoleUrl(url string) *ServerConsoleUrl { + this := ServerConsoleUrl{} + this.Url = url + return &this +} + +// NewServerConsoleUrlWithDefaults instantiates a new ServerConsoleUrl object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerConsoleUrlWithDefaults() *ServerConsoleUrl { + this := ServerConsoleUrl{} + return &this +} + +// GetUrl returns the Url field value +func (o *ServerConsoleUrl) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ServerConsoleUrl) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ServerConsoleUrl) SetUrl(v string) { + o.Url = v +} + +func (o ServerConsoleUrl) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerConsoleUrl) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *ServerConsoleUrl) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerConsoleUrl := _ServerConsoleUrl{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerConsoleUrl) + + if err != nil { + return err + } + + *o = ServerConsoleUrl(varServerConsoleUrl) + + return err +} + +type NullableServerConsoleUrl struct { + value *ServerConsoleUrl + isSet bool +} + +func (v NullableServerConsoleUrl) Get() *ServerConsoleUrl { + return v.value +} + +func (v *NullableServerConsoleUrl) Set(val *ServerConsoleUrl) { + v.value = val + v.isSet = true +} + +func (v NullableServerConsoleUrl) IsSet() bool { + return v.isSet +} + +func (v *NullableServerConsoleUrl) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerConsoleUrl(val *ServerConsoleUrl) *NullableServerConsoleUrl { + return &NullableServerConsoleUrl{value: val, isSet: true} +} + +func (v NullableServerConsoleUrl) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerConsoleUrl) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_server_list_response.go b/services/iaas/v2api/model_server_list_response.go new file mode 100644 index 000000000..ac03b8871 --- /dev/null +++ b/services/iaas/v2api/model_server_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerListResponse{} + +// ServerListResponse Response object for server list request. +type ServerListResponse struct { + // A list of servers. + Items []Server `json:"items"` +} + +type _ServerListResponse ServerListResponse + +// NewServerListResponse instantiates a new ServerListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerListResponse(items []Server) *ServerListResponse { + this := ServerListResponse{} + this.Items = items + return &this +} + +// NewServerListResponseWithDefaults instantiates a new ServerListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerListResponseWithDefaults() *ServerListResponse { + this := ServerListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ServerListResponse) GetItems() []Server { + if o == nil { + var ret []Server + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ServerListResponse) GetItemsOk() ([]Server, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ServerListResponse) SetItems(v []Server) { + o.Items = v +} + +func (o ServerListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ServerListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerListResponse := _ServerListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerListResponse) + + if err != nil { + return err + } + + *o = ServerListResponse(varServerListResponse) + + return err +} + +type NullableServerListResponse struct { + value *ServerListResponse + isSet bool +} + +func (v NullableServerListResponse) Get() *ServerListResponse { + return v.value +} + +func (v *NullableServerListResponse) Set(val *ServerListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableServerListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableServerListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerListResponse(val *ServerListResponse) *NullableServerListResponse { + return &NullableServerListResponse{value: val, isSet: true} +} + +func (v NullableServerListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_server_maintenance.go b/services/iaas/v2api/model_server_maintenance.go new file mode 100644 index 000000000..336dfa0fa --- /dev/null +++ b/services/iaas/v2api/model_server_maintenance.go @@ -0,0 +1,253 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the ServerMaintenance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerMaintenance{} + +// ServerMaintenance Object that represents the information about the next planned server maintenance window. +type ServerMaintenance struct { + Details *string `json:"details,omitempty"` + // End of the maintenance window. + EndsAt time.Time `json:"endsAt"` + // Start of the maintenance window. + StartsAt time.Time `json:"startsAt"` + // Possible values: `PLANNED`, `ONGOING`. + Status string `json:"status"` +} + +type _ServerMaintenance ServerMaintenance + +// NewServerMaintenance instantiates a new ServerMaintenance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerMaintenance(endsAt time.Time, startsAt time.Time, status string) *ServerMaintenance { + this := ServerMaintenance{} + this.EndsAt = endsAt + this.StartsAt = startsAt + this.Status = status + return &this +} + +// NewServerMaintenanceWithDefaults instantiates a new ServerMaintenance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerMaintenanceWithDefaults() *ServerMaintenance { + this := ServerMaintenance{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *ServerMaintenance) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *ServerMaintenance) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *ServerMaintenance) SetDetails(v string) { + o.Details = &v +} + +// GetEndsAt returns the EndsAt field value +func (o *ServerMaintenance) GetEndsAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.EndsAt +} + +// GetEndsAtOk returns a tuple with the EndsAt field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetEndsAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EndsAt, true +} + +// SetEndsAt sets field value +func (o *ServerMaintenance) SetEndsAt(v time.Time) { + o.EndsAt = v +} + +// GetStartsAt returns the StartsAt field value +func (o *ServerMaintenance) GetStartsAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartsAt +} + +// GetStartsAtOk returns a tuple with the StartsAt field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetStartsAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartsAt, true +} + +// SetStartsAt sets field value +func (o *ServerMaintenance) SetStartsAt(v time.Time) { + o.StartsAt = v +} + +// GetStatus returns the Status field value +func (o *ServerMaintenance) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ServerMaintenance) SetStatus(v string) { + o.Status = v +} + +func (o ServerMaintenance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerMaintenance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["endsAt"] = o.EndsAt + toSerialize["startsAt"] = o.StartsAt + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *ServerMaintenance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "endsAt", + "startsAt", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerMaintenance := _ServerMaintenance{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerMaintenance) + + if err != nil { + return err + } + + *o = ServerMaintenance(varServerMaintenance) + + return err +} + +type NullableServerMaintenance struct { + value *ServerMaintenance + isSet bool +} + +func (v NullableServerMaintenance) Get() *ServerMaintenance { + return v.value +} + +func (v *NullableServerMaintenance) Set(val *ServerMaintenance) { + v.value = val + v.isSet = true +} + +func (v NullableServerMaintenance) IsSet() bool { + return v.isSet +} + +func (v *NullableServerMaintenance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerMaintenance(val *ServerMaintenance) *NullableServerMaintenance { + return &NullableServerMaintenance{value: val, isSet: true} +} + +func (v NullableServerMaintenance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerMaintenance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_server_network.go b/services/iaas/v2api/model_server_network.go new file mode 100644 index 000000000..31fc76b46 --- /dev/null +++ b/services/iaas/v2api/model_server_network.go @@ -0,0 +1,459 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerNetwork{} + +// ServerNetwork Describes the object that matches servers to its networks. +type ServerNetwork struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // Object that represents an MAC address. + Mac string `json:"mac" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // Universally Unique Identifier (UUID). + NetworkId string `json:"networkId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The name for a General Object. Matches Names and also UUIDs. + NetworkName string `json:"networkName" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NicId string `json:"nicId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this server network interface. + NicSecurity bool `json:"nicSecurity"` + // Object that represents an IP address. + PublicIp *string `json:"publicIp,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` +} + +type _ServerNetwork ServerNetwork + +// NewServerNetwork instantiates a new ServerNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerNetwork(mac string, networkId string, networkName string, nicId string, nicSecurity bool) *ServerNetwork { + this := ServerNetwork{} + this.Mac = mac + this.NetworkId = networkId + this.NetworkName = networkName + this.NicId = nicId + this.NicSecurity = nicSecurity + return &this +} + +// NewServerNetworkWithDefaults instantiates a new ServerNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerNetworkWithDefaults() *ServerNetwork { + this := ServerNetwork{} + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *ServerNetwork) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *ServerNetwork) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *ServerNetwork) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *ServerNetwork) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *ServerNetwork) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *ServerNetwork) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *ServerNetwork) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *ServerNetwork) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *ServerNetwork) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetMac returns the Mac field value +func (o *ServerNetwork) GetMac() string { + if o == nil { + var ret string + return ret + } + + return o.Mac +} + +// GetMacOk returns a tuple with the Mac field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetMacOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Mac, true +} + +// SetMac sets field value +func (o *ServerNetwork) SetMac(v string) { + o.Mac = v +} + +// GetNetworkId returns the NetworkId field value +func (o *ServerNetwork) GetNetworkId() string { + if o == nil { + var ret string + return ret + } + + return o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNetworkIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NetworkId, true +} + +// SetNetworkId sets field value +func (o *ServerNetwork) SetNetworkId(v string) { + o.NetworkId = v +} + +// GetNetworkName returns the NetworkName field value +func (o *ServerNetwork) GetNetworkName() string { + if o == nil { + var ret string + return ret + } + + return o.NetworkName +} + +// GetNetworkNameOk returns a tuple with the NetworkName field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNetworkNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NetworkName, true +} + +// SetNetworkName sets field value +func (o *ServerNetwork) SetNetworkName(v string) { + o.NetworkName = v +} + +// GetNicId returns the NicId field value +func (o *ServerNetwork) GetNicId() string { + if o == nil { + var ret string + return ret + } + + return o.NicId +} + +// GetNicIdOk returns a tuple with the NicId field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNicIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NicId, true +} + +// SetNicId sets field value +func (o *ServerNetwork) SetNicId(v string) { + o.NicId = v +} + +// GetNicSecurity returns the NicSecurity field value +func (o *ServerNetwork) GetNicSecurity() bool { + if o == nil { + var ret bool + return ret + } + + return o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNicSecurityOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.NicSecurity, true +} + +// SetNicSecurity sets field value +func (o *ServerNetwork) SetNicSecurity(v bool) { + o.NicSecurity = v +} + +// GetPublicIp returns the PublicIp field value if set, zero value otherwise. +func (o *ServerNetwork) GetPublicIp() string { + if o == nil || IsNil(o.PublicIp) { + var ret string + return ret + } + return *o.PublicIp +} + +// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetPublicIpOk() (*string, bool) { + if o == nil || IsNil(o.PublicIp) { + return nil, false + } + return o.PublicIp, true +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *ServerNetwork) HasPublicIp() bool { + if o != nil && !IsNil(o.PublicIp) { + return true + } + + return false +} + +// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +func (o *ServerNetwork) SetPublicIp(v string) { + o.PublicIp = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *ServerNetwork) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *ServerNetwork) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *ServerNetwork) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +func (o ServerNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + toSerialize["mac"] = o.Mac + toSerialize["networkId"] = o.NetworkId + toSerialize["networkName"] = o.NetworkName + toSerialize["nicId"] = o.NicId + toSerialize["nicSecurity"] = o.NicSecurity + if !IsNil(o.PublicIp) { + toSerialize["publicIp"] = o.PublicIp + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + return toSerialize, nil +} + +func (o *ServerNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "mac", + "networkId", + "networkName", + "nicId", + "nicSecurity", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerNetwork := _ServerNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerNetwork) + + if err != nil { + return err + } + + *o = ServerNetwork(varServerNetwork) + + return err +} + +type NullableServerNetwork struct { + value *ServerNetwork + isSet bool +} + +func (v NullableServerNetwork) Get() *ServerNetwork { + return v.value +} + +func (v *NullableServerNetwork) Set(val *ServerNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableServerNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableServerNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerNetwork(val *ServerNetwork) *NullableServerNetwork { + return &NullableServerNetwork{value: val, isSet: true} +} + +func (v NullableServerNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_server_networking.go b/services/iaas/v2api/model_server_networking.go new file mode 100644 index 000000000..3b6a39839 --- /dev/null +++ b/services/iaas/v2api/model_server_networking.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// ServerNetworking - The initial networking setup for the server creation. A network, a nic or nothing can be given. +type ServerNetworking struct { + CreateServerNetworking *CreateServerNetworking + CreateServerNetworkingWithNics *CreateServerNetworkingWithNics +} + +// CreateServerNetworkingAsServerNetworking is a convenience function that returns CreateServerNetworking wrapped in ServerNetworking +func CreateServerNetworkingAsServerNetworking(v *CreateServerNetworking) ServerNetworking { + return ServerNetworking{ + CreateServerNetworking: v, + } +} + +// CreateServerNetworkingWithNicsAsServerNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in ServerNetworking +func CreateServerNetworkingWithNicsAsServerNetworking(v *CreateServerNetworkingWithNics) ServerNetworking { + return ServerNetworking{ + CreateServerNetworkingWithNics: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ServerNetworking) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateServerNetworking + err = json.Unmarshal(data, &dst.CreateServerNetworking) + if err == nil { + jsonCreateServerNetworking, _ := json.Marshal(dst.CreateServerNetworking) + if string(jsonCreateServerNetworking) == "{}" { // empty struct + dst.CreateServerNetworking = nil + } else { + match++ + } + } else { + dst.CreateServerNetworking = nil + } + + // try to unmarshal data into CreateServerNetworkingWithNics + err = json.Unmarshal(data, &dst.CreateServerNetworkingWithNics) + if err == nil { + jsonCreateServerNetworkingWithNics, _ := json.Marshal(dst.CreateServerNetworkingWithNics) + if string(jsonCreateServerNetworkingWithNics) == "{}" { // empty struct + dst.CreateServerNetworkingWithNics = nil + } else { + match++ + } + } else { + dst.CreateServerNetworkingWithNics = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateServerNetworking = nil + dst.CreateServerNetworkingWithNics = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ServerNetworking)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ServerNetworking)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ServerNetworking) MarshalJSON() ([]byte, error) { + if src.CreateServerNetworking != nil { + return json.Marshal(&src.CreateServerNetworking) + } + + if src.CreateServerNetworkingWithNics != nil { + return json.Marshal(&src.CreateServerNetworkingWithNics) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ServerNetworking) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateServerNetworking != nil { + return obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ServerNetworking) GetActualInstanceValue() interface{} { + if obj.CreateServerNetworking != nil { + return *obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return *obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +type NullableServerNetworking struct { + value *ServerNetworking + isSet bool +} + +func (v NullableServerNetworking) Get() *ServerNetworking { + return v.value +} + +func (v *NullableServerNetworking) Set(val *ServerNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableServerNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableServerNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerNetworking(val *ServerNetworking) *NullableServerNetworking { + return &NullableServerNetworking{value: val, isSet: true} +} + +func (v NullableServerNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_service_account_mail_list_response.go b/services/iaas/v2api/model_service_account_mail_list_response.go new file mode 100644 index 000000000..1cd89c31e --- /dev/null +++ b/services/iaas/v2api/model_service_account_mail_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServiceAccountMailListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceAccountMailListResponse{} + +// ServiceAccountMailListResponse Service account mail list response. +type ServiceAccountMailListResponse struct { + // A list of service account mails. + Items []string `json:"items"` +} + +type _ServiceAccountMailListResponse ServiceAccountMailListResponse + +// NewServiceAccountMailListResponse instantiates a new ServiceAccountMailListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceAccountMailListResponse(items []string) *ServiceAccountMailListResponse { + this := ServiceAccountMailListResponse{} + this.Items = items + return &this +} + +// NewServiceAccountMailListResponseWithDefaults instantiates a new ServiceAccountMailListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceAccountMailListResponseWithDefaults() *ServiceAccountMailListResponse { + this := ServiceAccountMailListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ServiceAccountMailListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ServiceAccountMailListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ServiceAccountMailListResponse) SetItems(v []string) { + o.Items = v +} + +func (o ServiceAccountMailListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceAccountMailListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ServiceAccountMailListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceAccountMailListResponse := _ServiceAccountMailListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServiceAccountMailListResponse) + + if err != nil { + return err + } + + *o = ServiceAccountMailListResponse(varServiceAccountMailListResponse) + + return err +} + +type NullableServiceAccountMailListResponse struct { + value *ServiceAccountMailListResponse + isSet bool +} + +func (v NullableServiceAccountMailListResponse) Get() *ServiceAccountMailListResponse { + return v.value +} + +func (v *NullableServiceAccountMailListResponse) Set(val *ServiceAccountMailListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableServiceAccountMailListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceAccountMailListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceAccountMailListResponse(val *ServiceAccountMailListResponse) *NullableServiceAccountMailListResponse { + return &NullableServiceAccountMailListResponse{value: val, isSet: true} +} + +func (v NullableServiceAccountMailListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceAccountMailListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_set_image_share_payload.go b/services/iaas/v2api/model_set_image_share_payload.go new file mode 100644 index 000000000..8ae22ae1f --- /dev/null +++ b/services/iaas/v2api/model_set_image_share_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the SetImageSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetImageSharePayload{} + +// SetImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type SetImageSharePayload struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewSetImageSharePayload instantiates a new SetImageSharePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetImageSharePayload() *SetImageSharePayload { + this := SetImageSharePayload{} + return &this +} + +// NewSetImageSharePayloadWithDefaults instantiates a new SetImageSharePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetImageSharePayloadWithDefaults() *SetImageSharePayload { + this := SetImageSharePayload{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *SetImageSharePayload) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetImageSharePayload) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *SetImageSharePayload) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *SetImageSharePayload) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *SetImageSharePayload) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetImageSharePayload) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *SetImageSharePayload) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *SetImageSharePayload) SetProjects(v []string) { + o.Projects = v +} + +func (o SetImageSharePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetImageSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableSetImageSharePayload struct { + value *SetImageSharePayload + isSet bool +} + +func (v NullableSetImageSharePayload) Get() *SetImageSharePayload { + return v.value +} + +func (v *NullableSetImageSharePayload) Set(val *SetImageSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableSetImageSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableSetImageSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetImageSharePayload(val *SetImageSharePayload) *NullableSetImageSharePayload { + return &NullableSetImageSharePayload{value: val, isSet: true} +} + +func (v NullableSetImageSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetImageSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_snapshot.go b/services/iaas/v2api/model_snapshot.go new file mode 100644 index 000000000..e5ea075aa --- /dev/null +++ b/services/iaas/v2api/model_snapshot.go @@ -0,0 +1,418 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Snapshot type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Snapshot{} + +// Snapshot Object that represents a snapshot. +type Snapshot struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId string `json:"volumeId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _Snapshot Snapshot + +// NewSnapshot instantiates a new Snapshot object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshot(volumeId string) *Snapshot { + this := Snapshot{} + this.VolumeId = volumeId + return &this +} + +// NewSnapshotWithDefaults instantiates a new Snapshot object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotWithDefaults() *Snapshot { + this := Snapshot{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Snapshot) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Snapshot) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Snapshot) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Snapshot) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Snapshot) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Snapshot) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Snapshot) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Snapshot) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Snapshot) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Snapshot) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Snapshot) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Snapshot) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Snapshot) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Snapshot) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Snapshot) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Snapshot) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Snapshot) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Snapshot) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Snapshot) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Snapshot) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Snapshot) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value +func (o *Snapshot) GetVolumeId() string { + if o == nil { + var ret string + return ret + } + + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value +// and a boolean to check if the value has been set. +func (o *Snapshot) GetVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VolumeId, true +} + +// SetVolumeId sets field value +func (o *Snapshot) SetVolumeId(v string) { + o.VolumeId = v +} + +func (o Snapshot) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Snapshot) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + toSerialize["volumeId"] = o.VolumeId + return toSerialize, nil +} + +func (o *Snapshot) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "volumeId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSnapshot := _Snapshot{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSnapshot) + + if err != nil { + return err + } + + *o = Snapshot(varSnapshot) + + return err +} + +type NullableSnapshot struct { + value *Snapshot + isSet bool +} + +func (v NullableSnapshot) Get() *Snapshot { + return v.value +} + +func (v *NullableSnapshot) Set(val *Snapshot) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshot) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshot(val *Snapshot) *NullableSnapshot { + return &NullableSnapshot{value: val, isSet: true} +} + +func (v NullableSnapshot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_snapshot_list_response.go b/services/iaas/v2api/model_snapshot_list_response.go new file mode 100644 index 000000000..31b188dfc --- /dev/null +++ b/services/iaas/v2api/model_snapshot_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SnapshotListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotListResponse{} + +// SnapshotListResponse Snapshot list response. +type SnapshotListResponse struct { + // A list containing snapshot objects. + Items []Snapshot `json:"items"` +} + +type _SnapshotListResponse SnapshotListResponse + +// NewSnapshotListResponse instantiates a new SnapshotListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotListResponse(items []Snapshot) *SnapshotListResponse { + this := SnapshotListResponse{} + this.Items = items + return &this +} + +// NewSnapshotListResponseWithDefaults instantiates a new SnapshotListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotListResponseWithDefaults() *SnapshotListResponse { + this := SnapshotListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SnapshotListResponse) GetItems() []Snapshot { + if o == nil { + var ret []Snapshot + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SnapshotListResponse) GetItemsOk() ([]Snapshot, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SnapshotListResponse) SetItems(v []Snapshot) { + o.Items = v +} + +func (o SnapshotListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SnapshotListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SnapshotListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSnapshotListResponse := _SnapshotListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSnapshotListResponse) + + if err != nil { + return err + } + + *o = SnapshotListResponse(varSnapshotListResponse) + + return err +} + +type NullableSnapshotListResponse struct { + value *SnapshotListResponse + isSet bool +} + +func (v NullableSnapshotListResponse) Get() *SnapshotListResponse { + return v.value +} + +func (v *NullableSnapshotListResponse) Set(val *SnapshotListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotListResponse(val *SnapshotListResponse) *NullableSnapshotListResponse { + return &NullableSnapshotListResponse{value: val, isSet: true} +} + +func (v NullableSnapshotListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_static_area_id.go b/services/iaas/v2api/model_static_area_id.go new file mode 100644 index 000000000..72201b517 --- /dev/null +++ b/services/iaas/v2api/model_static_area_id.go @@ -0,0 +1,111 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "fmt" +) + +// StaticAreaID The identifier (ID) of a static area. +type StaticAreaID string + +// List of StaticAreaID +const ( + STATICAREAID_PUBLIC StaticAreaID = "PUBLIC" + STATICAREAID_SCHWARZ StaticAreaID = "SCHWARZ" +) + +// All allowed values of StaticAreaID enum +var AllowedStaticAreaIDEnumValues = []StaticAreaID{ + "PUBLIC", + "SCHWARZ", +} + +func (v *StaticAreaID) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StaticAreaID(value) + for _, existing := range AllowedStaticAreaIDEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid StaticAreaID", value) +} + +// NewStaticAreaIDFromValue returns a pointer to a valid StaticAreaID +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStaticAreaIDFromValue(v string) (*StaticAreaID, error) { + ev := StaticAreaID(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StaticAreaID: valid values are %v", v, AllowedStaticAreaIDEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StaticAreaID) IsValid() bool { + for _, existing := range AllowedStaticAreaIDEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StaticAreaID value +func (v StaticAreaID) Ptr() *StaticAreaID { + return &v +} + +type NullableStaticAreaID struct { + value *StaticAreaID + isSet bool +} + +func (v NullableStaticAreaID) Get() *StaticAreaID { + return v.value +} + +func (v *NullableStaticAreaID) Set(val *StaticAreaID) { + v.value = val + v.isSet = true +} + +func (v NullableStaticAreaID) IsSet() bool { + return v.isSet +} + +func (v *NullableStaticAreaID) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStaticAreaID(val *StaticAreaID) *NullableStaticAreaID { + return &NullableStaticAreaID{value: val, isSet: true} +} + +func (v NullableStaticAreaID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStaticAreaID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_attached_volume_payload.go b/services/iaas/v2api/model_update_attached_volume_payload.go new file mode 100644 index 000000000..6c103aff3 --- /dev/null +++ b/services/iaas/v2api/model_update_attached_volume_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateAttachedVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateAttachedVolumePayload{} + +// UpdateAttachedVolumePayload Object that represents a Volume attachment to a server. +type UpdateAttachedVolumePayload struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewUpdateAttachedVolumePayload instantiates a new UpdateAttachedVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateAttachedVolumePayload() *UpdateAttachedVolumePayload { + this := UpdateAttachedVolumePayload{} + return &this +} + +// NewUpdateAttachedVolumePayloadWithDefaults instantiates a new UpdateAttachedVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateAttachedVolumePayloadWithDefaults() *UpdateAttachedVolumePayload { + this := UpdateAttachedVolumePayload{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *UpdateAttachedVolumePayload) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *UpdateAttachedVolumePayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *UpdateAttachedVolumePayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o UpdateAttachedVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateAttachedVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableUpdateAttachedVolumePayload struct { + value *UpdateAttachedVolumePayload + isSet bool +} + +func (v NullableUpdateAttachedVolumePayload) Get() *UpdateAttachedVolumePayload { + return v.value +} + +func (v *NullableUpdateAttachedVolumePayload) Set(val *UpdateAttachedVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateAttachedVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateAttachedVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateAttachedVolumePayload(val *UpdateAttachedVolumePayload) *NullableUpdateAttachedVolumePayload { + return &NullableUpdateAttachedVolumePayload{value: val, isSet: true} +} + +func (v NullableUpdateAttachedVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateAttachedVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_backup_payload.go b/services/iaas/v2api/model_update_backup_payload.go new file mode 100644 index 000000000..3766aa990 --- /dev/null +++ b/services/iaas/v2api/model_update_backup_payload.go @@ -0,0 +1,497 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" + "time" +) + +// checks if the UpdateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupPayload{} + +// UpdateBackupPayload Object that represents a backup. +type UpdateBackupPayload struct { + // Object that represents an availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // Universally Unique Identifier (UUID). + SnapshotId *string `json:"snapshotId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewUpdateBackupPayload instantiates a new UpdateBackupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateBackupPayload() *UpdateBackupPayload { + this := UpdateBackupPayload{} + return &this +} + +// NewUpdateBackupPayloadWithDefaults instantiates a new UpdateBackupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateBackupPayloadWithDefaults() *UpdateBackupPayload { + this := UpdateBackupPayload{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *UpdateBackupPayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *UpdateBackupPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *UpdateBackupPayload) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdateBackupPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateBackupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateBackupPayload) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *UpdateBackupPayload) SetSize(v int64) { + o.Size = &v +} + +// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetSnapshotId() string { + if o == nil || IsNil(o.SnapshotId) { + var ret string + return ret + } + return *o.SnapshotId +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetSnapshotIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotId) { + return nil, false + } + return o.SnapshotId, true +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasSnapshotId() bool { + if o != nil && !IsNil(o.SnapshotId) { + return true + } + + return false +} + +// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +func (o *UpdateBackupPayload) SetSnapshotId(v string) { + o.SnapshotId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *UpdateBackupPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *UpdateBackupPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *UpdateBackupPayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupPayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *UpdateBackupPayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *UpdateBackupPayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o UpdateBackupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SnapshotId) { + toSerialize["snapshotId"] = o.SnapshotId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableUpdateBackupPayload struct { + value *UpdateBackupPayload + isSet bool +} + +func (v NullableUpdateBackupPayload) Get() *UpdateBackupPayload { + return v.value +} + +func (v *NullableUpdateBackupPayload) Set(val *UpdateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupPayload(val *UpdateBackupPayload) *NullableUpdateBackupPayload { + return &NullableUpdateBackupPayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_image_payload.go b/services/iaas/v2api/model_update_image_payload.go new file mode 100644 index 000000000..d66b6882f --- /dev/null +++ b/services/iaas/v2api/model_update_image_payload.go @@ -0,0 +1,383 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateImagePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateImagePayload{} + +// UpdateImagePayload Object that represents an update request body of an Image. +type UpdateImagePayload struct { + Agent *ImageAgent `json:"agent,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat *string `json:"diskFormat,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` +} + +// NewUpdateImagePayload instantiates a new UpdateImagePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateImagePayload() *UpdateImagePayload { + this := UpdateImagePayload{} + return &this +} + +// NewUpdateImagePayloadWithDefaults instantiates a new UpdateImagePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateImagePayloadWithDefaults() *UpdateImagePayload { + this := UpdateImagePayload{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *UpdateImagePayload) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *UpdateImagePayload) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetDiskFormat returns the DiskFormat field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetDiskFormat() string { + if o == nil || IsNil(o.DiskFormat) { + var ret string + return ret + } + return *o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetDiskFormatOk() (*string, bool) { + if o == nil || IsNil(o.DiskFormat) { + return nil, false + } + return o.DiskFormat, true +} + +// HasDiskFormat returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasDiskFormat() bool { + if o != nil && !IsNil(o.DiskFormat) { + return true + } + + return false +} + +// SetDiskFormat gets a reference to the given string and assigns it to the DiskFormat field. +func (o *UpdateImagePayload) SetDiskFormat(v string) { + o.DiskFormat = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateImagePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *UpdateImagePayload) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *UpdateImagePayload) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateImagePayload) SetName(v string) { + o.Name = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *UpdateImagePayload) SetProtected(v bool) { + o.Protected = &v +} + +func (o UpdateImagePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateImagePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.DiskFormat) { + toSerialize["diskFormat"] = o.DiskFormat + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + return toSerialize, nil +} + +type NullableUpdateImagePayload struct { + value *UpdateImagePayload + isSet bool +} + +func (v NullableUpdateImagePayload) Get() *UpdateImagePayload { + return v.value +} + +func (v *NullableUpdateImagePayload) Set(val *UpdateImagePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateImagePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateImagePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateImagePayload(val *UpdateImagePayload) *NullableUpdateImagePayload { + return &NullableUpdateImagePayload{value: val, isSet: true} +} + +func (v NullableUpdateImagePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateImagePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_image_share_payload.go b/services/iaas/v2api/model_update_image_share_payload.go new file mode 100644 index 000000000..bcc57bee7 --- /dev/null +++ b/services/iaas/v2api/model_update_image_share_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateImageSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateImageSharePayload{} + +// UpdateImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type UpdateImageSharePayload struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewUpdateImageSharePayload instantiates a new UpdateImageSharePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateImageSharePayload() *UpdateImageSharePayload { + this := UpdateImageSharePayload{} + return &this +} + +// NewUpdateImageSharePayloadWithDefaults instantiates a new UpdateImageSharePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateImageSharePayloadWithDefaults() *UpdateImageSharePayload { + this := UpdateImageSharePayload{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *UpdateImageSharePayload) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImageSharePayload) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *UpdateImageSharePayload) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *UpdateImageSharePayload) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *UpdateImageSharePayload) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImageSharePayload) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *UpdateImageSharePayload) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *UpdateImageSharePayload) SetProjects(v []string) { + o.Projects = v +} + +func (o UpdateImageSharePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateImageSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableUpdateImageSharePayload struct { + value *UpdateImageSharePayload + isSet bool +} + +func (v NullableUpdateImageSharePayload) Get() *UpdateImageSharePayload { + return v.value +} + +func (v *NullableUpdateImageSharePayload) Set(val *UpdateImageSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateImageSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateImageSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateImageSharePayload(val *UpdateImageSharePayload) *NullableUpdateImageSharePayload { + return &NullableUpdateImageSharePayload{value: val, isSet: true} +} + +func (v NullableUpdateImageSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateImageSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_key_pair_payload.go b/services/iaas/v2api/model_update_key_pair_payload.go new file mode 100644 index 000000000..fe51dd475 --- /dev/null +++ b/services/iaas/v2api/model_update_key_pair_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateKeyPairPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateKeyPairPayload{} + +// UpdateKeyPairPayload Object that represents an update request body of a public key of an SSH keypair. +type UpdateKeyPairPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewUpdateKeyPairPayload instantiates a new UpdateKeyPairPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateKeyPairPayload() *UpdateKeyPairPayload { + this := UpdateKeyPairPayload{} + return &this +} + +// NewUpdateKeyPairPayloadWithDefaults instantiates a new UpdateKeyPairPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateKeyPairPayloadWithDefaults() *UpdateKeyPairPayload { + this := UpdateKeyPairPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateKeyPairPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateKeyPairPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateKeyPairPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateKeyPairPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o UpdateKeyPairPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateKeyPairPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableUpdateKeyPairPayload struct { + value *UpdateKeyPairPayload + isSet bool +} + +func (v NullableUpdateKeyPairPayload) Get() *UpdateKeyPairPayload { + return v.value +} + +func (v *NullableUpdateKeyPairPayload) Set(val *UpdateKeyPairPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateKeyPairPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateKeyPairPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateKeyPairPayload(val *UpdateKeyPairPayload) *NullableUpdateKeyPairPayload { + return &NullableUpdateKeyPairPayload{value: val, isSet: true} +} + +func (v NullableUpdateKeyPairPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateKeyPairPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_network_area_region_payload.go b/services/iaas/v2api/model_update_network_area_region_payload.go new file mode 100644 index 000000000..5fb6408ae --- /dev/null +++ b/services/iaas/v2api/model_update_network_area_region_payload.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkAreaRegionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkAreaRegionPayload{} + +// UpdateNetworkAreaRegionPayload Object that represents the request body for a regional network area update. +type UpdateNetworkAreaRegionPayload struct { + Ipv4 *UpdateRegionalAreaIPv4 `json:"ipv4,omitempty"` +} + +// NewUpdateNetworkAreaRegionPayload instantiates a new UpdateNetworkAreaRegionPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkAreaRegionPayload() *UpdateNetworkAreaRegionPayload { + this := UpdateNetworkAreaRegionPayload{} + return &this +} + +// NewUpdateNetworkAreaRegionPayloadWithDefaults instantiates a new UpdateNetworkAreaRegionPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkAreaRegionPayloadWithDefaults() *UpdateNetworkAreaRegionPayload { + this := UpdateNetworkAreaRegionPayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *UpdateNetworkAreaRegionPayload) GetIpv4() UpdateRegionalAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret UpdateRegionalAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkAreaRegionPayload) GetIpv4Ok() (*UpdateRegionalAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *UpdateNetworkAreaRegionPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given UpdateRegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *UpdateNetworkAreaRegionPayload) SetIpv4(v UpdateRegionalAreaIPv4) { + o.Ipv4 = &v +} + +func (o UpdateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableUpdateNetworkAreaRegionPayload struct { + value *UpdateNetworkAreaRegionPayload + isSet bool +} + +func (v NullableUpdateNetworkAreaRegionPayload) Get() *UpdateNetworkAreaRegionPayload { + return v.value +} + +func (v *NullableUpdateNetworkAreaRegionPayload) Set(val *UpdateNetworkAreaRegionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkAreaRegionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkAreaRegionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkAreaRegionPayload(val *UpdateNetworkAreaRegionPayload) *NullableUpdateNetworkAreaRegionPayload { + return &NullableUpdateNetworkAreaRegionPayload{value: val, isSet: true} +} + +func (v NullableUpdateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkAreaRegionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_network_area_route_payload.go b/services/iaas/v2api/model_update_network_area_route_payload.go new file mode 100644 index 000000000..a9fb727a7 --- /dev/null +++ b/services/iaas/v2api/model_update_network_area_route_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkAreaRoutePayload{} + +// UpdateNetworkAreaRoutePayload Object that represents the request body for a route update. +type UpdateNetworkAreaRoutePayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewUpdateNetworkAreaRoutePayload instantiates a new UpdateNetworkAreaRoutePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkAreaRoutePayload() *UpdateNetworkAreaRoutePayload { + this := UpdateNetworkAreaRoutePayload{} + return &this +} + +// NewUpdateNetworkAreaRoutePayloadWithDefaults instantiates a new UpdateNetworkAreaRoutePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkAreaRoutePayloadWithDefaults() *UpdateNetworkAreaRoutePayload { + this := UpdateNetworkAreaRoutePayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateNetworkAreaRoutePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkAreaRoutePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateNetworkAreaRoutePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateNetworkAreaRoutePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o UpdateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableUpdateNetworkAreaRoutePayload struct { + value *UpdateNetworkAreaRoutePayload + isSet bool +} + +func (v NullableUpdateNetworkAreaRoutePayload) Get() *UpdateNetworkAreaRoutePayload { + return v.value +} + +func (v *NullableUpdateNetworkAreaRoutePayload) Set(val *UpdateNetworkAreaRoutePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkAreaRoutePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkAreaRoutePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkAreaRoutePayload(val *UpdateNetworkAreaRoutePayload) *NullableUpdateNetworkAreaRoutePayload { + return &NullableUpdateNetworkAreaRoutePayload{value: val, isSet: true} +} + +func (v NullableUpdateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_network_ipv4_body.go b/services/iaas/v2api/model_update_network_ipv4_body.go new file mode 100644 index 000000000..51419da6a --- /dev/null +++ b/services/iaas/v2api/model_update_network_ipv4_body.go @@ -0,0 +1,174 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkIPv4Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv4Body{} + +// UpdateNetworkIPv4Body The config object for a IPv4 network update. +type UpdateNetworkIPv4Body struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv4Body instantiates a new UpdateNetworkIPv4Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// NewUpdateNetworkIPv4BodyWithDefaults instantiates a new UpdateNetworkIPv4Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv4Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv4Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *UpdateNetworkIPv4Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *UpdateNetworkIPv4Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *UpdateNetworkIPv4Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv4Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv4Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv4Body) SetNameservers(v []string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv4Body struct { + value *UpdateNetworkIPv4Body + isSet bool +} + +func (v NullableUpdateNetworkIPv4Body) Get() *UpdateNetworkIPv4Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv4Body) Set(val *UpdateNetworkIPv4Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv4Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv4Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv4Body(val *UpdateNetworkIPv4Body) *NullableUpdateNetworkIPv4Body { + return &NullableUpdateNetworkIPv4Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv4Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_network_ipv6_body.go b/services/iaas/v2api/model_update_network_ipv6_body.go new file mode 100644 index 000000000..d281025d9 --- /dev/null +++ b/services/iaas/v2api/model_update_network_ipv6_body.go @@ -0,0 +1,174 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkIPv6Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv6Body{} + +// UpdateNetworkIPv6Body The config object for a IPv6 network update. +type UpdateNetworkIPv6Body struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv6Body instantiates a new UpdateNetworkIPv6Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkIPv6Body() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// NewUpdateNetworkIPv6BodyWithDefaults instantiates a new UpdateNetworkIPv6Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkIPv6BodyWithDefaults() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv6Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv6Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *UpdateNetworkIPv6Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *UpdateNetworkIPv6Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *UpdateNetworkIPv6Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv6Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv6Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv6Body) SetNameservers(v []string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv6Body struct { + value *UpdateNetworkIPv6Body + isSet bool +} + +func (v NullableUpdateNetworkIPv6Body) Get() *UpdateNetworkIPv6Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv6Body) Set(val *UpdateNetworkIPv6Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv6Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv6Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv6Body(val *UpdateNetworkIPv6Body) *NullableUpdateNetworkIPv6Body { + return &NullableUpdateNetworkIPv6Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv6Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_nic_payload.go b/services/iaas/v2api/model_update_nic_payload.go new file mode 100644 index 000000000..25e5e64b0 --- /dev/null +++ b/services/iaas/v2api/model_update_nic_payload.go @@ -0,0 +1,311 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateNicPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNicPayload{} + +// UpdateNicPayload Object that represents a network interface update. +type UpdateNicPayload struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` +} + +// NewUpdateNicPayload instantiates a new UpdateNicPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNicPayload() *UpdateNicPayload { + this := UpdateNicPayload{} + return &this +} + +// NewUpdateNicPayloadWithDefaults instantiates a new UpdateNicPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNicPayloadWithDefaults() *UpdateNicPayload { + this := UpdateNicPayload{} + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *UpdateNicPayload) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateNicPayload) SetDescription(v string) { + o.Description = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateNicPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateNicPayload) SetName(v string) { + o.Name = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *UpdateNicPayload) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *UpdateNicPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +func (o UpdateNicPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNicPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + return toSerialize, nil +} + +type NullableUpdateNicPayload struct { + value *UpdateNicPayload + isSet bool +} + +func (v NullableUpdateNicPayload) Get() *UpdateNicPayload { + return v.value +} + +func (v *NullableUpdateNicPayload) Set(val *UpdateNicPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNicPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNicPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNicPayload(val *UpdateNicPayload) *NullableUpdateNicPayload { + return &NullableUpdateNicPayload{value: val, isSet: true} +} + +func (v NullableUpdateNicPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNicPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_public_ip_payload.go b/services/iaas/v2api/model_update_public_ip_payload.go new file mode 100644 index 000000000..fa1ce03c6 --- /dev/null +++ b/services/iaas/v2api/model_update_public_ip_payload.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdatePublicIPPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdatePublicIPPayload{} + +// UpdatePublicIPPayload Object that represents a public IP. +type UpdatePublicIPPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // String that represents an IPv4 address. + Ip *string `json:"ip,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewUpdatePublicIPPayload instantiates a new UpdatePublicIPPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdatePublicIPPayload() *UpdatePublicIPPayload { + this := UpdatePublicIPPayload{} + return &this +} + +// NewUpdatePublicIPPayloadWithDefaults instantiates a new UpdatePublicIPPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdatePublicIPPayloadWithDefaults() *UpdatePublicIPPayload { + this := UpdatePublicIPPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdatePublicIPPayload) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *UpdatePublicIPPayload) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdatePublicIPPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdatePublicIPPayload) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *UpdatePublicIPPayload) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *UpdatePublicIPPayload) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *UpdatePublicIPPayload) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o UpdatePublicIPPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdatePublicIPPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullableUpdatePublicIPPayload struct { + value *UpdatePublicIPPayload + isSet bool +} + +func (v NullableUpdatePublicIPPayload) Get() *UpdatePublicIPPayload { + return v.value +} + +func (v *NullableUpdatePublicIPPayload) Set(val *UpdatePublicIPPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdatePublicIPPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdatePublicIPPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdatePublicIPPayload(val *UpdatePublicIPPayload) *NullableUpdatePublicIPPayload { + return &NullableUpdatePublicIPPayload{value: val, isSet: true} +} + +func (v NullableUpdatePublicIPPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdatePublicIPPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_regional_area_ipv4.go b/services/iaas/v2api/model_update_regional_area_ipv4.go new file mode 100644 index 000000000..851133f73 --- /dev/null +++ b/services/iaas/v2api/model_update_regional_area_ipv4.go @@ -0,0 +1,236 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateRegionalAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRegionalAreaIPv4{} + +// UpdateRegionalAreaIPv4 Object that represents the request body for a regional network area IPv4 configuration update. +type UpdateRegionalAreaIPv4 struct { + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // The default prefix length for networks in the network area. + DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` + // The minimal prefix length for networks in the network area. + MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` +} + +// NewUpdateRegionalAreaIPv4 instantiates a new UpdateRegionalAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRegionalAreaIPv4() *UpdateRegionalAreaIPv4 { + this := UpdateRegionalAreaIPv4{} + return &this +} + +// NewUpdateRegionalAreaIPv4WithDefaults instantiates a new UpdateRegionalAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRegionalAreaIPv4WithDefaults() *UpdateRegionalAreaIPv4 { + this := UpdateRegionalAreaIPv4{} + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *UpdateRegionalAreaIPv4) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLen() int64 { + if o == nil || IsNil(o.DefaultPrefixLen) { + var ret int64 + return ret + } + return *o.DefaultPrefixLen +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { + if o == nil || IsNil(o.DefaultPrefixLen) { + return nil, false + } + return o.DefaultPrefixLen, true +} + +// HasDefaultPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasDefaultPrefixLen() bool { + if o != nil && !IsNil(o.DefaultPrefixLen) { + return true + } + + return false +} + +// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetDefaultPrefixLen(v int64) { + o.DefaultPrefixLen = &v +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLen() int64 { + if o == nil || IsNil(o.MaxPrefixLen) { + var ret int64 + return ret + } + return *o.MaxPrefixLen +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { + if o == nil || IsNil(o.MaxPrefixLen) { + return nil, false + } + return o.MaxPrefixLen, true +} + +// HasMaxPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasMaxPrefixLen() bool { + if o != nil && !IsNil(o.MaxPrefixLen) { + return true + } + + return false +} + +// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetMaxPrefixLen(v int64) { + o.MaxPrefixLen = &v +} + +// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetMinPrefixLen() int64 { + if o == nil || IsNil(o.MinPrefixLen) { + var ret int64 + return ret + } + return *o.MinPrefixLen +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { + if o == nil || IsNil(o.MinPrefixLen) { + return nil, false + } + return o.MinPrefixLen, true +} + +// HasMinPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasMinPrefixLen() bool { + if o != nil && !IsNil(o.MinPrefixLen) { + return true + } + + return false +} + +// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetMinPrefixLen(v int64) { + o.MinPrefixLen = &v +} + +func (o UpdateRegionalAreaIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRegionalAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + if !IsNil(o.DefaultPrefixLen) { + toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + } + if !IsNil(o.MaxPrefixLen) { + toSerialize["maxPrefixLen"] = o.MaxPrefixLen + } + if !IsNil(o.MinPrefixLen) { + toSerialize["minPrefixLen"] = o.MinPrefixLen + } + return toSerialize, nil +} + +type NullableUpdateRegionalAreaIPv4 struct { + value *UpdateRegionalAreaIPv4 + isSet bool +} + +func (v NullableUpdateRegionalAreaIPv4) Get() *UpdateRegionalAreaIPv4 { + return v.value +} + +func (v *NullableUpdateRegionalAreaIPv4) Set(val *UpdateRegionalAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRegionalAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRegionalAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRegionalAreaIPv4(val *UpdateRegionalAreaIPv4) *NullableUpdateRegionalAreaIPv4 { + return &NullableUpdateRegionalAreaIPv4{value: val, isSet: true} +} + +func (v NullableUpdateRegionalAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRegionalAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_route_of_routing_table_payload.go b/services/iaas/v2api/model_update_route_of_routing_table_payload.go new file mode 100644 index 000000000..586e70f95 --- /dev/null +++ b/services/iaas/v2api/model_update_route_of_routing_table_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateRouteOfRoutingTablePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRouteOfRoutingTablePayload{} + +// UpdateRouteOfRoutingTablePayload Object that represents the request body for a route update. +type UpdateRouteOfRoutingTablePayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewUpdateRouteOfRoutingTablePayload instantiates a new UpdateRouteOfRoutingTablePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRouteOfRoutingTablePayload() *UpdateRouteOfRoutingTablePayload { + this := UpdateRouteOfRoutingTablePayload{} + return &this +} + +// NewUpdateRouteOfRoutingTablePayloadWithDefaults instantiates a new UpdateRouteOfRoutingTablePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRouteOfRoutingTablePayloadWithDefaults() *UpdateRouteOfRoutingTablePayload { + this := UpdateRouteOfRoutingTablePayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateRouteOfRoutingTablePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRouteOfRoutingTablePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateRouteOfRoutingTablePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateRouteOfRoutingTablePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o UpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRouteOfRoutingTablePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableUpdateRouteOfRoutingTablePayload struct { + value *UpdateRouteOfRoutingTablePayload + isSet bool +} + +func (v NullableUpdateRouteOfRoutingTablePayload) Get() *UpdateRouteOfRoutingTablePayload { + return v.value +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) Set(val *UpdateRouteOfRoutingTablePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRouteOfRoutingTablePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRouteOfRoutingTablePayload(val *UpdateRouteOfRoutingTablePayload) *NullableUpdateRouteOfRoutingTablePayload { + return &NullableUpdateRouteOfRoutingTablePayload{value: val, isSet: true} +} + +func (v NullableUpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_routing_table_of_area_payload.go b/services/iaas/v2api/model_update_routing_table_of_area_payload.go new file mode 100644 index 000000000..788633514 --- /dev/null +++ b/services/iaas/v2api/model_update_routing_table_of_area_payload.go @@ -0,0 +1,274 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateRoutingTableOfAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRoutingTableOfAreaPayload{} + +// UpdateRoutingTableOfAreaPayload Object that represents the request body for a routing table update. +type UpdateRoutingTableOfAreaPayload struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The update config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The update config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` +} + +// NewUpdateRoutingTableOfAreaPayload instantiates a new UpdateRoutingTableOfAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRoutingTableOfAreaPayload() *UpdateRoutingTableOfAreaPayload { + this := UpdateRoutingTableOfAreaPayload{} + return &this +} + +// NewUpdateRoutingTableOfAreaPayloadWithDefaults instantiates a new UpdateRoutingTableOfAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRoutingTableOfAreaPayloadWithDefaults() *UpdateRoutingTableOfAreaPayload { + this := UpdateRoutingTableOfAreaPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateRoutingTableOfAreaPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *UpdateRoutingTableOfAreaPayload) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateRoutingTableOfAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateRoutingTableOfAreaPayload) SetName(v string) { + o.Name = &v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *UpdateRoutingTableOfAreaPayload) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +func (o UpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRoutingTableOfAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + return toSerialize, nil +} + +type NullableUpdateRoutingTableOfAreaPayload struct { + value *UpdateRoutingTableOfAreaPayload + isSet bool +} + +func (v NullableUpdateRoutingTableOfAreaPayload) Get() *UpdateRoutingTableOfAreaPayload { + return v.value +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) Set(val *UpdateRoutingTableOfAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRoutingTableOfAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRoutingTableOfAreaPayload(val *UpdateRoutingTableOfAreaPayload) *NullableUpdateRoutingTableOfAreaPayload { + return &NullableUpdateRoutingTableOfAreaPayload{value: val, isSet: true} +} + +func (v NullableUpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_security_group_payload.go b/services/iaas/v2api/model_update_security_group_payload.go new file mode 100644 index 000000000..be3d52d81 --- /dev/null +++ b/services/iaas/v2api/model_update_security_group_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateSecurityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateSecurityGroupPayload{} + +// UpdateSecurityGroupPayload Object that represents an update request body of a security group. +type UpdateSecurityGroupPayload struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewUpdateSecurityGroupPayload instantiates a new UpdateSecurityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateSecurityGroupPayload() *UpdateSecurityGroupPayload { + this := UpdateSecurityGroupPayload{} + return &this +} + +// NewUpdateSecurityGroupPayloadWithDefaults instantiates a new UpdateSecurityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateSecurityGroupPayloadWithDefaults() *UpdateSecurityGroupPayload { + this := UpdateSecurityGroupPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateSecurityGroupPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateSecurityGroupPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateSecurityGroupPayload) SetDescription(v string) { + o.Description = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateSecurityGroupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSecurityGroupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateSecurityGroupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateSecurityGroupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateSecurityGroupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSecurityGroupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateSecurityGroupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateSecurityGroupPayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateSecurityGroupPayload struct { + value *UpdateSecurityGroupPayload + isSet bool +} + +func (v NullableUpdateSecurityGroupPayload) Get() *UpdateSecurityGroupPayload { + return v.value +} + +func (v *NullableUpdateSecurityGroupPayload) Set(val *UpdateSecurityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSecurityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSecurityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSecurityGroupPayload(val *UpdateSecurityGroupPayload) *NullableUpdateSecurityGroupPayload { + return &NullableUpdateSecurityGroupPayload{value: val, isSet: true} +} + +func (v NullableUpdateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSecurityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_server_payload.go b/services/iaas/v2api/model_update_server_payload.go new file mode 100644 index 000000000..01cb2a353 --- /dev/null +++ b/services/iaas/v2api/model_update_server_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateServerPayload{} + +// UpdateServerPayload Object that represents an update request body of a server. +type UpdateServerPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name *string `json:"name,omitempty" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` +} + +// NewUpdateServerPayload instantiates a new UpdateServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateServerPayload() *UpdateServerPayload { + this := UpdateServerPayload{} + return &this +} + +// NewUpdateServerPayloadWithDefaults instantiates a new UpdateServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateServerPayloadWithDefaults() *UpdateServerPayload { + this := UpdateServerPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateServerPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *UpdateServerPayload) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateServerPayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateServerPayload struct { + value *UpdateServerPayload + isSet bool +} + +func (v NullableUpdateServerPayload) Get() *UpdateServerPayload { + return v.value +} + +func (v *NullableUpdateServerPayload) Set(val *UpdateServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateServerPayload(val *UpdateServerPayload) *NullableUpdateServerPayload { + return &NullableUpdateServerPayload{value: val, isSet: true} +} + +func (v NullableUpdateServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_snapshot_payload.go b/services/iaas/v2api/model_update_snapshot_payload.go new file mode 100644 index 000000000..42ce50d8b --- /dev/null +++ b/services/iaas/v2api/model_update_snapshot_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateSnapshotPayload{} + +// UpdateSnapshotPayload Object that represents an update request body of a snapshot. +type UpdateSnapshotPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewUpdateSnapshotPayload instantiates a new UpdateSnapshotPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateSnapshotPayload() *UpdateSnapshotPayload { + this := UpdateSnapshotPayload{} + return &this +} + +// NewUpdateSnapshotPayloadWithDefaults instantiates a new UpdateSnapshotPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateSnapshotPayloadWithDefaults() *UpdateSnapshotPayload { + this := UpdateSnapshotPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateSnapshotPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSnapshotPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateSnapshotPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateSnapshotPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateSnapshotPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateSnapshotPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateSnapshotPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateSnapshotPayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateSnapshotPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateSnapshotPayload struct { + value *UpdateSnapshotPayload + isSet bool +} + +func (v NullableUpdateSnapshotPayload) Get() *UpdateSnapshotPayload { + return v.value +} + +func (v *NullableUpdateSnapshotPayload) Set(val *UpdateSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateSnapshotPayload(val *UpdateSnapshotPayload) *NullableUpdateSnapshotPayload { + return &NullableUpdateSnapshotPayload{value: val, isSet: true} +} + +func (v NullableUpdateSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_update_volume_payload.go b/services/iaas/v2api/model_update_volume_payload.go new file mode 100644 index 000000000..77625afb2 --- /dev/null +++ b/services/iaas/v2api/model_update_volume_payload.go @@ -0,0 +1,273 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the UpdateVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateVolumePayload{} + +// UpdateVolumePayload Object that represents an update request body of a volume. +type UpdateVolumePayload struct { + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewUpdateVolumePayload instantiates a new UpdateVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateVolumePayload() *UpdateVolumePayload { + this := UpdateVolumePayload{} + return &this +} + +// NewUpdateVolumePayloadWithDefaults instantiates a new UpdateVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateVolumePayloadWithDefaults() *UpdateVolumePayload { + this := UpdateVolumePayload{} + return &this +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *UpdateVolumePayload) SetBootable(v bool) { + o.Bootable = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateVolumePayload) SetDescription(v string) { + o.Description = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *UpdateVolumePayload) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateVolumePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateVolumePayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateVolumePayload struct { + value *UpdateVolumePayload + isSet bool +} + +func (v NullableUpdateVolumePayload) Get() *UpdateVolumePayload { + return v.value +} + +func (v *NullableUpdateVolumePayload) Set(val *UpdateVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateVolumePayload(val *UpdateVolumePayload) *NullableUpdateVolumePayload { + return &NullableUpdateVolumePayload{value: val, isSet: true} +} + +func (v NullableUpdateVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_volume.go b/services/iaas/v2api/model_volume.go new file mode 100644 index 000000000..e90aad873 --- /dev/null +++ b/services/iaas/v2api/model_volume.go @@ -0,0 +1,711 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Volume type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Volume{} + +// Volume Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. +type Volume struct { + // Object that represents an availability zone. + AvailabilityZone string `json:"availabilityZone"` + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionParameters *VolumeEncryptionParameter `json:"encryptionParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *VolumeSource `json:"source,omitempty"` + // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Volume Volume + +// NewVolume instantiates a new Volume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolume(availabilityZone string) *Volume { + this := Volume{} + this.AvailabilityZone = availabilityZone + return &this +} + +// NewVolumeWithDefaults instantiates a new Volume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeWithDefaults() *Volume { + this := Volume{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value +func (o *Volume) GetAvailabilityZone() string { + if o == nil { + var ret string + return ret + } + + return o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value +// and a boolean to check if the value has been set. +func (o *Volume) GetAvailabilityZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailabilityZone, true +} + +// SetAvailabilityZone sets field value +func (o *Volume) SetAvailabilityZone(v string) { + o.AvailabilityZone = v +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *Volume) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *Volume) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *Volume) SetBootable(v bool) { + o.Bootable = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Volume) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Volume) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Volume) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Volume) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Volume) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Volume) SetDescription(v string) { + o.Description = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *Volume) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *Volume) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *Volume) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetEncryptionParameters returns the EncryptionParameters field value if set, zero value otherwise. +func (o *Volume) GetEncryptionParameters() VolumeEncryptionParameter { + if o == nil || IsNil(o.EncryptionParameters) { + var ret VolumeEncryptionParameter + return ret + } + return *o.EncryptionParameters +} + +// GetEncryptionParametersOk returns a tuple with the EncryptionParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetEncryptionParametersOk() (*VolumeEncryptionParameter, bool) { + if o == nil || IsNil(o.EncryptionParameters) { + return nil, false + } + return o.EncryptionParameters, true +} + +// HasEncryptionParameters returns a boolean if a field has been set. +func (o *Volume) HasEncryptionParameters() bool { + if o != nil && !IsNil(o.EncryptionParameters) { + return true + } + + return false +} + +// SetEncryptionParameters gets a reference to the given VolumeEncryptionParameter and assigns it to the EncryptionParameters field. +func (o *Volume) SetEncryptionParameters(v VolumeEncryptionParameter) { + o.EncryptionParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Volume) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Volume) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Volume) SetId(v string) { + o.Id = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *Volume) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *Volume) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *Volume) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Volume) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Volume) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Volume) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Volume) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Volume) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Volume) SetName(v string) { + o.Name = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *Volume) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *Volume) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *Volume) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *Volume) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *Volume) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *Volume) SetServerId(v string) { + o.ServerId = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Volume) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Volume) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Volume) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *Volume) GetSource() VolumeSource { + if o == nil || IsNil(o.Source) { + var ret VolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetSourceOk() (*VolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *Volume) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given VolumeSource and assigns it to the Source field. +func (o *Volume) SetSource(v VolumeSource) { + o.Source = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Volume) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Volume) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Volume) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Volume) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Volume) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Volume) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Volume) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Volume) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["availabilityZone"] = o.AvailabilityZone + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.EncryptionParameters) { + toSerialize["encryptionParameters"] = o.EncryptionParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Volume) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "availabilityZone", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolume := _Volume{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolume) + + if err != nil { + return err + } + + *o = Volume(varVolume) + + return err +} + +type NullableVolume struct { + value *Volume + isSet bool +} + +func (v NullableVolume) Get() *Volume { + return v.value +} + +func (v *NullableVolume) Set(val *Volume) { + v.value = val + v.isSet = true +} + +func (v NullableVolume) IsSet() bool { + return v.isSet +} + +func (v *NullableVolume) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolume(val *Volume) *NullableVolume { + return &NullableVolume{value: val, isSet: true} +} + +func (v NullableVolume) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolume) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_volume_attachment.go b/services/iaas/v2api/model_volume_attachment.go new file mode 100644 index 000000000..cefb51c5c --- /dev/null +++ b/services/iaas/v2api/model_volume_attachment.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the VolumeAttachment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeAttachment{} + +// VolumeAttachment Object that represents a Volume attachment to a server. +type VolumeAttachment struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewVolumeAttachment instantiates a new VolumeAttachment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeAttachment() *VolumeAttachment { + this := VolumeAttachment{} + return &this +} + +// NewVolumeAttachmentWithDefaults instantiates a new VolumeAttachment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeAttachmentWithDefaults() *VolumeAttachment { + this := VolumeAttachment{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *VolumeAttachment) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *VolumeAttachment) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *VolumeAttachment) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *VolumeAttachment) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *VolumeAttachment) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *VolumeAttachment) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *VolumeAttachment) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *VolumeAttachment) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *VolumeAttachment) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o VolumeAttachment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeAttachment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableVolumeAttachment struct { + value *VolumeAttachment + isSet bool +} + +func (v NullableVolumeAttachment) Get() *VolumeAttachment { + return v.value +} + +func (v *NullableVolumeAttachment) Set(val *VolumeAttachment) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeAttachment) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeAttachment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeAttachment(val *VolumeAttachment) *NullableVolumeAttachment { + return &NullableVolumeAttachment{value: val, isSet: true} +} + +func (v NullableVolumeAttachment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeAttachment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_volume_attachment_list_response.go b/services/iaas/v2api/model_volume_attachment_list_response.go new file mode 100644 index 000000000..36d54d7f0 --- /dev/null +++ b/services/iaas/v2api/model_volume_attachment_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeAttachmentListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeAttachmentListResponse{} + +// VolumeAttachmentListResponse Volume attachment list response. +type VolumeAttachmentListResponse struct { + // A list containing Volume attachments of a server. + Items []VolumeAttachment `json:"items"` +} + +type _VolumeAttachmentListResponse VolumeAttachmentListResponse + +// NewVolumeAttachmentListResponse instantiates a new VolumeAttachmentListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeAttachmentListResponse(items []VolumeAttachment) *VolumeAttachmentListResponse { + this := VolumeAttachmentListResponse{} + this.Items = items + return &this +} + +// NewVolumeAttachmentListResponseWithDefaults instantiates a new VolumeAttachmentListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeAttachmentListResponseWithDefaults() *VolumeAttachmentListResponse { + this := VolumeAttachmentListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumeAttachmentListResponse) GetItems() []VolumeAttachment { + if o == nil { + var ret []VolumeAttachment + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumeAttachmentListResponse) GetItemsOk() ([]VolumeAttachment, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumeAttachmentListResponse) SetItems(v []VolumeAttachment) { + o.Items = v +} + +func (o VolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumeAttachmentListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeAttachmentListResponse := _VolumeAttachmentListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeAttachmentListResponse) + + if err != nil { + return err + } + + *o = VolumeAttachmentListResponse(varVolumeAttachmentListResponse) + + return err +} + +type NullableVolumeAttachmentListResponse struct { + value *VolumeAttachmentListResponse + isSet bool +} + +func (v NullableVolumeAttachmentListResponse) Get() *VolumeAttachmentListResponse { + return v.value +} + +func (v *NullableVolumeAttachmentListResponse) Set(val *VolumeAttachmentListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeAttachmentListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeAttachmentListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeAttachmentListResponse(val *VolumeAttachmentListResponse) *NullableVolumeAttachmentListResponse { + return &NullableVolumeAttachmentListResponse{value: val, isSet: true} +} + +func (v NullableVolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeAttachmentListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_volume_encryption_parameter.go b/services/iaas/v2api/model_volume_encryption_parameter.go new file mode 100644 index 000000000..ed9246ee4 --- /dev/null +++ b/services/iaas/v2api/model_volume_encryption_parameter.go @@ -0,0 +1,319 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeEncryptionParameter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeEncryptionParameter{} + +// VolumeEncryptionParameter Parameter to connect to a key-encryption-key within the STACKIT-KMS to create encrypted volumes. If no key_payload is set, a random passphrase is generated, which will be encrypted against the STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the responses. +type VolumeEncryptionParameter struct { + // UUID of the Key within the STACKIT-KMS to use for the encryption. + KekKeyId string `json:"kekKeyId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Version of the key within the STACKIT-KMS to use for the encryption. + KekKeyVersion int64 `json:"kekKeyVersion"` + // UUID of the keyring where the key is located within the STACKTI-KMS. + KekKeyringId string `json:"kekKeyringId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Id of the project, where the key in the STACKIT-KMS belongs to, in case the key is located in a different project. By default the same project ID is used, like for the volume itself. Defining a key in a different project is only allowed for privileged internal projects. + KekProjectId *string `json:"kekProjectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Optional predefined secret, which will be encrypted against the key-encryption-key within the STACKIT-KMS. If not defined, a random secret will be generated by the API and encrypted against the STACKIT-KMS. If a key-payload is provided here, it must be base64 encoded. + KeyPayload *string `json:"keyPayload,omitempty"` + // Service-Account linked to the Key within the STACKIT-KMS. + ServiceAccount string `json:"serviceAccount" validate:"regexp=[a-z0-9-]+(?:\\\\.[a-z0-9]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"` +} + +type _VolumeEncryptionParameter VolumeEncryptionParameter + +// NewVolumeEncryptionParameter instantiates a new VolumeEncryptionParameter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeEncryptionParameter(kekKeyId string, kekKeyVersion int64, kekKeyringId string, serviceAccount string) *VolumeEncryptionParameter { + this := VolumeEncryptionParameter{} + this.KekKeyId = kekKeyId + this.KekKeyVersion = kekKeyVersion + this.KekKeyringId = kekKeyringId + this.ServiceAccount = serviceAccount + return &this +} + +// NewVolumeEncryptionParameterWithDefaults instantiates a new VolumeEncryptionParameter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeEncryptionParameterWithDefaults() *VolumeEncryptionParameter { + this := VolumeEncryptionParameter{} + return &this +} + +// GetKekKeyId returns the KekKeyId field value +func (o *VolumeEncryptionParameter) GetKekKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyId +} + +// GetKekKeyIdOk returns a tuple with the KekKeyId field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyId, true +} + +// SetKekKeyId sets field value +func (o *VolumeEncryptionParameter) SetKekKeyId(v string) { + o.KekKeyId = v +} + +// GetKekKeyVersion returns the KekKeyVersion field value +func (o *VolumeEncryptionParameter) GetKekKeyVersion() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.KekKeyVersion +} + +// GetKekKeyVersionOk returns a tuple with the KekKeyVersion field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyVersionOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyVersion, true +} + +// SetKekKeyVersion sets field value +func (o *VolumeEncryptionParameter) SetKekKeyVersion(v int64) { + o.KekKeyVersion = v +} + +// GetKekKeyringId returns the KekKeyringId field value +func (o *VolumeEncryptionParameter) GetKekKeyringId() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyringId +} + +// GetKekKeyringIdOk returns a tuple with the KekKeyringId field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyringIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyringId, true +} + +// SetKekKeyringId sets field value +func (o *VolumeEncryptionParameter) SetKekKeyringId(v string) { + o.KekKeyringId = v +} + +// GetKekProjectId returns the KekProjectId field value if set, zero value otherwise. +func (o *VolumeEncryptionParameter) GetKekProjectId() string { + if o == nil || IsNil(o.KekProjectId) { + var ret string + return ret + } + return *o.KekProjectId +} + +// GetKekProjectIdOk returns a tuple with the KekProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.KekProjectId) { + return nil, false + } + return o.KekProjectId, true +} + +// HasKekProjectId returns a boolean if a field has been set. +func (o *VolumeEncryptionParameter) HasKekProjectId() bool { + if o != nil && !IsNil(o.KekProjectId) { + return true + } + + return false +} + +// SetKekProjectId gets a reference to the given string and assigns it to the KekProjectId field. +func (o *VolumeEncryptionParameter) SetKekProjectId(v string) { + o.KekProjectId = &v +} + +// GetKeyPayload returns the KeyPayload field value if set, zero value otherwise. +func (o *VolumeEncryptionParameter) GetKeyPayload() string { + if o == nil || IsNil(o.KeyPayload) { + var ret string + return ret + } + return *o.KeyPayload +} + +// GetKeyPayloadOk returns a tuple with the KeyPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKeyPayloadOk() (*string, bool) { + if o == nil || IsNil(o.KeyPayload) { + return nil, false + } + return o.KeyPayload, true +} + +// HasKeyPayload returns a boolean if a field has been set. +func (o *VolumeEncryptionParameter) HasKeyPayload() bool { + if o != nil && !IsNil(o.KeyPayload) { + return true + } + + return false +} + +// SetKeyPayload gets a reference to the given string and assigns it to the KeyPayload field. +func (o *VolumeEncryptionParameter) SetKeyPayload(v string) { + o.KeyPayload = &v +} + +// GetServiceAccount returns the ServiceAccount field value +func (o *VolumeEncryptionParameter) GetServiceAccount() string { + if o == nil { + var ret string + return ret + } + + return o.ServiceAccount +} + +// GetServiceAccountOk returns a tuple with the ServiceAccount field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetServiceAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServiceAccount, true +} + +// SetServiceAccount sets field value +func (o *VolumeEncryptionParameter) SetServiceAccount(v string) { + o.ServiceAccount = v +} + +func (o VolumeEncryptionParameter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeEncryptionParameter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["kekKeyId"] = o.KekKeyId + toSerialize["kekKeyVersion"] = o.KekKeyVersion + toSerialize["kekKeyringId"] = o.KekKeyringId + if !IsNil(o.KekProjectId) { + toSerialize["kekProjectId"] = o.KekProjectId + } + if !IsNil(o.KeyPayload) { + toSerialize["keyPayload"] = o.KeyPayload + } + toSerialize["serviceAccount"] = o.ServiceAccount + return toSerialize, nil +} + +func (o *VolumeEncryptionParameter) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "kekKeyId", + "kekKeyVersion", + "kekKeyringId", + "serviceAccount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeEncryptionParameter := _VolumeEncryptionParameter{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeEncryptionParameter) + + if err != nil { + return err + } + + *o = VolumeEncryptionParameter(varVolumeEncryptionParameter) + + return err +} + +type NullableVolumeEncryptionParameter struct { + value *VolumeEncryptionParameter + isSet bool +} + +func (v NullableVolumeEncryptionParameter) Get() *VolumeEncryptionParameter { + return v.value +} + +func (v *NullableVolumeEncryptionParameter) Set(val *VolumeEncryptionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeEncryptionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeEncryptionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeEncryptionParameter(val *VolumeEncryptionParameter) *NullableVolumeEncryptionParameter { + return &NullableVolumeEncryptionParameter{value: val, isSet: true} +} + +func (v NullableVolumeEncryptionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeEncryptionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_volume_list_response.go b/services/iaas/v2api/model_volume_list_response.go new file mode 100644 index 000000000..f0fc336e1 --- /dev/null +++ b/services/iaas/v2api/model_volume_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeListResponse{} + +// VolumeListResponse Volume list response. +type VolumeListResponse struct { + // A list containing volume objects. + Items []Volume `json:"items"` +} + +type _VolumeListResponse VolumeListResponse + +// NewVolumeListResponse instantiates a new VolumeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeListResponse(items []Volume) *VolumeListResponse { + this := VolumeListResponse{} + this.Items = items + return &this +} + +// NewVolumeListResponseWithDefaults instantiates a new VolumeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeListResponseWithDefaults() *VolumeListResponse { + this := VolumeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumeListResponse) GetItems() []Volume { + if o == nil { + var ret []Volume + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumeListResponse) GetItemsOk() ([]Volume, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumeListResponse) SetItems(v []Volume) { + o.Items = v +} + +func (o VolumeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeListResponse := _VolumeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeListResponse) + + if err != nil { + return err + } + + *o = VolumeListResponse(varVolumeListResponse) + + return err +} + +type NullableVolumeListResponse struct { + value *VolumeListResponse + isSet bool +} + +func (v NullableVolumeListResponse) Get() *VolumeListResponse { + return v.value +} + +func (v *NullableVolumeListResponse) Set(val *VolumeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeListResponse(val *VolumeListResponse) *NullableVolumeListResponse { + return &NullableVolumeListResponse{value: val, isSet: true} +} + +func (v NullableVolumeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_volume_performance_class.go b/services/iaas/v2api/model_volume_performance_class.go new file mode 100644 index 000000000..1ca8f29f8 --- /dev/null +++ b/services/iaas/v2api/model_volume_performance_class.go @@ -0,0 +1,306 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumePerformanceClass type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumePerformanceClass{} + +// VolumePerformanceClass Object that represents a Volume performance class. +type VolumePerformanceClass struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Input/Output Operations per second. + Iops *int64 `json:"iops,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Throughput in Megabyte per second. + Throughput *int64 `json:"throughput,omitempty"` +} + +type _VolumePerformanceClass VolumePerformanceClass + +// NewVolumePerformanceClass instantiates a new VolumePerformanceClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumePerformanceClass(name string) *VolumePerformanceClass { + this := VolumePerformanceClass{} + this.Name = name + return &this +} + +// NewVolumePerformanceClassWithDefaults instantiates a new VolumePerformanceClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumePerformanceClassWithDefaults() *VolumePerformanceClass { + this := VolumePerformanceClass{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VolumePerformanceClass) SetDescription(v string) { + o.Description = &v +} + +// GetIops returns the Iops field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetIops() int64 { + if o == nil || IsNil(o.Iops) { + var ret int64 + return ret + } + return *o.Iops +} + +// GetIopsOk returns a tuple with the Iops field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetIopsOk() (*int64, bool) { + if o == nil || IsNil(o.Iops) { + return nil, false + } + return o.Iops, true +} + +// HasIops returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasIops() bool { + if o != nil && !IsNil(o.Iops) { + return true + } + + return false +} + +// SetIops gets a reference to the given int64 and assigns it to the Iops field. +func (o *VolumePerformanceClass) SetIops(v int64) { + o.Iops = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *VolumePerformanceClass) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *VolumePerformanceClass) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VolumePerformanceClass) SetName(v string) { + o.Name = v +} + +// GetThroughput returns the Throughput field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetThroughput() int64 { + if o == nil || IsNil(o.Throughput) { + var ret int64 + return ret + } + return *o.Throughput +} + +// GetThroughputOk returns a tuple with the Throughput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetThroughputOk() (*int64, bool) { + if o == nil || IsNil(o.Throughput) { + return nil, false + } + return o.Throughput, true +} + +// HasThroughput returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasThroughput() bool { + if o != nil && !IsNil(o.Throughput) { + return true + } + + return false +} + +// SetThroughput gets a reference to the given int64 and assigns it to the Throughput field. +func (o *VolumePerformanceClass) SetThroughput(v int64) { + o.Throughput = &v +} + +func (o VolumePerformanceClass) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumePerformanceClass) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Iops) { + toSerialize["iops"] = o.Iops + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Throughput) { + toSerialize["throughput"] = o.Throughput + } + return toSerialize, nil +} + +func (o *VolumePerformanceClass) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumePerformanceClass := _VolumePerformanceClass{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumePerformanceClass) + + if err != nil { + return err + } + + *o = VolumePerformanceClass(varVolumePerformanceClass) + + return err +} + +type NullableVolumePerformanceClass struct { + value *VolumePerformanceClass + isSet bool +} + +func (v NullableVolumePerformanceClass) Get() *VolumePerformanceClass { + return v.value +} + +func (v *NullableVolumePerformanceClass) Set(val *VolumePerformanceClass) { + v.value = val + v.isSet = true +} + +func (v NullableVolumePerformanceClass) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumePerformanceClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumePerformanceClass(val *VolumePerformanceClass) *NullableVolumePerformanceClass { + return &NullableVolumePerformanceClass{value: val, isSet: true} +} + +func (v NullableVolumePerformanceClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumePerformanceClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_volume_performance_class_list_response.go b/services/iaas/v2api/model_volume_performance_class_list_response.go new file mode 100644 index 000000000..a23ac53c0 --- /dev/null +++ b/services/iaas/v2api/model_volume_performance_class_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumePerformanceClassListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumePerformanceClassListResponse{} + +// VolumePerformanceClassListResponse Volume performance class list response. +type VolumePerformanceClassListResponse struct { + // A list containing Volume performance classes. + Items []VolumePerformanceClass `json:"items"` +} + +type _VolumePerformanceClassListResponse VolumePerformanceClassListResponse + +// NewVolumePerformanceClassListResponse instantiates a new VolumePerformanceClassListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumePerformanceClassListResponse(items []VolumePerformanceClass) *VolumePerformanceClassListResponse { + this := VolumePerformanceClassListResponse{} + this.Items = items + return &this +} + +// NewVolumePerformanceClassListResponseWithDefaults instantiates a new VolumePerformanceClassListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumePerformanceClassListResponseWithDefaults() *VolumePerformanceClassListResponse { + this := VolumePerformanceClassListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumePerformanceClassListResponse) GetItems() []VolumePerformanceClass { + if o == nil { + var ret []VolumePerformanceClass + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClassListResponse) GetItemsOk() ([]VolumePerformanceClass, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumePerformanceClassListResponse) SetItems(v []VolumePerformanceClass) { + o.Items = v +} + +func (o VolumePerformanceClassListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumePerformanceClassListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumePerformanceClassListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumePerformanceClassListResponse := _VolumePerformanceClassListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumePerformanceClassListResponse) + + if err != nil { + return err + } + + *o = VolumePerformanceClassListResponse(varVolumePerformanceClassListResponse) + + return err +} + +type NullableVolumePerformanceClassListResponse struct { + value *VolumePerformanceClassListResponse + isSet bool +} + +func (v NullableVolumePerformanceClassListResponse) Get() *VolumePerformanceClassListResponse { + return v.value +} + +func (v *NullableVolumePerformanceClassListResponse) Set(val *VolumePerformanceClassListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumePerformanceClassListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumePerformanceClassListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumePerformanceClassListResponse(val *VolumePerformanceClassListResponse) *NullableVolumePerformanceClassListResponse { + return &NullableVolumePerformanceClassListResponse{value: val, isSet: true} +} + +func (v NullableVolumePerformanceClassListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumePerformanceClassListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/model_volume_source.go b/services/iaas/v2api/model_volume_source.go new file mode 100644 index 000000000..b72e6e90e --- /dev/null +++ b/services/iaas/v2api/model_volume_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeSource{} + +// VolumeSource The source object of a volume. +type VolumeSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a volume. Possible values: `image`, `volume`, `snapshot`, `backup`. + Type string `json:"type"` +} + +type _VolumeSource VolumeSource + +// NewVolumeSource instantiates a new VolumeSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeSource(id string, types string) *VolumeSource { + this := VolumeSource{} + this.Id = id + this.Type = types + return &this +} + +// NewVolumeSourceWithDefaults instantiates a new VolumeSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeSourceWithDefaults() *VolumeSource { + this := VolumeSource{} + return &this +} + +// GetId returns the Id field value +func (o *VolumeSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VolumeSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VolumeSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *VolumeSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *VolumeSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *VolumeSource) SetType(v string) { + o.Type = v +} + +func (o VolumeSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *VolumeSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeSource := _VolumeSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeSource) + + if err != nil { + return err + } + + *o = VolumeSource(varVolumeSource) + + return err +} + +type NullableVolumeSource struct { + value *VolumeSource + isSet bool +} + +func (v NullableVolumeSource) Get() *VolumeSource { + return v.value +} + +func (v *NullableVolumeSource) Set(val *VolumeSource) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeSource) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeSource(val *VolumeSource) *NullableVolumeSource { + return &NullableVolumeSource{value: val, isSet: true} +} + +func (v NullableVolumeSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2api/response.go b/services/iaas/v2api/response.go new file mode 100644 index 000000000..fc619ee10 --- /dev/null +++ b/services/iaas/v2api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/iaas/v2api/utils.go b/services/iaas/v2api/utils.go new file mode 100644 index 000000000..09132678f --- /dev/null +++ b/services/iaas/v2api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/iaas/v2beta1api/api_default.go b/services/iaas/v2beta1api/api_default.go new file mode 100644 index 000000000..bd56cbb07 --- /dev/null +++ b/services/iaas/v2beta1api/api_default.go @@ -0,0 +1,29068 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2beta1api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + AddNetworkToServer Create and attach a network interface from the specified network. + + Create and attach a network interface from the specified network to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiAddNetworkToServerRequest + */ + AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest + + // AddNetworkToServerExecute executes the request + AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error + + /* + AddNicToServer Attach an existing network interface. + + Attach an existing network interface to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiAddNicToServerRequest + */ + AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest + + // AddNicToServerExecute executes the request + AddNicToServerExecute(r ApiAddNicToServerRequest) error + + /* + AddPublicIpToServer Associate a public IP to the server. + + Associate a public IP to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiAddPublicIpToServerRequest + */ + AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest + + // AddPublicIpToServerExecute executes the request + AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error + + /* + AddRoutesToRoutingTable Create new routes in a routing table. + + Create new routes in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiAddRoutesToRoutingTableRequest + */ + AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest + + // AddRoutesToRoutingTableExecute executes the request + // @return RouteListResponse + AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) + + /* + AddRoutingTableToArea Create new routing table in a network area. + + Create a new routing table in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiAddRoutingTableToAreaRequest + */ + AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest + + // AddRoutingTableToAreaExecute executes the request + // @return RoutingTable + AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) + + /* + AddSecurityGroupToServer Add a server to a security group. + + Add an existing server to an existing security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiAddSecurityGroupToServerRequest + */ + AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest + + // AddSecurityGroupToServerExecute executes the request + AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error + + /* + AddServiceAccountToServer Attach service account to a server. + + Attach an additional service account to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiAddServiceAccountToServerRequest + */ + AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest + + // AddServiceAccountToServerExecute executes the request + // @return ServiceAccountMailListResponse + AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) + + /* + AddVolumeToServer Attach a volume to a server. + + Attach an existing volume to an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiAddVolumeToServerRequest + */ + AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest + + // AddVolumeToServerExecute executes the request + // @return VolumeAttachment + AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) + + /* + CreateAffinityGroup Create a new affinity group in a project. + + Create a new server affinity group in the given project ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateAffinityGroupRequest + */ + CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest + + // CreateAffinityGroupExecute executes the request + // @return AffinityGroup + CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) + + /* + CreateBackup Create new Backup. + + Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return Backup + CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) + + /* + CreateImage Create new Image. + + Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateImageRequest + */ + CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest + + // CreateImageExecute executes the request + // @return ImageCreateResponse + CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) + + /* + CreateIsolatedNetwork Create a single isolated network. + + Creates an isolated network which is not connected to other networks in this project. We recommend using this endpoint only if you are fully aware of its purpose and the consequences of its execution. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateIsolatedNetworkRequest + */ + CreateIsolatedNetwork(ctx context.Context, projectId string, region string) ApiCreateIsolatedNetworkRequest + + // CreateIsolatedNetworkExecute executes the request + // @return Network + CreateIsolatedNetworkExecute(r ApiCreateIsolatedNetworkRequest) (*Network, error) + + /* + CreateKeyPair Import a public key. + + Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateKeyPairRequest + */ + CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest + + // CreateKeyPairExecute executes the request + // @return Keypair + CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) + + /* + CreateNetwork Create new network. + + Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest + */ + CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest + + // CreateNetworkExecute executes the request + // @return Network + CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) + + /* + CreateNetworkArea Create new network area in an organization. + + Create a new network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiCreateNetworkAreaRequest + */ + CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest + + // CreateNetworkAreaExecute executes the request + // @return NetworkArea + CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) + + /* + CreateNetworkAreaRange Create new network range in a network area. + + Create a new network range in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRangeRequest + */ + CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest + + // CreateNetworkAreaRangeExecute executes the request + // @return NetworkRangeListResponse + CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) + + /* + CreateNetworkAreaRoute Create new network routes. + + Create one or several new network routes in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRouteRequest + */ + CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest + + // CreateNetworkAreaRouteExecute executes the request + // @return RouteListResponse + CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) + + /* + CreateNic Create new network interface. + + Create a new network interface in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiCreateNicRequest + */ + CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest + + // CreateNicExecute executes the request + // @return NIC + CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) + + /* + CreatePublicIP Create new public IP. + + Create a new public IP in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreatePublicIPRequest + */ + CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest + + // CreatePublicIPExecute executes the request + // @return PublicIp + CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) + + /* + CreateSecurityGroup Create new security group. + + Create a new security group in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateSecurityGroupRequest + */ + CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest + + // CreateSecurityGroupExecute executes the request + // @return SecurityGroup + CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) + + /* + CreateSecurityGroupRule Create new security group rule. + + Create a new security group rule in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiCreateSecurityGroupRuleRequest + */ + CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest + + // CreateSecurityGroupRuleExecute executes the request + // @return SecurityGroupRule + CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) + + /* + CreateServer Create new server. + + Create a new server in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateServerRequest + */ + CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest + + // CreateServerExecute executes the request + // @return Server + CreateServerExecute(r ApiCreateServerRequest) (*Server, error) + + /* + CreateVolume Create new volume. + + Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateVolumeRequest + */ + CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest + + // CreateVolumeExecute executes the request + // @return Volume + CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) + + /* + DeallocateServer Deallocate an existing server. + + Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest + */ + DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest + + // DeallocateServerExecute executes the request + DeallocateServerExecute(r ApiDeallocateServerRequest) error + + /* + DeleteAffinityGroup Delete a affinity group in a project. + + Delete a affinity group in the given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiDeleteAffinityGroupRequest + */ + DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest + + // DeleteAffinityGroupExecute executes the request + DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error + + /* + DeleteBackup Delete a backup. + + Delete a backup that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiDeleteBackupRequest + */ + DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest + + // DeleteBackupExecute executes the request + DeleteBackupExecute(r ApiDeleteBackupRequest) error + + /* + DeleteImage Delete an Image. + + Delete an image that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageRequest + */ + DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest + + // DeleteImageExecute executes the request + DeleteImageExecute(r ApiDeleteImageRequest) error + + /* + DeleteImageShare Remove image share. + + Remove the image share. New scope will be local. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest + */ + DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest + + // DeleteImageShareExecute executes the request + DeleteImageShareExecute(r ApiDeleteImageShareRequest) error + + /* + DeleteImageShareConsumer Remove an image share consumer. + + Remove consumer from a shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiDeleteImageShareConsumerRequest + */ + DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest + + // DeleteImageShareConsumerExecute executes the request + DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error + + /* + DeleteKeyPair Delete an SSH keypair. + + Delete an SSH keypair from a user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest + */ + DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest + + // DeleteKeyPairExecute executes the request + DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error + + /* + DeleteNetwork Delete network. + + Delete a network. If the network is still in use, the deletion will fail. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest + */ + DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest + + // DeleteNetworkExecute executes the request + DeleteNetworkExecute(r ApiDeleteNetworkRequest) error + + /* + DeleteNetworkArea Delete a network area. + + Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiDeleteNetworkAreaRequest + */ + DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest + + // DeleteNetworkAreaExecute executes the request + DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error + + /* + DeleteNetworkAreaRange Delete a network range. + + Delete a network range of a network area. The deletion will fail if the network range is still used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiDeleteNetworkAreaRangeRequest + */ + DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest + + // DeleteNetworkAreaRangeExecute executes the request + DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error + + /* + DeleteNetworkAreaRoute Delete a network route. + + Delete a network route of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteNetworkAreaRouteRequest + */ + DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest + + // DeleteNetworkAreaRouteExecute executes the request + DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error + + /* + DeleteNic Delete a network interface. + + Delete a network interface that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest + */ + DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest + + // DeleteNicExecute executes the request + DeleteNicExecute(r ApiDeleteNicRequest) error + + /* + DeletePublicIP Delete a public IP. + + Delete a public IP that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest + */ + DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest + + // DeletePublicIPExecute executes the request + DeletePublicIPExecute(r ApiDeletePublicIPRequest) error + + /* + DeleteRouteFromRoutingTable Delete a route in a routing table. + + Delete a route in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest + */ + DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest + + // DeleteRouteFromRoutingTableExecute executes the request + DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error + + /* + DeleteRoutingTableFromArea Delete a routing table. + + Delete a routing table of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest + */ + DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest + + // DeleteRoutingTableFromAreaExecute executes the request + DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error + + /* + DeleteSecurityGroup Delete security group. + + Delete a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest + */ + DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest + + // DeleteSecurityGroupExecute executes the request + DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error + + /* + DeleteSecurityGroupRule Delete security group rule. + + Delete a security group rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest + */ + DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest + + // DeleteSecurityGroupRuleExecute executes the request + DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error + + /* + DeleteServer Delete a server. + + Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest + */ + DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest + + // DeleteServerExecute executes the request + DeleteServerExecute(r ApiDeleteServerRequest) error + + /* + DeleteVolume Delete a volume. + + Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest + */ + DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest + + // DeleteVolumeExecute executes the request + DeleteVolumeExecute(r ApiDeleteVolumeRequest) error + + /* + GetAffinityGroup Get the affinity group. + + Get the affinity group created in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiGetAffinityGroupRequest + */ + GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest + + // GetAffinityGroupExecute executes the request + // @return AffinityGroup + GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) + + /* + GetAttachedVolume Get Volume Attachment details. + + Get the details of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest + */ + GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest + + // GetAttachedVolumeExecute executes the request + // @return VolumeAttachment + GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) + + /* + GetBackup Get details about a backup. + + Get details about a block device backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiGetBackupRequest + */ + GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return Backup + GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) + + /* + GetImage Get details about an image. + + Get details about a specific Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageRequest + */ + GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest + + // GetImageExecute executes the request + // @return Image + GetImageExecute(r ApiGetImageRequest) (*Image, error) + + /* + GetImageShare Get share details of an image. + + Get share details about an shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest + */ + GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest + + // GetImageShareExecute executes the request + // @return ImageShare + GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) + + /* + GetImageShareConsumer Get image share consumer. + + Get details about an image share consumer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest + */ + GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest + + // GetImageShareConsumerExecute executes the request + // @return ImageShareConsumer + GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) + + /* + GetKeyPair Get SSH keypair details. + + Get details about an SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiGetKeyPairRequest + */ + GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest + + // GetKeyPairExecute executes the request + // @return Keypair + GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) + + /* + GetMachineType Get details about a machine type. + + Get details about a specific machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param machineType STACKIT machine type Name. + @return ApiGetMachineTypeRequest + */ + GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest + + // GetMachineTypeExecute executes the request + // @return MachineType + GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) + + /* + GetNetwork Get network details. + + Get details about a network of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest + */ + GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest + + // GetNetworkExecute executes the request + // @return Network + GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) + + /* + GetNetworkArea Get details about a network area. + + Get details about a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest + */ + GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest + + // GetNetworkAreaExecute executes the request + // @return NetworkArea + GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) + + /* + GetNetworkAreaRange Get details about a network range. + + Get details about a network range in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiGetNetworkAreaRangeRequest + */ + GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest + + // GetNetworkAreaRangeExecute executes the request + // @return NetworkRange + GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) + + /* + GetNetworkAreaRoute Get details about a network route. + + Get details about a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetNetworkAreaRouteRequest + */ + GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest + + // GetNetworkAreaRouteExecute executes the request + // @return Route + GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) + + /* + GetNic Get details about a network interface. + + Get details about a network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiGetNicRequest + */ + GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest + + // GetNicExecute executes the request + // @return NIC + GetNicExecute(r ApiGetNicRequest) (*NIC, error) + + /* + GetOrganizationRequest Lookup an organization request ID. + + Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest + */ + GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest + + // GetOrganizationRequestExecute executes the request + // @return Request + GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) + + /* + GetProjectDetails Get project details. + + Get details about a STACKIT project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiGetProjectDetailsRequest + */ + GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest + + // GetProjectDetailsExecute executes the request + // @return Project + GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) + + /* + GetProjectNIC Get details about a network interface of a project. + + Get details about a network interface inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param nicId The identifier (ID) of a network interface. + @return ApiGetProjectNICRequest + */ + GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest + + // GetProjectNICExecute executes the request + // @return NIC + GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) + + /* + GetProjectRequest Lookup a project request ID. + + Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest + */ + GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest + + // GetProjectRequestExecute executes the request + // @return Request + GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) + + /* + GetPublicIP Get details about a public IP. + + Get details about a public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest + */ + GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest + + // GetPublicIPExecute executes the request + // @return PublicIp + GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) + + /* + GetRouteOfRoutingTable Get details about a route of a routing table. + + Get details about a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetRouteOfRoutingTableRequest + */ + GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest + + // GetRouteOfRoutingTableExecute executes the request + // @return Route + GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) + + /* + GetRoutingTableOfArea Get details about a routing table. + + Get details about a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiGetRoutingTableOfAreaRequest + */ + GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest + + // GetRoutingTableOfAreaExecute executes the request + // @return RoutingTable + GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) + + /* + GetSecurityGroup Get security group details. + + Get details about a security group of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest + */ + GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest + + // GetSecurityGroupExecute executes the request + // @return SecurityGroup + GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) + + /* + GetSecurityGroupRule Get security group rule details. + + Get details about a security group rule of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest + */ + GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest + + // GetSecurityGroupRuleExecute executes the request + // @return SecurityGroupRule + GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) + + /* + GetServer Get server details. + + Get details about a server by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest + */ + GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest + + // GetServerExecute executes the request + // @return Server + GetServerExecute(r ApiGetServerRequest) (*Server, error) + + /* + GetServerConsole Get server console. + + Get a URL for server remote console. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest + */ + GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest + + // GetServerConsoleExecute executes the request + // @return ServerConsoleUrl + GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) + + /* + GetServerLog Get server log. + + Get server console log. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerLogRequest + */ + GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest + + // GetServerLogExecute executes the request + // @return GetServerLog200Response + GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) + + /* + GetVolume Get details about a volume. + + Get details about a block device volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest + */ + GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest + + // GetVolumeExecute executes the request + // @return Volume + GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) + + /* + GetVolumePerformanceClass Get details about a volume performance class. + + Get details about a specific volume performance class. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest + */ + GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest + + // GetVolumePerformanceClassExecute executes the request + // @return VolumePerformanceClass + GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) + + /* + ListAffinityGroups Get the affinity groups setup for a project. + + Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListAffinityGroupsRequest + */ + ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest + + // ListAffinityGroupsExecute executes the request + // @return AffinityGroupListResponse + ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) + + /* + ListAttachedVolumes List all volume attachments of a server. + + Get a list of all volume attachments of a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest + */ + ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest + + // ListAttachedVolumesExecute executes the request + // @return VolumeAttachmentListResponse + ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) + + /* + ListAvailabilityZones List all availability zones. + + Get a list of all availability zones. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region The STACKIT Region of the resources. + @return ApiListAvailabilityZonesRequest + */ + ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest + + // ListAvailabilityZonesExecute executes the request + // @return AvailabilityZoneListResponse + ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) + + /* + ListBackups List all backups inside a project. + + Get a list of all backups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return BackupListResponse + ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) + + /* + ListImages List all Images inside a project. + + Get a list of all images inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListImagesRequest + */ + ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest + + // ListImagesExecute executes the request + // @return ImageListResponse + ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) + + /* + ListKeyPairs List all SSH keypairs for the requesting user. + + Get a list of all SSH keypairs assigned to the requesting user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListKeyPairsRequest + */ + ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest + + // ListKeyPairsExecute executes the request + // @return KeyPairListResponse + ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) + + /* + ListMachineTypes List all machine types available for a project. + + Get a list of all machine type available in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListMachineTypesRequest + */ + ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest + + // ListMachineTypesExecute executes the request + // @return MachineTypeListResponse + ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) + + /* + ListNetworkAreaProjects List all projects using a network area. + + Get a list of all projects using a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest + */ + ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest + + // ListNetworkAreaProjectsExecute executes the request + // @return ProjectListResponse + ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) + + /* + ListNetworkAreaRanges List all network ranges in a network area. + + Get a list of all network ranges in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRangesRequest + */ + ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest + + // ListNetworkAreaRangesExecute executes the request + // @return NetworkRangeListResponse + ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) + + /* + ListNetworkAreaRoutes List all network routes in a network area. + + Get a list of all network routes defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRoutesRequest + */ + ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest + + // ListNetworkAreaRoutesExecute executes the request + // @return RouteListResponse + ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) + + /* + ListNetworkAreas List all network areas in an organization. + + Get a list of all visible network areas defined in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiListNetworkAreasRequest + */ + ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest + + // ListNetworkAreasExecute executes the request + // @return NetworkAreaListResponse + ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) + + /* + ListNetworks List all networks inside a project. + + Get a list of all networks inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest + */ + ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest + + // ListNetworksExecute executes the request + // @return NetworkListResponse + ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) + + /* + ListNics List all network interfaces inside a network. + + Get a list of all network interfaces inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListNicsRequest + */ + ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest + + // ListNicsExecute executes the request + // @return NICListResponse + ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) + + /* + ListProjectNICs List all network interfaces inside a project. + + Get a list of all network interfaces inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListProjectNICsRequest + */ + ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest + + // ListProjectNICsExecute executes the request + // @return NICListResponse + ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) + + /* + ListPublicIPRanges List all public IP ranges. + + Get a list of all public IP ranges that STACKIT uses. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPublicIPRangesRequest + */ + ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest + + // ListPublicIPRangesExecute executes the request + // @return PublicNetworkListResponse + ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) + + /* + ListPublicIPs List all public IPs inside a project. + + Get a list of all public IPs inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListPublicIPsRequest + */ + ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest + + // ListPublicIPsExecute executes the request + // @return PublicIpListResponse + ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) + + /* + ListQuotas List project quotas. + + List quota limits and usage for project resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListQuotasRequest + */ + ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest + + // ListQuotasExecute executes the request + // @return QuotaListResponse + ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) + + /* + ListRoutesOfRoutingTable List all routes in a routing table. + + Get a list of all routes in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest + */ + ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest + + // ListRoutesOfRoutingTableExecute executes the request + // @return RouteListResponse + ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) + + /* + ListRoutingTablesOfArea List all routing tables in a network area. + + Get a list of all routing tables in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest + */ + ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest + + // ListRoutingTablesOfAreaExecute executes the request + // @return RoutingTableListResponse + ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) + + /* + ListSecurityGroupRules List all rules for a security group. + + Get a list of all rules inside a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiListSecurityGroupRulesRequest + */ + ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest + + // ListSecurityGroupRulesExecute executes the request + // @return SecurityGroupRuleListResponse + ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) + + /* + ListSecurityGroups List all security groups inside a project. + + Get a list of all security groups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListSecurityGroupsRequest + */ + ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest + + // ListSecurityGroupsExecute executes the request + // @return SecurityGroupListResponse + ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) + + /* + ListServerNICs Get all network interfaces. + + Get all network interfaces attached to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerNICsRequest + */ + ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest + + // ListServerNICsExecute executes the request + // @return NICListResponse + ListServerNICsExecute(r ApiListServerNICsRequest) (*NICListResponse, error) + + /* + ListServerServiceAccounts List all service accounts of the Server. + + Get the list of the service accounts of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerServiceAccountsRequest + */ + ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest + + // ListServerServiceAccountsExecute executes the request + // @return ServiceAccountMailListResponse + ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) + + /* + ListServers List all servers inside a project. + + Get a list of all servers inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListServersRequest + */ + ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest + + // ListServersExecute executes the request + // @return ServerListResponse + ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) + + /* + ListVolumePerformanceClasses List all volume performance classes available for a project. + + Get a list of all volume performance classes available inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListVolumePerformanceClassesRequest + */ + ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest + + // ListVolumePerformanceClassesExecute executes the request + // @return VolumePerformanceClassListResponse + ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) + + /* + ListVolumes List all volumes inside a project. + + Get a list of all volumes inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListVolumesRequest + */ + ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest + + // ListVolumesExecute executes the request + // @return VolumeListResponse + ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) + + /* + PartialUpdateNetwork Update network settings. + + Update the settings of a network inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest + */ + PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest + + // PartialUpdateNetworkExecute executes the request + PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error + + /* + PartialUpdateNetworkArea Update network area settings. + + Update the settings of a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiPartialUpdateNetworkAreaRequest + */ + PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest + + // PartialUpdateNetworkAreaExecute executes the request + // @return NetworkArea + PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) + + /* + RebootServer Reboot the server. + + Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRebootServerRequest + */ + RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest + + // RebootServerExecute executes the request + RebootServerExecute(r ApiRebootServerRequest) error + + /* + RemoveNetworkFromServer Detach and delete all network interfaces associated with the specified network. + + Detach and delete all network interfaces associated with the specified network from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiRemoveNetworkFromServerRequest + */ + RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest + + // RemoveNetworkFromServerExecute executes the request + RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error + + /* + RemoveNicFromServer Detach a network interface. + + Detach a network interface from a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiRemoveNicFromServerRequest + */ + RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest + + // RemoveNicFromServerExecute executes the request + RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error + + /* + RemovePublicIpFromServer Dissociate a public IP from a server. + + Dissociate a public IP on an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiRemovePublicIpFromServerRequest + */ + RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest + + // RemovePublicIpFromServerExecute executes the request + RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error + + /* + RemoveSecurityGroupFromServer Remove a server from a security group. + + Remove a server from a attached security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiRemoveSecurityGroupFromServerRequest + */ + RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest + + // RemoveSecurityGroupFromServerExecute executes the request + RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error + + /* + RemoveServiceAccountFromServer Detach a service account from a server. + + Detach an additional service account from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiRemoveServiceAccountFromServerRequest + */ + RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest + + // RemoveServiceAccountFromServerExecute executes the request + // @return ServiceAccountMailListResponse + RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) + + /* + RemoveVolumeFromServer Detach a volume from a server. + + Detach an existing volume from an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiRemoveVolumeFromServerRequest + */ + RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest + + // RemoveVolumeFromServerExecute executes the request + RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error + + /* + RescueServer Rescue an existing server. + + Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRescueServerRequest + */ + RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest + + // RescueServerExecute executes the request + RescueServerExecute(r ApiRescueServerRequest) error + + /* + ResizeServer Resize a server. + + Resize the server to the given machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiResizeServerRequest + */ + ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest + + // ResizeServerExecute executes the request + ResizeServerExecute(r ApiResizeServerRequest) error + + /* + ResizeVolume Update the size of a volume. + + Update the size of a block device volume. The new volume size must be larger than the current size. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiResizeVolumeRequest + */ + ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest + + // ResizeVolumeExecute executes the request + ResizeVolumeExecute(r ApiResizeVolumeRequest) error + + /* + RestoreBackup Restore Backup to the referenced source Volume. + + Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiRestoreBackupRequest + */ + RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest + + // RestoreBackupExecute executes the request + RestoreBackupExecute(r ApiRestoreBackupRequest) error + + /* + SetImageShare Set image share. + + Set share of an Image. New Options will replace existing settings. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiSetImageShareRequest + */ + SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest + + // SetImageShareExecute executes the request + // @return ImageShare + SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) + + /* + StartServer Boot up a server. + + Start an existing server or allocates the server if deallocated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStartServerRequest + */ + StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest + + // StartServerExecute executes the request + StartServerExecute(r ApiStartServerRequest) error + + /* + StopServer Stop an existing server. + + Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStopServerRequest + */ + StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest + + // StopServerExecute executes the request + StopServerExecute(r ApiStopServerRequest) error + + /* + UnrescueServer Unrescue an existing server. + + Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUnrescueServerRequest + */ + UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest + + // UnrescueServerExecute executes the request + UnrescueServerExecute(r ApiUnrescueServerRequest) error + + /* + UpdateAttachedVolume Update Volume Attachment Parameters. + + Update the properties of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateAttachedVolumeRequest + */ + UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest + + // UpdateAttachedVolumeExecute executes the request + // @return VolumeAttachment + UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) + + /* + UpdateImage Update Image Parameters. + + Update the properties of an existing Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageRequest + */ + UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest + + // UpdateImageExecute executes the request + // @return Image + UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) + + /* + UpdateImageShare Update image share. + + Update share of an Image. Projects will be appended to existing list. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageShareRequest + */ + UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest + + // UpdateImageShareExecute executes the request + // @return ImageShare + UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) + + /* + UpdateKeyPair Update information of an SSH keypair. + + Update labels of the SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiUpdateKeyPairRequest + */ + UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest + + // UpdateKeyPairExecute executes the request + // @return Keypair + UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) + + /* + UpdateNic Update a network interface. + + Update the properties of an existing network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiUpdateNicRequest + */ + UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest + + // UpdateNicExecute executes the request + // @return NIC + UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) + + /* + UpdatePublicIP Update a public IP. + + Update the properties of an existing public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiUpdatePublicIPRequest + */ + UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest + + // UpdatePublicIPExecute executes the request + // @return PublicIp + UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) + + /* + UpdateRouteOfRoutingTable Update a route of a routing table. + + Update a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest + */ + UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest + + // UpdateRouteOfRoutingTableExecute executes the request + // @return Route + UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) + + /* + UpdateRoutingTableOfArea Update a routing table. + + Update a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest + */ + UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest + + // UpdateRoutingTableOfAreaExecute executes the request + // @return RoutingTable + UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) + + /* + UpdateServer Update information of a server. + + Update name or labels of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUpdateServerRequest + */ + UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest + + // UpdateServerExecute executes the request + // @return Server + UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) + + /* + UpdateVolume Update information of a volume. + + Update name, description or labels of the volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateVolumeRequest + */ + UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest + + // UpdateVolumeExecute executes the request + // @return Volume + UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) + + /* + V2beta1ConfigureNetworkAreaRegion Configure a region for a network area. + + Configure a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiV2beta1ConfigureNetworkAreaRegionRequest + */ + V2beta1ConfigureNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1ConfigureNetworkAreaRegionRequest + + // V2beta1ConfigureNetworkAreaRegionExecute executes the request + // @return RegionalArea + V2beta1ConfigureNetworkAreaRegionExecute(r ApiV2beta1ConfigureNetworkAreaRegionRequest) (*RegionalArea, error) + + /* + V2beta1CreateSnapshot Create new Snapshot. + + Create a new Snapshot from a Volume in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiV2beta1CreateSnapshotRequest + */ + V2beta1CreateSnapshot(ctx context.Context, projectId string, region string) ApiV2beta1CreateSnapshotRequest + + // V2beta1CreateSnapshotExecute executes the request + // @return Snapshot + V2beta1CreateSnapshotExecute(r ApiV2beta1CreateSnapshotRequest) (*Snapshot, error) + + /* + V2beta1DeleteNetworkAreaRegion Delete a configuration of region for a network area. + + Delete a current configuration of region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiV2beta1DeleteNetworkAreaRegionRequest + */ + V2beta1DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1DeleteNetworkAreaRegionRequest + + // V2beta1DeleteNetworkAreaRegionExecute executes the request + V2beta1DeleteNetworkAreaRegionExecute(r ApiV2beta1DeleteNetworkAreaRegionRequest) error + + /* + V2beta1DeleteSnapshot Delete a snapshot. + + Delete a snapshot that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiV2beta1DeleteSnapshotRequest + */ + V2beta1DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1DeleteSnapshotRequest + + // V2beta1DeleteSnapshotExecute executes the request + V2beta1DeleteSnapshotExecute(r ApiV2beta1DeleteSnapshotRequest) error + + /* + V2beta1GetAreaRegion Get details about a configured region. + + Get details about a configured region in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiV2beta1GetAreaRegionRequest + */ + V2beta1GetAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1GetAreaRegionRequest + + // V2beta1GetAreaRegionExecute executes the request + // @return RegionalArea + V2beta1GetAreaRegionExecute(r ApiV2beta1GetAreaRegionRequest) (*RegionalArea, error) + + /* + V2beta1GetSnapshot Get details about a snapshot. + + Get details about a block device snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiV2beta1GetSnapshotRequest + */ + V2beta1GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1GetSnapshotRequest + + // V2beta1GetSnapshotExecute executes the request + // @return Snapshot + V2beta1GetSnapshotExecute(r ApiV2beta1GetSnapshotRequest) (*Snapshot, error) + + /* + V2beta1ListAreaRegions List all configured regions in a network area. + + Get a list of all configured regions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiV2beta1ListAreaRegionsRequest + */ + V2beta1ListAreaRegions(ctx context.Context, organizationId string, areaId string) ApiV2beta1ListAreaRegionsRequest + + // V2beta1ListAreaRegionsExecute executes the request + // @return RegionalAreaListResponse + V2beta1ListAreaRegionsExecute(r ApiV2beta1ListAreaRegionsRequest) (*RegionalAreaListResponse, error) + + /* + V2beta1ListSnapshotsInProject List all snapshots inside a project. + + Get a list of all snapshots inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiV2beta1ListSnapshotsInProjectRequest + */ + V2beta1ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiV2beta1ListSnapshotsInProjectRequest + + // V2beta1ListSnapshotsInProjectExecute executes the request + // @return SnapshotListResponse + V2beta1ListSnapshotsInProjectExecute(r ApiV2beta1ListSnapshotsInProjectRequest) (*SnapshotListResponse, error) + + /* + V2beta1UpdateBackup Update information of a backup. + + Update name or labels of the backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiV2beta1UpdateBackupRequest + */ + V2beta1UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiV2beta1UpdateBackupRequest + + // V2beta1UpdateBackupExecute executes the request + // @return Backup + V2beta1UpdateBackupExecute(r ApiV2beta1UpdateBackupRequest) (*Backup, error) + + /* + V2beta1UpdateNetworkAreaRegion Update a region for a network area. + + Update a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiV2beta1UpdateNetworkAreaRegionRequest + */ + V2beta1UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1UpdateNetworkAreaRegionRequest + + // V2beta1UpdateNetworkAreaRegionExecute executes the request + // @return RegionalArea + V2beta1UpdateNetworkAreaRegionExecute(r ApiV2beta1UpdateNetworkAreaRegionRequest) (*RegionalArea, error) + + /* + V2beta1UpdateRouteOfArea Update a network route. + + Update a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiV2beta1UpdateRouteOfAreaRequest + */ + V2beta1UpdateRouteOfArea(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiV2beta1UpdateRouteOfAreaRequest + + // V2beta1UpdateRouteOfAreaExecute executes the request + // @return Route + V2beta1UpdateRouteOfAreaExecute(r ApiV2beta1UpdateRouteOfAreaRequest) (*Route, error) + + /* + V2beta1UpdateSecurityGroup Update information of a security group. + + Update labels of the security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiV2beta1UpdateSecurityGroupRequest + */ + V2beta1UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiV2beta1UpdateSecurityGroupRequest + + // V2beta1UpdateSecurityGroupExecute executes the request + // @return SecurityGroup + V2beta1UpdateSecurityGroupExecute(r ApiV2beta1UpdateSecurityGroupRequest) (*SecurityGroup, error) + + /* + V2beta1UpdateSnapshot Update information of the snapshot. + + Update information like name or labels of the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiV2beta1UpdateSnapshotRequest + */ + V2beta1UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1UpdateSnapshotRequest + + // V2beta1UpdateSnapshotExecute executes the request + // @return Snapshot + V2beta1UpdateSnapshotExecute(r ApiV2beta1UpdateSnapshotRequest) (*Snapshot, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiAddNetworkToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + networkId string +} + +func (r ApiAddNetworkToServerRequest) Execute() error { + return r.ApiService.AddNetworkToServerExecute(r) +} + +/* +AddNetworkToServer Create and attach a network interface from the specified network. + +Create and attach a network interface from the specified network to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiAddNetworkToServerRequest +*/ +func (a *DefaultAPIService) AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest { + return ApiAddNetworkToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddNetworkToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddNicToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + nicId string +} + +func (r ApiAddNicToServerRequest) Execute() error { + return r.ApiService.AddNicToServerExecute(r) +} + +/* +AddNicToServer Attach an existing network interface. + +Attach an existing network interface to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiAddNicToServerRequest +*/ +func (a *DefaultAPIService) AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest { + return ApiAddNicToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + nicId: nicId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) AddNicToServerExecute(r ApiAddNicToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddNicToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddPublicIpToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + publicIpId string +} + +func (r ApiAddPublicIpToServerRequest) Execute() error { + return r.ApiService.AddPublicIpToServerExecute(r) +} + +/* +AddPublicIpToServer Associate a public IP to the server. + +Associate a public IP to a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiAddPublicIpToServerRequest +*/ +func (a *DefaultAPIService) AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest { + return ApiAddPublicIpToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddPublicIpToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddRoutesToRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + addRoutesToRoutingTablePayload *AddRoutesToRoutingTablePayload +} + +// Request an addition of routes to a routing table. +func (r ApiAddRoutesToRoutingTableRequest) AddRoutesToRoutingTablePayload(addRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload) ApiAddRoutesToRoutingTableRequest { + r.addRoutesToRoutingTablePayload = &addRoutesToRoutingTablePayload + return r +} + +func (r ApiAddRoutesToRoutingTableRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.AddRoutesToRoutingTableExecute(r) +} + +/* +AddRoutesToRoutingTable Create new routes in a routing table. + +Create new routes in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiAddRoutesToRoutingTableRequest +*/ +func (a *DefaultAPIService) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { + return ApiAddRoutesToRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddRoutesToRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if r.addRoutesToRoutingTablePayload == nil { + return localVarReturnValue, reportError("addRoutesToRoutingTablePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addRoutesToRoutingTablePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiAddRoutingTableToAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + addRoutingTableToAreaPayload *AddRoutingTableToAreaPayload +} + +// Request an addition of a routing table to an area. +func (r ApiAddRoutingTableToAreaRequest) AddRoutingTableToAreaPayload(addRoutingTableToAreaPayload AddRoutingTableToAreaPayload) ApiAddRoutingTableToAreaRequest { + r.addRoutingTableToAreaPayload = &addRoutingTableToAreaPayload + return r +} + +func (r ApiAddRoutingTableToAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.AddRoutingTableToAreaExecute(r) +} + +/* +AddRoutingTableToArea Create new routing table in a network area. + +Create a new routing table in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiAddRoutingTableToAreaRequest +*/ +func (a *DefaultAPIService) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { + return ApiAddRoutingTableToAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddRoutingTableToArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.addRoutingTableToAreaPayload == nil { + return localVarReturnValue, reportError("addRoutingTableToAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addRoutingTableToAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiAddSecurityGroupToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + securityGroupId string +} + +func (r ApiAddSecurityGroupToServerRequest) Execute() error { + return r.ApiService.AddSecurityGroupToServerExecute(r) +} + +/* +AddSecurityGroupToServer Add a server to a security group. + +Add an existing server to an existing security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiAddSecurityGroupToServerRequest +*/ +func (a *DefaultAPIService) AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest { + return ApiAddSecurityGroupToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddSecurityGroupToServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiAddServiceAccountToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + serviceAccountMail string +} + +func (r ApiAddServiceAccountToServerRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.AddServiceAccountToServerExecute(r) +} + +/* +AddServiceAccountToServer Attach service account to a server. + +Attach an additional service account to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiAddServiceAccountToServerRequest +*/ +func (a *DefaultAPIService) AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest { + return ApiAddServiceAccountToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +func (a *DefaultAPIService) AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddServiceAccountToServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(parameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, reportError("serviceAccountMail must have less than 255 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiAddVolumeToServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + volumeId string + addVolumeToServerPayload *AddVolumeToServerPayload +} + +// Request a volume attachment creation. +func (r ApiAddVolumeToServerRequest) AddVolumeToServerPayload(addVolumeToServerPayload AddVolumeToServerPayload) ApiAddVolumeToServerRequest { + r.addVolumeToServerPayload = &addVolumeToServerPayload + return r +} + +func (r ApiAddVolumeToServerRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.AddVolumeToServerExecute(r) +} + +/* +AddVolumeToServer Attach a volume to a server. + +Attach an existing volume to an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiAddVolumeToServerRequest +*/ +func (a *DefaultAPIService) AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest { + return ApiAddVolumeToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +func (a *DefaultAPIService) AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.AddVolumeToServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.addVolumeToServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createAffinityGroupPayload *CreateAffinityGroupPayload +} + +// Request a affinity group creation. +func (r ApiCreateAffinityGroupRequest) CreateAffinityGroupPayload(createAffinityGroupPayload CreateAffinityGroupPayload) ApiCreateAffinityGroupRequest { + r.createAffinityGroupPayload = &createAffinityGroupPayload + return r +} + +func (r ApiCreateAffinityGroupRequest) Execute() (*AffinityGroup, error) { + return r.ApiService.CreateAffinityGroupExecute(r) +} + +/* +CreateAffinityGroup Create a new affinity group in a project. + +Create a new server affinity group in the given project ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateAffinityGroupRequest +*/ +func (a *DefaultAPIService) CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest { + return ApiCreateAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return AffinityGroup +func (a *DefaultAPIService) CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateAffinityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/affinity-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createAffinityGroupPayload == nil { + return localVarReturnValue, reportError("createAffinityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAffinityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createBackupPayload *CreateBackupPayload +} + +// Request a backup creation. +func (r ApiCreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { + r.createBackupPayload = &createBackupPayload + return r +} + +func (r ApiCreateBackupRequest) Execute() (*Backup, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup Create new Backup. + +Create a new Backup in a project. If a snapshot ID is provided create the backup from the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Backup +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createBackupPayload == nil { + return localVarReturnValue, reportError("createBackupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createImagePayload *CreateImagePayload +} + +// Request an image creation. +func (r ApiCreateImageRequest) CreateImagePayload(createImagePayload CreateImagePayload) ApiCreateImageRequest { + r.createImagePayload = &createImagePayload + return r +} + +func (r ApiCreateImageRequest) Execute() (*ImageCreateResponse, error) { + return r.ApiService.CreateImageExecute(r) +} + +/* +CreateImage Create new Image. + +Create a new Image in a project. This call, if successful, returns a pre-signed URL for the customer to upload the image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateImageRequest +*/ +func (a *DefaultAPIService) CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest { + return ApiCreateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ImageCreateResponse +func (a *DefaultAPIService) CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageCreateResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createImagePayload == nil { + return localVarReturnValue, reportError("createImagePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createImagePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateIsolatedNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createIsolatedNetworkPayload *CreateIsolatedNetworkPayload +} + +// Request a single isolated network creation. +func (r ApiCreateIsolatedNetworkRequest) CreateIsolatedNetworkPayload(createIsolatedNetworkPayload CreateIsolatedNetworkPayload) ApiCreateIsolatedNetworkRequest { + r.createIsolatedNetworkPayload = &createIsolatedNetworkPayload + return r +} + +func (r ApiCreateIsolatedNetworkRequest) Execute() (*Network, error) { + return r.ApiService.CreateIsolatedNetworkExecute(r) +} + +/* +CreateIsolatedNetwork Create a single isolated network. + +Creates an isolated network which is not connected to other networks in this project. We recommend using this endpoint only if you are fully aware of its purpose and the consequences of its execution. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateIsolatedNetworkRequest +*/ +func (a *DefaultAPIService) CreateIsolatedNetwork(ctx context.Context, projectId string, region string) ApiCreateIsolatedNetworkRequest { + return ApiCreateIsolatedNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Network +func (a *DefaultAPIService) CreateIsolatedNetworkExecute(r ApiCreateIsolatedNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateIsolatedNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/isolated-network" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createIsolatedNetworkPayload == nil { + return localVarReturnValue, reportError("createIsolatedNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createIsolatedNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + createKeyPairPayload *CreateKeyPairPayload +} + +// Request a public key import. +func (r ApiCreateKeyPairRequest) CreateKeyPairPayload(createKeyPairPayload CreateKeyPairPayload) ApiCreateKeyPairRequest { + r.createKeyPairPayload = &createKeyPairPayload + return r +} + +func (r ApiCreateKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.CreateKeyPairExecute(r) +} + +/* +CreateKeyPair Import a public key. + +Import a new public key for the requesting user based on provided public key material. The creation will fail if an SSH keypair with the same name already exists. If a name is not provided it is autogenerated form the ssh-pubkey comment section. If that is also not present it will be the the MD5 fingerprint of the key. For autogenerated names invalid characters will be removed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiCreateKeyPairRequest +*/ +func (a *DefaultAPIService) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return ApiCreateKeyPairRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return Keypair +func (a *DefaultAPIService) CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/keypairs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if r.createKeyPairPayload == nil { + return localVarReturnValue, reportError("createKeyPairPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createKeyPairPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createNetworkPayload *CreateNetworkPayload +} + +// Request a network creation. +func (r ApiCreateNetworkRequest) CreateNetworkPayload(createNetworkPayload CreateNetworkPayload) ApiCreateNetworkRequest { + r.createNetworkPayload = &createNetworkPayload + return r +} + +func (r ApiCreateNetworkRequest) Execute() (*Network, error) { + return r.ApiService.CreateNetworkExecute(r) +} + +/* +CreateNetwork Create new network. + +Create a new network in a project. `nameservers` will be filled from `defaultNameservers` of the respective area if not specified. If the project has `internetAccess` enabled and this is the first network in the project this might incur cost. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkRequest +*/ +func (a *DefaultAPIService) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Network +func (a *DefaultAPIService) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createNetworkPayload == nil { + return localVarReturnValue, reportError("createNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + createNetworkAreaPayload *CreateNetworkAreaPayload +} + +// Request an Area creation. +func (r ApiCreateNetworkAreaRequest) CreateNetworkAreaPayload(createNetworkAreaPayload CreateNetworkAreaPayload) ApiCreateNetworkAreaRequest { + r.createNetworkAreaPayload = &createNetworkAreaPayload + return r +} + +func (r ApiCreateNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.CreateNetworkAreaExecute(r) +} + +/* +CreateNetworkArea Create new network area in an organization. + +Create a new network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiCreateNetworkAreaRequest +*/ +func (a *DefaultAPIService) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { + return ApiCreateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Execute executes the request +// +// @return NetworkArea +func (a *DefaultAPIService) CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if r.createNetworkAreaPayload == nil { + return localVarReturnValue, reportError("createNetworkAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + createNetworkAreaRangePayload *CreateNetworkAreaRangePayload +} + +// Request an addition of network ranges to an area. +func (r ApiCreateNetworkAreaRangeRequest) CreateNetworkAreaRangePayload(createNetworkAreaRangePayload CreateNetworkAreaRangePayload) ApiCreateNetworkAreaRangeRequest { + r.createNetworkAreaRangePayload = &createNetworkAreaRangePayload + return r +} + +func (r ApiCreateNetworkAreaRangeRequest) Execute() (*NetworkRangeListResponse, error) { + return r.ApiService.CreateNetworkAreaRangeExecute(r) +} + +/* +CreateNetworkAreaRange Create new network range in a network area. + +Create a new network range in an existing network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRangeRequest +*/ +func (a *DefaultAPIService) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest { + return ApiCreateNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return NetworkRangeListResponse +func (a *DefaultAPIService) CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRangeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkAreaRange") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.createNetworkAreaRangePayload == nil { + return localVarReturnValue, reportError("createNetworkAreaRangePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaRangePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + createNetworkAreaRoutePayload *CreateNetworkAreaRoutePayload +} + +// Request an addition of routes to an area. +func (r ApiCreateNetworkAreaRouteRequest) CreateNetworkAreaRoutePayload(createNetworkAreaRoutePayload CreateNetworkAreaRoutePayload) ApiCreateNetworkAreaRouteRequest { + r.createNetworkAreaRoutePayload = &createNetworkAreaRoutePayload + return r +} + +func (r ApiCreateNetworkAreaRouteRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.CreateNetworkAreaRouteExecute(r) +} + +/* +CreateNetworkAreaRoute Create new network routes. + +Create one or several new network routes in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiCreateNetworkAreaRouteRequest +*/ +func (a *DefaultAPIService) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest { + return ApiCreateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.createNetworkAreaRoutePayload == nil { + return localVarReturnValue, reportError("createNetworkAreaRoutePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNetworkAreaRoutePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + createNicPayload *CreateNicPayload +} + +// Request a network interface creation. +func (r ApiCreateNicRequest) CreateNicPayload(createNicPayload CreateNicPayload) ApiCreateNicRequest { + r.createNicPayload = &createNicPayload + return r +} + +func (r ApiCreateNicRequest) Execute() (*NIC, error) { + return r.ApiService.CreateNicExecute(r) +} + +/* +CreateNic Create new network interface. + +Create a new network interface in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiCreateNicRequest +*/ +func (a *DefaultAPIService) CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest { + return ApiCreateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return NIC +func (a *DefaultAPIService) CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks/{networkId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if r.createNicPayload == nil { + return localVarReturnValue, reportError("createNicPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createNicPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreatePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createPublicIPPayload *CreatePublicIPPayload +} + +// Request a public IP creation. +func (r ApiCreatePublicIPRequest) CreatePublicIPPayload(createPublicIPPayload CreatePublicIPPayload) ApiCreatePublicIPRequest { + r.createPublicIPPayload = &createPublicIPPayload + return r +} + +func (r ApiCreatePublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.CreatePublicIPExecute(r) +} + +/* +CreatePublicIP Create new public IP. + +Create a new public IP in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreatePublicIPRequest +*/ +func (a *DefaultAPIService) CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest { + return ApiCreatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return PublicIp +func (a *DefaultAPIService) CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreatePublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/public-ips" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createPublicIPPayload == nil { + return localVarReturnValue, reportError("createPublicIPPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createPublicIPPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createSecurityGroupPayload *CreateSecurityGroupPayload +} + +// Request a security group creation. +func (r ApiCreateSecurityGroupRequest) CreateSecurityGroupPayload(createSecurityGroupPayload CreateSecurityGroupPayload) ApiCreateSecurityGroupRequest { + r.createSecurityGroupPayload = &createSecurityGroupPayload + return r +} + +func (r ApiCreateSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.CreateSecurityGroupExecute(r) +} + +/* +CreateSecurityGroup Create new security group. + +Create a new security group in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateSecurityGroupRequest +*/ +func (a *DefaultAPIService) CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest { + return ApiCreateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return SecurityGroup +func (a *DefaultAPIService) CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createSecurityGroupPayload == nil { + return localVarReturnValue, reportError("createSecurityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSecurityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string + createSecurityGroupRulePayload *CreateSecurityGroupRulePayload +} + +// Request for a security group rule creation. +func (r ApiCreateSecurityGroupRuleRequest) CreateSecurityGroupRulePayload(createSecurityGroupRulePayload CreateSecurityGroupRulePayload) ApiCreateSecurityGroupRuleRequest { + r.createSecurityGroupRulePayload = &createSecurityGroupRulePayload + return r +} + +func (r ApiCreateSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { + return r.ApiService.CreateSecurityGroupRuleExecute(r) +} + +/* +CreateSecurityGroupRule Create new security group rule. + +Create a new security group rule in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiCreateSecurityGroupRuleRequest +*/ +func (a *DefaultAPIService) CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { + return ApiCreateSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRule +func (a *DefaultAPIService) CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateSecurityGroupRule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if r.createSecurityGroupRulePayload == nil { + return localVarReturnValue, reportError("createSecurityGroupRulePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createSecurityGroupRulePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createServerPayload *CreateServerPayload +} + +// Request a server creation. +func (r ApiCreateServerRequest) CreateServerPayload(createServerPayload CreateServerPayload) ApiCreateServerRequest { + r.createServerPayload = &createServerPayload + return r +} + +func (r ApiCreateServerRequest) Execute() (*Server, error) { + return r.ApiService.CreateServerExecute(r) +} + +/* +CreateServer Create new server. + +Create a new server in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateServerRequest +*/ +func (a *DefaultAPIService) CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest { + return ApiCreateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Server +func (a *DefaultAPIService) CreateServerExecute(r ApiCreateServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createServerPayload == nil { + return localVarReturnValue, reportError("createServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + createVolumePayload *CreateVolumePayload +} + +// Request a volume creation. +func (r ApiCreateVolumeRequest) CreateVolumePayload(createVolumePayload CreateVolumePayload) ApiCreateVolumeRequest { + r.createVolumePayload = &createVolumePayload + return r +} + +func (r ApiCreateVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.CreateVolumeExecute(r) +} + +/* +CreateVolume Create new volume. + +Create a new volume in a project. If a volume source is not provided, an empty volume will be created. The size property is required if no source or an image source is provided. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiCreateVolumeRequest +*/ +func (a *DefaultAPIService) CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest { + return ApiCreateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Volume +func (a *DefaultAPIService) CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/volumes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createVolumePayload == nil { + return localVarReturnValue, reportError("createVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeallocateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiDeallocateServerRequest) Execute() error { + return r.ApiService.DeallocateServerExecute(r) +} + +/* +DeallocateServer Deallocate an existing server. + +Deallocate an existing server. The server will be removed from the hypervisor so only the volume will be billed. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeallocateServerRequest +*/ +func (a *DefaultAPIService) DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest { + return ApiDeallocateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeallocateServerExecute(r ApiDeallocateServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeallocateServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/deallocate" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + affinityGroupId string +} + +func (r ApiDeleteAffinityGroupRequest) Execute() error { + return r.ApiService.DeleteAffinityGroupExecute(r) +} + +/* +DeleteAffinityGroup Delete a affinity group in a project. + +Delete a affinity group in the given project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiDeleteAffinityGroupRequest +*/ +func (a *DefaultAPIService) DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest { + return ApiDeleteAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteAffinityGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(parameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.affinityGroupId) < 36 { + return reportError("affinityGroupId must have at least 36 elements") + } + if strlen(r.affinityGroupId) > 36 { + return reportError("affinityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + backupId string + force *bool +} + +// Force action. +func (r ApiDeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { + r.force = &force + return r +} + +func (r ApiDeleteBackupRequest) Execute() error { + return r.ApiService.DeleteBackupExecute(r) +} + +/* +DeleteBackup Delete a backup. + +Delete a backup that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiDeleteBackupRequest +*/ +func (a *DefaultAPIService) DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return reportError("backupId must have less than 36 elements") + } + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "force", defaultValue, "form", "") + r.force = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string +} + +func (r ApiDeleteImageRequest) Execute() error { + return r.ApiService.DeleteImageExecute(r) +} + +/* +DeleteImage Delete an Image. + +Delete an image that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageRequest +*/ +func (a *DefaultAPIService) DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest { + return ApiDeleteImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteImageExecute(r ApiDeleteImageRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImage") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string +} + +func (r ApiDeleteImageShareRequest) Execute() error { + return r.ApiService.DeleteImageShareExecute(r) +} + +/* +DeleteImageShare Remove image share. + +Remove the image share. New scope will be local. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiDeleteImageShareRequest +*/ +func (a *DefaultAPIService) DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest { + return ApiDeleteImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteImageShareExecute(r ApiDeleteImageShareRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImageShare") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteImageShareConsumerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + consumerProjectId string +} + +func (r ApiDeleteImageShareConsumerRequest) Execute() error { + return r.ApiService.DeleteImageShareConsumerExecute(r) +} + +/* +DeleteImageShareConsumer Remove an image share consumer. + +Remove consumer from a shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiDeleteImageShareConsumerRequest +*/ +func (a *DefaultAPIService) DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { + return ApiDeleteImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteImageShareConsumer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(parameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return reportError("imageId must have less than 36 elements") + } + if strlen(r.consumerProjectId) < 36 { + return reportError("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return reportError("consumerProjectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string +} + +func (r ApiDeleteKeyPairRequest) Execute() error { + return r.ApiService.DeleteKeyPairExecute(r) +} + +/* +DeleteKeyPair Delete an SSH keypair. + +Delete an SSH keypair from a user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiDeleteKeyPairRequest +*/ +func (a *DefaultAPIService) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteKeyPair") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return reportError("keypairName must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string +} + +func (r ApiDeleteNetworkRequest) Execute() error { + return r.ApiService.DeleteNetworkExecute(r) +} + +/* +DeleteNetwork Delete network. + +Delete a network. If the network is still in use, the deletion will fail. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiDeleteNetworkRequest +*/ +func (a *DefaultAPIService) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiDeleteNetworkAreaRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaExecute(r) +} + +/* +DeleteNetworkArea Delete a network area. + +Delete an existing network area in an organization. This is only possible if no projects are using the area anymore. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiDeleteNetworkAreaRequest +*/ +func (a *DefaultAPIService) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { + return ApiDeleteNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkArea") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + networkRangeId string +} + +func (r ApiDeleteNetworkAreaRangeRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaRangeExecute(r) +} + +/* +DeleteNetworkAreaRange Delete a network range. + +Delete a network range of a network area. The deletion will fail if the network range is still used. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiDeleteNetworkAreaRangeRequest +*/ +func (a *DefaultAPIService) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { + return ApiDeleteNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkAreaRange") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.networkRangeId) < 36 { + return reportError("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return reportError("networkRangeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routeId string +} + +func (r ApiDeleteNetworkAreaRouteRequest) Execute() error { + return r.ApiService.DeleteNetworkAreaRouteExecute(r) +} + +/* +DeleteNetworkAreaRoute Delete a network route. + +Delete a network route of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteNetworkAreaRouteRequest +*/ +func (a *DefaultAPIService) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest { + return ApiDeleteNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNetworkAreaRoute") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + nicId string +} + +func (r ApiDeleteNicRequest) Execute() error { + return r.ApiService.DeleteNicExecute(r) +} + +/* +DeleteNic Delete a network interface. + +Delete a network interface that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiDeleteNicRequest +*/ +func (a *DefaultAPIService) DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest { + return ApiDeleteNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteNicExecute(r ApiDeleteNicRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteNic") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeletePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + publicIpId string +} + +func (r ApiDeletePublicIPRequest) Execute() error { + return r.ApiService.DeletePublicIPExecute(r) +} + +/* +DeletePublicIP Delete a public IP. + +Delete a public IP that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiDeletePublicIPRequest +*/ +func (a *DefaultAPIService) DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest { + return ApiDeletePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeletePublicIPExecute(r ApiDeletePublicIPRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeletePublicIP") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteRouteFromRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string +} + +func (r ApiDeleteRouteFromRoutingTableRequest) Execute() error { + return r.ApiService.DeleteRouteFromRoutingTableExecute(r) +} + +/* +DeleteRouteFromRoutingTable Delete a route in a routing table. + +Delete a route in an existing routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiDeleteRouteFromRoutingTableRequest +*/ +func (a *DefaultAPIService) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { + return ApiDeleteRouteFromRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRouteFromRoutingTable") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteRoutingTableFromAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string +} + +func (r ApiDeleteRoutingTableFromAreaRequest) Execute() error { + return r.ApiService.DeleteRoutingTableFromAreaExecute(r) +} + +/* +DeleteRoutingTableFromArea Delete a routing table. + +Delete a routing table of a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiDeleteRoutingTableFromAreaRequest +*/ +func (a *DefaultAPIService) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { + return ApiDeleteRoutingTableFromAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRoutingTableFromArea") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return reportError("routingTableId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string +} + +func (r ApiDeleteSecurityGroupRequest) Execute() error { + return r.ApiService.DeleteSecurityGroupExecute(r) +} + +/* +DeleteSecurityGroup Delete security group. + +Delete a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiDeleteSecurityGroupRequest +*/ +func (a *DefaultAPIService) DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return ApiDeleteSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteSecurityGroup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string + securityGroupRuleId string +} + +func (r ApiDeleteSecurityGroupRuleRequest) Execute() error { + return r.ApiService.DeleteSecurityGroupRuleExecute(r) +} + +/* +DeleteSecurityGroupRule Delete security group rule. + +Delete a security group rule. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiDeleteSecurityGroupRuleRequest +*/ +func (a *DefaultAPIService) DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return ApiDeleteSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteSecurityGroupRule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(parameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return reportError("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return reportError("securityGroupRuleId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiDeleteServerRequest) Execute() error { + return r.ApiService.DeleteServerExecute(r) +} + +/* +DeleteServer Delete a server. + +Delete a server. Volumes won't be deleted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiDeleteServerRequest +*/ +func (a *DefaultAPIService) DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteServerExecute(r ApiDeleteServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumeId string +} + +func (r ApiDeleteVolumeRequest) Execute() error { + return r.ApiService.DeleteVolumeExecute(r) +} + +/* +DeleteVolume Delete a volume. + +Delete a volume inside a project. The deletion will fail if the volume is still in use. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiDeleteVolumeRequest +*/ +func (a *DefaultAPIService) DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest { + return ApiDeleteVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteVolumeExecute(r ApiDeleteVolumeRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiGetAffinityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + affinityGroupId string +} + +func (r ApiGetAffinityGroupRequest) Execute() (*AffinityGroup, error) { + return r.ApiService.GetAffinityGroupExecute(r) +} + +/* +GetAffinityGroup Get the affinity group. + +Get the affinity group created in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param affinityGroupId The identifier (ID) of a STACKIT Affinity Group. + @return ApiGetAffinityGroupRequest +*/ +func (a *DefaultAPIService) GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest { + return ApiGetAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +// Execute executes the request +// +// @return AffinityGroup +func (a *DefaultAPIService) GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAffinityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/affinity-groups/{affinityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"affinityGroupId"+"}", url.PathEscape(parameterValueToString(r.affinityGroupId, "affinityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.affinityGroupId) < 36 { + return localVarReturnValue, reportError("affinityGroupId must have at least 36 elements") + } + if strlen(r.affinityGroupId) > 36 { + return localVarReturnValue, reportError("affinityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetAttachedVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + volumeId string +} + +func (r ApiGetAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.GetAttachedVolumeExecute(r) +} + +/* +GetAttachedVolume Get Volume Attachment details. + +Get the details of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetAttachedVolumeRequest +*/ +func (a *DefaultAPIService) GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return ApiGetAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +func (a *DefaultAPIService) GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*Backup, error) { + return r.ApiService.GetBackupExecute(r) +} + +/* +GetBackup Get details about a backup. + +Get details about a block device backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiGetBackupRequest +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return Backup +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return localVarReturnValue, reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return localVarReturnValue, reportError("backupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string +} + +func (r ApiGetImageRequest) Execute() (*Image, error) { + return r.ApiService.GetImageExecute(r) +} + +/* +GetImage Get details about an image. + +Get details about a specific Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageRequest +*/ +func (a *DefaultAPIService) GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest { + return ApiGetImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return Image +func (a *DefaultAPIService) GetImageExecute(r ApiGetImageRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string +} + +func (r ApiGetImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.GetImageShareExecute(r) +} + +/* +GetImageShare Get share details of an image. + +Get share details about an shared image. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiGetImageShareRequest +*/ +func (a *DefaultAPIService) GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest { + return ApiGetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +func (a *DefaultAPIService) GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetImageShareConsumerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + consumerProjectId string +} + +func (r ApiGetImageShareConsumerRequest) Execute() (*ImageShareConsumer, error) { + return r.ApiService.GetImageShareConsumerExecute(r) +} + +/* +GetImageShareConsumer Get image share consumer. + +Get details about an image share consumer. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @param consumerProjectId The identifier (ID) of a STACKIT Project that consumes an image share. + @return ApiGetImageShareConsumerRequest +*/ +func (a *DefaultAPIService) GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { + return ApiGetImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// Execute executes the request +// +// @return ImageShareConsumer +func (a *DefaultAPIService) GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShareConsumer + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetImageShareConsumer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}/share/{consumerProjectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"consumerProjectId"+"}", url.PathEscape(parameterValueToString(r.consumerProjectId, "consumerProjectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if strlen(r.consumerProjectId) < 36 { + return localVarReturnValue, reportError("consumerProjectId must have at least 36 elements") + } + if strlen(r.consumerProjectId) > 36 { + return localVarReturnValue, reportError("consumerProjectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string +} + +func (r ApiGetKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.GetKeyPairExecute(r) +} + +/* +GetKeyPair Get SSH keypair details. + +Get details about an SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiGetKeyPairRequest +*/ +func (a *DefaultAPIService) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return ApiGetKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +// +// @return Keypair +func (a *DefaultAPIService) GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return localVarReturnValue, reportError("keypairName must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetMachineTypeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + machineType string +} + +func (r ApiGetMachineTypeRequest) Execute() (*MachineType, error) { + return r.ApiService.GetMachineTypeExecute(r) +} + +/* +GetMachineType Get details about a machine type. + +Get details about a specific machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param machineType STACKIT machine type Name. + @return ApiGetMachineTypeRequest +*/ +func (a *DefaultAPIService) GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest { + return ApiGetMachineTypeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + machineType: machineType, + } +} + +// Execute executes the request +// +// @return MachineType +func (a *DefaultAPIService) GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MachineType + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetMachineType") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/machine-types/{machineType}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"machineType"+"}", url.PathEscape(parameterValueToString(r.machineType, "machineType")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.machineType) > 127 { + return localVarReturnValue, reportError("machineType must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string +} + +func (r ApiGetNetworkRequest) Execute() (*Network, error) { + return r.ApiService.GetNetworkExecute(r) +} + +/* +GetNetwork Get network details. + +Get details about a network of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiGetNetworkRequest +*/ +func (a *DefaultAPIService) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return Network +func (a *DefaultAPIService) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Network + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetwork") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiGetNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.GetNetworkAreaExecute(r) +} + +/* +GetNetworkArea Get details about a network area. + +Get details about a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiGetNetworkAreaRequest +*/ +func (a *DefaultAPIService) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return ApiGetNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return NetworkArea +func (a *DefaultAPIService) GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRangeRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + networkRangeId string +} + +func (r ApiGetNetworkAreaRangeRequest) Execute() (*NetworkRange, error) { + return r.ApiService.GetNetworkAreaRangeExecute(r) +} + +/* +GetNetworkAreaRange Get details about a network range. + +Get details about a network range in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param networkRangeId The identifier (ID) of a STACKIT Network Range. + @return ApiGetNetworkAreaRangeRequest +*/ +func (a *DefaultAPIService) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest { + return ApiGetNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, + } +} + +// Execute executes the request +// +// @return NetworkRange +func (a *DefaultAPIService) GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRange + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkAreaRange") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges/{networkRangeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkRangeId"+"}", url.PathEscape(parameterValueToString(r.networkRangeId, "networkRangeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.networkRangeId) < 36 { + return localVarReturnValue, reportError("networkRangeId must have at least 36 elements") + } + if strlen(r.networkRangeId) > 36 { + return localVarReturnValue, reportError("networkRangeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNetworkAreaRouteRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routeId string +} + +func (r ApiGetNetworkAreaRouteRequest) Execute() (*Route, error) { + return r.ApiService.GetNetworkAreaRouteExecute(r) +} + +/* +GetNetworkAreaRoute Get details about a network route. + +Get details about a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetNetworkAreaRouteRequest +*/ +func (a *DefaultAPIService) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest { + return ApiGetNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNetworkAreaRoute") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + nicId string +} + +func (r ApiGetNicRequest) Execute() (*NIC, error) { + return r.ApiService.GetNicExecute(r) +} + +/* +GetNic Get details about a network interface. + +Get details about a network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiGetNicRequest +*/ +func (a *DefaultAPIService) GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest { + return ApiGetNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +func (a *DefaultAPIService) GetNicExecute(r ApiGetNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetOrganizationRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + requestId string +} + +func (r ApiGetOrganizationRequestRequest) Execute() (*Request, error) { + return r.ApiService.GetOrganizationRequestExecute(r) +} + +/* +GetOrganizationRequest Lookup an organization request ID. + +Lookup an organization request ID from a previous request. This allows to find resource IDs of resources generated during a organization request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetOrganizationRequestRequest +*/ +func (a *DefaultAPIService) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return ApiGetOrganizationRequestRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, + } +} + +// Execute executes the request +// +// @return Request +func (a *DefaultAPIService) GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Request + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetOrganizationRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.requestId) < 36 { + return localVarReturnValue, reportError("requestId must have at least 36 elements") + } + if strlen(r.requestId) > 36 { + return localVarReturnValue, reportError("requestId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectDetailsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiGetProjectDetailsRequest) Execute() (*Project, error) { + return r.ApiService.GetProjectDetailsExecute(r) +} + +/* +GetProjectDetails Get project details. + +Get details about a STACKIT project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @return ApiGetProjectDetailsRequest +*/ +func (a *DefaultAPIService) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return ApiGetProjectDetailsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Project +func (a *DefaultAPIService) GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Project + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectDetails") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectNICRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + nicId string +} + +func (r ApiGetProjectNICRequest) Execute() (*NIC, error) { + return r.ApiService.GetProjectNICExecute(r) +} + +/* +GetProjectNIC Get details about a network interface of a project. + +Get details about a network interface inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param nicId The identifier (ID) of a network interface. + @return ApiGetProjectNICRequest +*/ +func (a *DefaultAPIService) GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest { + return ApiGetProjectNICRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +func (a *DefaultAPIService) GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectNIC") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetProjectRequestRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + requestId string +} + +func (r ApiGetProjectRequestRequest) Execute() (*Request, error) { + return r.ApiService.GetProjectRequestExecute(r) +} + +/* +GetProjectRequest Lookup a project request ID. + +Lookup a project request ID from a previous request. This allows to find resource IDs of resources generated during a projects request. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param requestId The identifier (ID) of a STACKIT Request. + @return ApiGetProjectRequestRequest +*/ +func (a *DefaultAPIService) GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest { + return ApiGetProjectRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + requestId: requestId, + } +} + +// Execute executes the request +// +// @return Request +func (a *DefaultAPIService) GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Request + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetProjectRequest") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/requests/{requestId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"requestId"+"}", url.PathEscape(parameterValueToString(r.requestId, "requestId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.requestId) < 36 { + return localVarReturnValue, reportError("requestId must have at least 36 elements") + } + if strlen(r.requestId) > 36 { + return localVarReturnValue, reportError("requestId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetPublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + publicIpId string +} + +func (r ApiGetPublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.GetPublicIPExecute(r) +} + +/* +GetPublicIP Get details about a public IP. + +Get details about a public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiGetPublicIPRequest +*/ +func (a *DefaultAPIService) GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest { + return ApiGetPublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// +// @return PublicIp +func (a *DefaultAPIService) GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetPublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetRouteOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string +} + +func (r ApiGetRouteOfRoutingTableRequest) Execute() (*Route, error) { + return r.ApiService.GetRouteOfRoutingTableExecute(r) +} + +/* +GetRouteOfRoutingTable Get details about a route of a routing table. + +Get details about a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiGetRouteOfRoutingTableRequest +*/ +func (a *DefaultAPIService) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { + return ApiGetRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRouteOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetRoutingTableOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string +} + +func (r ApiGetRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.GetRoutingTableOfAreaExecute(r) +} + +/* +GetRoutingTableOfArea Get details about a routing table. + +Get details about a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiGetRoutingTableOfAreaRequest +*/ +func (a *DefaultAPIService) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { + return ApiGetRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRoutingTableOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string +} + +func (r ApiGetSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.GetSecurityGroupExecute(r) +} + +/* +GetSecurityGroup Get security group details. + +Get details about a security group of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiGetSecurityGroupRequest +*/ +func (a *DefaultAPIService) GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest { + return ApiGetSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroup +func (a *DefaultAPIService) GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetSecurityGroupRuleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string + securityGroupRuleId string +} + +func (r ApiGetSecurityGroupRuleRequest) Execute() (*SecurityGroupRule, error) { + return r.ApiService.GetSecurityGroupRuleExecute(r) +} + +/* +GetSecurityGroupRule Get security group rule details. + +Get details about a security group rule of a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @param securityGroupRuleId The identifier (ID) of a STACKIT Security Group Rule. + @return ApiGetSecurityGroupRuleRequest +*/ +func (a *DefaultAPIService) GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return ApiGetSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRule +func (a *DefaultAPIService) GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSecurityGroupRule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules/{securityGroupRuleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupRuleId"+"}", url.PathEscape(parameterValueToString(r.securityGroupRuleId, "securityGroupRuleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if strlen(r.securityGroupRuleId) < 36 { + return localVarReturnValue, reportError("securityGroupRuleId must have at least 36 elements") + } + if strlen(r.securityGroupRuleId) > 36 { + return localVarReturnValue, reportError("securityGroupRuleId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + details *bool +} + +// Show detailed information about server. +func (r ApiGetServerRequest) Details(details bool) ApiGetServerRequest { + r.details = &details + return r +} + +func (r ApiGetServerRequest) Execute() (*Server, error) { + return r.ApiService.GetServerExecute(r) +} + +/* +GetServer Get server details. + +Get details about a server by its ID. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerRequest +*/ +func (a *DefaultAPIService) GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return Server +func (a *DefaultAPIService) GetServerExecute(r ApiGetServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "details", defaultValue, "form", "") + r.details = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerConsoleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiGetServerConsoleRequest) Execute() (*ServerConsoleUrl, error) { + return r.ApiService.GetServerConsoleExecute(r) +} + +/* +GetServerConsole Get server console. + +Get a URL for server remote console. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerConsoleRequest +*/ +func (a *DefaultAPIService) GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return ServerConsoleUrl +func (a *DefaultAPIService) GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServerConsoleUrl + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServerConsole") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/console" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServerLogRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + length *int64 +} + +// Request the server log. By default the length is limited to 2000 lines. Set to 0 to retrieve the complete log. +func (r ApiGetServerLogRequest) Length(length int64) ApiGetServerLogRequest { + r.length = &length + return r +} + +func (r ApiGetServerLogRequest) Execute() (*GetServerLog200Response, error) { + return r.ApiService.GetServerLogExecute(r) +} + +/* +GetServerLog Get server log. + +Get server console log. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiGetServerLogRequest +*/ +func (a *DefaultAPIService) GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest { + return ApiGetServerLogRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return GetServerLog200Response +func (a *DefaultAPIService) GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetServerLog200Response + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServerLog") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/log" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + if r.length != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "length", r.length, "form", "") + } else { + var defaultValue int64 = 2000 + parameterAddToHeaderOrQuery(localVarQueryParams, "length", defaultValue, "form", "") + r.length = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumeId string +} + +func (r ApiGetVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.GetVolumeExecute(r) +} + +/* +GetVolume Get details about a volume. + +Get details about a block device volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiGetVolumeRequest +*/ +func (a *DefaultAPIService) GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest { + return ApiGetVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return Volume +func (a *DefaultAPIService) GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetVolumePerformanceClassRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumePerformanceClass string +} + +func (r ApiGetVolumePerformanceClassRequest) Execute() (*VolumePerformanceClass, error) { + return r.ApiService.GetVolumePerformanceClassExecute(r) +} + +/* +GetVolumePerformanceClass Get details about a volume performance class. + +Get details about a specific volume performance class. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumePerformanceClass The name of a STACKIT Volume performance class. + @return ApiGetVolumePerformanceClassRequest +*/ +func (a *DefaultAPIService) GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return ApiGetVolumePerformanceClassRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumePerformanceClass: volumePerformanceClass, + } +} + +// Execute executes the request +// +// @return VolumePerformanceClass +func (a *DefaultAPIService) GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumePerformanceClass + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetVolumePerformanceClass") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/volume-performance-classes/{volumePerformanceClass}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumePerformanceClass"+"}", url.PathEscape(parameterValueToString(r.volumePerformanceClass, "volumePerformanceClass")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumePerformanceClass) > 127 { + return localVarReturnValue, reportError("volumePerformanceClass must have less than 127 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAffinityGroupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListAffinityGroupsRequest) Execute() (*AffinityGroupListResponse, error) { + return r.ApiService.ListAffinityGroupsExecute(r) +} + +/* +ListAffinityGroups Get the affinity groups setup for a project. + +Get the affinity groups created in a project. Affinity groups are an indication of locality of a server relative to another group of servers. They can be either running on the same host (affinity) or on different ones (anti-affinity). + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListAffinityGroupsRequest +*/ +func (a *DefaultAPIService) ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest { + return ApiListAffinityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return AffinityGroupListResponse +func (a *DefaultAPIService) ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AffinityGroupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAffinityGroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/affinity-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAttachedVolumesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiListAttachedVolumesRequest) Execute() (*VolumeAttachmentListResponse, error) { + return r.ApiService.ListAttachedVolumesExecute(r) +} + +/* +ListAttachedVolumes List all volume attachments of a server. + +Get a list of all volume attachments of a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListAttachedVolumesRequest +*/ +func (a *DefaultAPIService) ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest { + return ApiListAttachedVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return VolumeAttachmentListResponse +func (a *DefaultAPIService) ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachmentListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAttachedVolumes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAvailabilityZonesRequest struct { + ctx context.Context + ApiService DefaultAPI + region string +} + +func (r ApiListAvailabilityZonesRequest) Execute() (*AvailabilityZoneListResponse, error) { + return r.ApiService.ListAvailabilityZonesExecute(r) +} + +/* +ListAvailabilityZones List all availability zones. + +Get a list of all availability zones. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region The STACKIT Region of the resources. + @return ApiListAvailabilityZonesRequest +*/ +func (a *DefaultAPIService) ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest { + return ApiListAvailabilityZonesRequest{ + ApiService: a, + ctx: ctx, + region: region, + } +} + +// Execute executes the request +// +// @return AvailabilityZoneListResponse +func (a *DefaultAPIService) ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AvailabilityZoneListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAvailabilityZones") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/regions/{region}/availability-zones" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListBackupsRequest) LabelSelector(labelSelector string) ApiListBackupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListBackupsRequest) Execute() (*BackupListResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups List all backups inside a project. + +Get a list of all backups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return BackupListResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListImagesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + all *bool + labelSelector *string +} + +// List all Images. +func (r ApiListImagesRequest) All(all bool) ApiListImagesRequest { + r.all = &all + return r +} + +// Filter resources by labels. +func (r ApiListImagesRequest) LabelSelector(labelSelector string) ApiListImagesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListImagesRequest) Execute() (*ImageListResponse, error) { + return r.ApiService.ListImagesExecute(r) +} + +/* +ListImages List all Images inside a project. + +Get a list of all images inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListImagesRequest +*/ +func (a *DefaultAPIService) ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest { + return ApiListImagesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ImageListResponse +func (a *DefaultAPIService) ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListImages") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.all != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "all", r.all, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "all", defaultValue, "form", "") + r.all = &defaultValue + } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListKeyPairsRequest struct { + ctx context.Context + ApiService DefaultAPI + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListKeyPairsRequest) LabelSelector(labelSelector string) ApiListKeyPairsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListKeyPairsRequest) Execute() (*KeyPairListResponse, error) { + return r.ApiService.ListKeyPairsExecute(r) +} + +/* +ListKeyPairs List all SSH keypairs for the requesting user. + +Get a list of all SSH keypairs assigned to the requesting user. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListKeyPairsRequest +*/ +func (a *DefaultAPIService) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ApiListKeyPairsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return KeyPairListResponse +func (a *DefaultAPIService) ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *KeyPairListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListKeyPairs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/keypairs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListMachineTypesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + filter *string +} + +// Filter resources by fields. A subset of expr-lang is supported. See https://expr-lang.org/docs/language-definition for usage details. +func (r ApiListMachineTypesRequest) Filter(filter string) ApiListMachineTypesRequest { + r.filter = &filter + return r +} + +func (r ApiListMachineTypesRequest) Execute() (*MachineTypeListResponse, error) { + return r.ApiService.ListMachineTypesExecute(r) +} + +/* +ListMachineTypes List all machine types available for a project. + +Get a list of all machine type available in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListMachineTypesRequest +*/ +func (a *DefaultAPIService) ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest { + return ApiListMachineTypesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return MachineTypeListResponse +func (a *DefaultAPIService) ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *MachineTypeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListMachineTypes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/machine-types" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.filter != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "filter", r.filter, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaProjectsRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiListNetworkAreaProjectsRequest) Execute() (*ProjectListResponse, error) { + return r.ApiService.ListNetworkAreaProjectsExecute(r) +} + +/* +ListNetworkAreaProjects List all projects using a network area. + +Get a list of all projects using a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiListNetworkAreaProjectsRequest +*/ +func (a *DefaultAPIService) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ApiListNetworkAreaProjectsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return ProjectListResponse +func (a *DefaultAPIService) ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ProjectListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaProjects") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/projects" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaRangesRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string +} + +func (r ApiListNetworkAreaRangesRequest) Execute() (*NetworkRangeListResponse, error) { + return r.ApiService.ListNetworkAreaRangesExecute(r) +} + +/* +ListNetworkAreaRanges List all network ranges in a network area. + +Get a list of all network ranges in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRangesRequest +*/ +func (a *DefaultAPIService) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest { + return ApiListNetworkAreaRangesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return NetworkRangeListResponse +func (a *DefaultAPIService) ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkRangeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaRanges") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/network-ranges" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreaRoutesRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworkAreaRoutesRequest) LabelSelector(labelSelector string) ApiListNetworkAreaRoutesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworkAreaRoutesRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.ListNetworkAreaRoutesExecute(r) +} + +/* +ListNetworkAreaRoutes List all network routes in a network area. + +Get a list of all network routes defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListNetworkAreaRoutesRequest +*/ +func (a *DefaultAPIService) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest { + return ApiListNetworkAreaRoutesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreaRoutes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworkAreasRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworkAreasRequest) LabelSelector(labelSelector string) ApiListNetworkAreasRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworkAreasRequest) Execute() (*NetworkAreaListResponse, error) { + return r.ApiService.ListNetworkAreasExecute(r) +} + +/* +ListNetworkAreas List all network areas in an organization. + +Get a list of all visible network areas defined in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @return ApiListNetworkAreasRequest +*/ +func (a *DefaultAPIService) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ApiListNetworkAreasRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// Execute executes the request +// +// @return NetworkAreaListResponse +func (a *DefaultAPIService) ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkAreaListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworkAreas") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNetworksRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNetworksRequest) LabelSelector(labelSelector string) ApiListNetworksRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNetworksRequest) Execute() (*NetworkListResponse, error) { + return r.ApiService.ListNetworksExecute(r) +} + +/* +ListNetworks List all networks inside a project. + +Get a list of all networks inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListNetworksRequest +*/ +func (a *DefaultAPIService) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return NetworkListResponse +func (a *DefaultAPIService) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNetworks") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListNicsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListNicsRequest) LabelSelector(labelSelector string) ApiListNicsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListNicsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListNicsExecute(r) +} + +/* +ListNics List all network interfaces inside a network. + +Get a list of all network interfaces inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiListNicsRequest +*/ +func (a *DefaultAPIService) ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest { + return ApiListNicsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +// +// @return NICListResponse +func (a *DefaultAPIService) ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListNics") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks/{networkId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListProjectNICsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListProjectNICsRequest) LabelSelector(labelSelector string) ApiListProjectNICsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListProjectNICsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListProjectNICsExecute(r) +} + +/* +ListProjectNICs List all network interfaces inside a project. + +Get a list of all network interfaces inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListProjectNICsRequest +*/ +func (a *DefaultAPIService) ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest { + return ApiListProjectNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return NICListResponse +func (a *DefaultAPIService) ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListProjectNICs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListPublicIPRangesRequest struct { + ctx context.Context + ApiService DefaultAPI +} + +func (r ApiListPublicIPRangesRequest) Execute() (*PublicNetworkListResponse, error) { + return r.ApiService.ListPublicIPRangesExecute(r) +} + +/* +ListPublicIPRanges List all public IP ranges. + +Get a list of all public IP ranges that STACKIT uses. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @return ApiListPublicIPRangesRequest +*/ +func (a *DefaultAPIService) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ApiListPublicIPRangesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// Execute executes the request +// +// @return PublicNetworkListResponse +func (a *DefaultAPIService) ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicNetworkListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListPublicIPRanges") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/networks/public-ip-ranges" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListPublicIPsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListPublicIPsRequest) LabelSelector(labelSelector string) ApiListPublicIPsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListPublicIPsRequest) Execute() (*PublicIpListResponse, error) { + return r.ApiService.ListPublicIPsExecute(r) +} + +/* +ListPublicIPs List all public IPs inside a project. + +Get a list of all public IPs inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListPublicIPsRequest +*/ +func (a *DefaultAPIService) ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest { + return ApiListPublicIPsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return PublicIpListResponse +func (a *DefaultAPIService) ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIpListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListPublicIPs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/public-ips" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListQuotasRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string +} + +func (r ApiListQuotasRequest) Execute() (*QuotaListResponse, error) { + return r.ApiService.ListQuotasExecute(r) +} + +/* +ListQuotas List project quotas. + +List quota limits and usage for project resources. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListQuotasRequest +*/ +func (a *DefaultAPIService) ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest { + return ApiListQuotasRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return QuotaListResponse +func (a *DefaultAPIService) ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *QuotaListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListQuotas") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/quotas" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRoutesOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListRoutesOfRoutingTableRequest) LabelSelector(labelSelector string) ApiListRoutesOfRoutingTableRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListRoutesOfRoutingTableRequest) Execute() (*RouteListResponse, error) { + return r.ApiService.ListRoutesOfRoutingTableExecute(r) +} + +/* +ListRoutesOfRoutingTable List all routes in a routing table. + +Get a list of all routes in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiListRoutesOfRoutingTableRequest +*/ +func (a *DefaultAPIService) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { + return ApiListRoutesOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RouteListResponse +func (a *DefaultAPIService) ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RouteListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoutesOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRoutingTablesOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListRoutingTablesOfAreaRequest) LabelSelector(labelSelector string) ApiListRoutingTablesOfAreaRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListRoutingTablesOfAreaRequest) Execute() (*RoutingTableListResponse, error) { + return r.ApiService.ListRoutingTablesOfAreaExecute(r) +} + +/* +ListRoutingTablesOfArea List all routing tables in a network area. + +Get a list of all routing tables in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiListRoutingTablesOfAreaRequest +*/ +func (a *DefaultAPIService) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { + return ApiListRoutingTablesOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RoutingTableListResponse +func (a *DefaultAPIService) ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTableListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRoutingTablesOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListSecurityGroupRulesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string +} + +func (r ApiListSecurityGroupRulesRequest) Execute() (*SecurityGroupRuleListResponse, error) { + return r.ApiService.ListSecurityGroupRulesExecute(r) +} + +/* +ListSecurityGroupRules List all rules for a security group. + +Get a list of all rules inside a security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiListSecurityGroupRulesRequest +*/ +func (a *DefaultAPIService) ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest { + return ApiListSecurityGroupRulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroupRuleListResponse +func (a *DefaultAPIService) ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupRuleListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSecurityGroupRules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}/rules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListSecurityGroupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListSecurityGroupsRequest) LabelSelector(labelSelector string) ApiListSecurityGroupsRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListSecurityGroupsRequest) Execute() (*SecurityGroupListResponse, error) { + return r.ApiService.ListSecurityGroupsExecute(r) +} + +/* +ListSecurityGroups List all security groups inside a project. + +Get a list of all security groups inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListSecurityGroupsRequest +*/ +func (a *DefaultAPIService) ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest { + return ApiListSecurityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return SecurityGroupListResponse +func (a *DefaultAPIService) ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroupListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSecurityGroups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServerNICsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiListServerNICsRequest) Execute() (*NICListResponse, error) { + return r.ApiService.ListServerNICsExecute(r) +} + +/* +ListServerNICs Get all network interfaces. + +Get all network interfaces attached to the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerNICsRequest +*/ +func (a *DefaultAPIService) ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest { + return ApiListServerNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return NICListResponse +func (a *DefaultAPIService) ListServerNICsExecute(r ApiListServerNICsRequest) (*NICListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NICListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServerNICs") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/nics" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServerServiceAccountsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiListServerServiceAccountsRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.ListServerServiceAccountsExecute(r) +} + +/* +ListServerServiceAccounts List all service accounts of the Server. + +Get the list of the service accounts of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiListServerServiceAccountsRequest +*/ +func (a *DefaultAPIService) ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest { + return ApiListServerServiceAccountsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +func (a *DefaultAPIService) ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServerServiceAccounts") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListServersRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + details *bool + labelSelector *string +} + +// Show detailed information about server. +func (r ApiListServersRequest) Details(details bool) ApiListServersRequest { + r.details = &details + return r +} + +// Filter resources by labels. +func (r ApiListServersRequest) LabelSelector(labelSelector string) ApiListServersRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListServersRequest) Execute() (*ServerListResponse, error) { + return r.ApiService.ListServersExecute(r) +} + +/* +ListServers List all servers inside a project. + +Get a list of all servers inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListServersRequest +*/ +func (a *DefaultAPIService) ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest { + return ApiListServersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return ServerListResponse +func (a *DefaultAPIService) ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServerListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListServers") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.details != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "details", r.details, "form", "") + } else { + var defaultValue bool = false + parameterAddToHeaderOrQuery(localVarQueryParams, "details", defaultValue, "form", "") + r.details = &defaultValue + } + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVolumePerformanceClassesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListVolumePerformanceClassesRequest) LabelSelector(labelSelector string) ApiListVolumePerformanceClassesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListVolumePerformanceClassesRequest) Execute() (*VolumePerformanceClassListResponse, error) { + return r.ApiService.ListVolumePerformanceClassesExecute(r) +} + +/* +ListVolumePerformanceClasses List all volume performance classes available for a project. + +Get a list of all volume performance classes available inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListVolumePerformanceClassesRequest +*/ +func (a *DefaultAPIService) ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest { + return ApiListVolumePerformanceClassesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return VolumePerformanceClassListResponse +func (a *DefaultAPIService) ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumePerformanceClassListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVolumePerformanceClasses") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/volume-performance-classes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListVolumesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiListVolumesRequest) LabelSelector(labelSelector string) ApiListVolumesRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiListVolumesRequest) Execute() (*VolumeListResponse, error) { + return r.ApiService.ListVolumesExecute(r) +} + +/* +ListVolumes List all volumes inside a project. + +Get a list of all volumes inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiListVolumesRequest +*/ +func (a *DefaultAPIService) ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest { + return ApiListVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return VolumeListResponse +func (a *DefaultAPIService) ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListVolumes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/volumes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPartialUpdateNetworkRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + partialUpdateNetworkPayload *PartialUpdateNetworkPayload +} + +// Request an update of a network. +func (r ApiPartialUpdateNetworkRequest) PartialUpdateNetworkPayload(partialUpdateNetworkPayload PartialUpdateNetworkPayload) ApiPartialUpdateNetworkRequest { + r.partialUpdateNetworkPayload = &partialUpdateNetworkPayload + return r +} + +func (r ApiPartialUpdateNetworkRequest) Execute() error { + return r.ApiService.PartialUpdateNetworkExecute(r) +} + +/* +PartialUpdateNetwork Update network settings. + +Update the settings of a network inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiPartialUpdateNetworkRequest +*/ +func (a *DefaultAPIService) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateNetwork") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + if r.partialUpdateNetworkPayload == nil { + return reportError("partialUpdateNetworkPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateNetworkPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiPartialUpdateNetworkAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + partialUpdateNetworkAreaPayload *PartialUpdateNetworkAreaPayload +} + +// Request to update an Area. +func (r ApiPartialUpdateNetworkAreaRequest) PartialUpdateNetworkAreaPayload(partialUpdateNetworkAreaPayload PartialUpdateNetworkAreaPayload) ApiPartialUpdateNetworkAreaRequest { + r.partialUpdateNetworkAreaPayload = &partialUpdateNetworkAreaPayload + return r +} + +func (r ApiPartialUpdateNetworkAreaRequest) Execute() (*NetworkArea, error) { + return r.ApiService.PartialUpdateNetworkAreaExecute(r) +} + +/* +PartialUpdateNetworkArea Update network area settings. + +Update the settings of a network area in an organization. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiPartialUpdateNetworkAreaRequest +*/ +func (a *DefaultAPIService) PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest { + return ApiPartialUpdateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return NetworkArea +func (a *DefaultAPIService) PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NetworkArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PartialUpdateNetworkArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.partialUpdateNetworkAreaPayload == nil { + return localVarReturnValue, reportError("partialUpdateNetworkAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.partialUpdateNetworkAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiRebootServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + action *string +} + +// Defines if it is a soft or a hard reboot. +func (r ApiRebootServerRequest) Action(action string) ApiRebootServerRequest { + r.action = &action + return r +} + +func (r ApiRebootServerRequest) Execute() error { + return r.ApiService.RebootServerExecute(r) +} + +/* +RebootServer Reboot the server. + +Reboot the server. A soft reboot will attempt to gracefully shut down the server by passing the command to the operating system. A hard reboot will power cycle the server without waiting for the operating system to shutdown properly. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRebootServerRequest +*/ +func (a *DefaultAPIService) RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest { + return ApiRebootServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RebootServerExecute(r ApiRebootServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RebootServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/reboot" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + if r.action != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "action", r.action, "form", "") + } else { + var defaultValue string = "soft" + parameterAddToHeaderOrQuery(localVarQueryParams, "action", defaultValue, "form", "") + r.action = &defaultValue + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveNetworkFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + networkId string +} + +func (r ApiRemoveNetworkFromServerRequest) Execute() error { + return r.ApiService.RemoveNetworkFromServerExecute(r) +} + +/* +RemoveNetworkFromServer Detach and delete all network interfaces associated with the specified network. + +Detach and delete all network interfaces associated with the specified network from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param networkId The identifier (ID) of a STACKIT Network. + @return ApiRemoveNetworkFromServerRequest +*/ +func (a *DefaultAPIService) RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { + return ApiRemoveNetworkFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + networkId: networkId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveNetworkFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/networks/{networkId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return reportError("networkId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveNicFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + nicId string +} + +func (r ApiRemoveNicFromServerRequest) Execute() error { + return r.ApiService.RemoveNicFromServerExecute(r) +} + +/* +RemoveNicFromServer Detach a network interface. + +Detach a network interface from a server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param nicId The identifier (ID) of a network interface. + @return ApiRemoveNicFromServerRequest +*/ +func (a *DefaultAPIService) RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest { + return ApiRemoveNicFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + nicId: nicId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveNicFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return reportError("nicId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemovePublicIpFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + publicIpId string +} + +func (r ApiRemovePublicIpFromServerRequest) Execute() error { + return r.ApiService.RemovePublicIpFromServerExecute(r) +} + +/* +RemovePublicIpFromServer Dissociate a public IP from a server. + +Dissociate a public IP on an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiRemovePublicIpFromServerRequest +*/ +func (a *DefaultAPIService) RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { + return ApiRemovePublicIpFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemovePublicIpFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return reportError("publicIpId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveSecurityGroupFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + securityGroupId string +} + +func (r ApiRemoveSecurityGroupFromServerRequest) Execute() error { + return r.ApiService.RemoveSecurityGroupFromServerExecute(r) +} + +/* +RemoveSecurityGroupFromServer Remove a server from a security group. + +Remove a server from a attached security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiRemoveSecurityGroupFromServerRequest +*/ +func (a *DefaultAPIService) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { + return ApiRemoveSecurityGroupFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveSecurityGroupFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return reportError("securityGroupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRemoveServiceAccountFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + serviceAccountMail string +} + +func (r ApiRemoveServiceAccountFromServerRequest) Execute() (*ServiceAccountMailListResponse, error) { + return r.ApiService.RemoveServiceAccountFromServerExecute(r) +} + +/* +RemoveServiceAccountFromServer Detach a service account from a server. + +Detach an additional service account from the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param serviceAccountMail The e-mail address of a service account. + @return ApiRemoveServiceAccountFromServerRequest +*/ +func (a *DefaultAPIService) RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { + return ApiRemoveServiceAccountFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// Execute executes the request +// +// @return ServiceAccountMailListResponse +func (a *DefaultAPIService) RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ServiceAccountMailListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveServiceAccountFromServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/service-accounts/{serviceAccountMail}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serviceAccountMail"+"}", url.PathEscape(parameterValueToString(r.serviceAccountMail, "serviceAccountMail")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.serviceAccountMail) > 255 { + return localVarReturnValue, reportError("serviceAccountMail must have less than 255 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiRemoveVolumeFromServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + volumeId string +} + +func (r ApiRemoveVolumeFromServerRequest) Execute() error { + return r.ApiService.RemoveVolumeFromServerExecute(r) +} + +/* +RemoveVolumeFromServer Detach a volume from a server. + +Detach an existing volume from an existing server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiRemoveVolumeFromServerRequest +*/ +func (a *DefaultAPIService) RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { + return ApiRemoveVolumeFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RemoveVolumeFromServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRescueServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + rescueServerPayload *RescueServerPayload +} + +// Request a server rescue. +func (r ApiRescueServerRequest) RescueServerPayload(rescueServerPayload RescueServerPayload) ApiRescueServerRequest { + r.rescueServerPayload = &rescueServerPayload + return r +} + +func (r ApiRescueServerRequest) Execute() error { + return r.ApiService.RescueServerExecute(r) +} + +/* +RescueServer Rescue an existing server. + +Rescue an existing server. It is shutdown and the initial image is attached as the boot volume, while the boot volume is attached as secondary volume and the server is booted. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiRescueServerRequest +*/ +func (a *DefaultAPIService) RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest { + return ApiRescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RescueServerExecute(r ApiRescueServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RescueServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/rescue" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if r.rescueServerPayload == nil { + return reportError("rescueServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.rescueServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiResizeServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + resizeServerPayload *ResizeServerPayload +} + +// Request a resize of a server. +func (r ApiResizeServerRequest) ResizeServerPayload(resizeServerPayload ResizeServerPayload) ApiResizeServerRequest { + r.resizeServerPayload = &resizeServerPayload + return r +} + +func (r ApiResizeServerRequest) Execute() error { + return r.ApiService.ResizeServerExecute(r) +} + +/* +ResizeServer Resize a server. + +Resize the server to the given machine type. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiResizeServerRequest +*/ +func (a *DefaultAPIService) ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest { + return ApiResizeServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) ResizeServerExecute(r ApiResizeServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResizeServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/resize" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + if r.resizeServerPayload == nil { + return reportError("resizeServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.resizeServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiResizeVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumeId string + resizeVolumePayload *ResizeVolumePayload +} + +// Request a volume resize. +func (r ApiResizeVolumeRequest) ResizeVolumePayload(resizeVolumePayload ResizeVolumePayload) ApiResizeVolumeRequest { + r.resizeVolumePayload = &resizeVolumePayload + return r +} + +func (r ApiResizeVolumeRequest) Execute() error { + return r.ApiService.ResizeVolumeExecute(r) +} + +/* +ResizeVolume Update the size of a volume. + +Update the size of a block device volume. The new volume size must be larger than the current size. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiResizeVolumeRequest +*/ +func (a *DefaultAPIService) ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest { + return ApiResizeVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) ResizeVolumeExecute(r ApiResizeVolumeRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ResizeVolume") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/volumes/{volumeId}/resize" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return reportError("volumeId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.resizeVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiRestoreBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + backupId string +} + +func (r ApiRestoreBackupRequest) Execute() error { + return r.ApiService.RestoreBackupExecute(r) +} + +/* +RestoreBackup Restore Backup to the referenced source Volume. + +Restores a Backup to the existing Volume it references to. The use of this endpoint is disruptive as the volume needs to be detached. If a new volume is to be created use the volumes endpoint with the option to create from backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiRestoreBackupRequest +*/ +func (a *DefaultAPIService) RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return reportError("backupId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiSetImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + setImageSharePayload *SetImageSharePayload +} + +// Settings for an Image Share. +func (r ApiSetImageShareRequest) SetImageSharePayload(setImageSharePayload SetImageSharePayload) ApiSetImageShareRequest { + r.setImageSharePayload = &setImageSharePayload + return r +} + +func (r ApiSetImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.SetImageShareExecute(r) +} + +/* +SetImageShare Set image share. + +Set share of an Image. New Options will replace existing settings. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiSetImageShareRequest +*/ +func (a *DefaultAPIService) SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest { + return ApiSetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +func (a *DefaultAPIService) SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.SetImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.setImageSharePayload == nil { + return localVarReturnValue, reportError("setImageSharePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.setImageSharePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiStartServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiStartServerRequest) Execute() error { + return r.ApiService.StartServerExecute(r) +} + +/* +StartServer Boot up a server. + +Start an existing server or allocates the server if deallocated. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStartServerRequest +*/ +func (a *DefaultAPIService) StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest { + return ApiStartServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) StartServerExecute(r ApiStartServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.StartServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/start" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiStopServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiStopServerRequest) Execute() error { + return r.ApiService.StopServerExecute(r) +} + +/* +StopServer Stop an existing server. + +Stops an existing server. The server will remain on the Hypervisor and will be charged full price for all resources attached to it. The attached resources will remain reserved. Useful particularly for vGPU servers. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiStopServerRequest +*/ +func (a *DefaultAPIService) StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest { + return ApiStopServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) StopServerExecute(r ApiStopServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.StopServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/stop" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiUnrescueServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string +} + +func (r ApiUnrescueServerRequest) Execute() error { + return r.ApiService.UnrescueServerExecute(r) +} + +/* +UnrescueServer Unrescue an existing server. + +Unrescue an existing server. The original boot volume is attached as boot volume of the server and the server is booted up. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUnrescueServerRequest +*/ +func (a *DefaultAPIService) UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest { + return ApiUnrescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) UnrescueServerExecute(r ApiUnrescueServerRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UnrescueServer") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/unrescue" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return reportError("serverId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiUpdateAttachedVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + volumeId string + updateAttachedVolumePayload *UpdateAttachedVolumePayload +} + +// Request a volume attachment update. +func (r ApiUpdateAttachedVolumeRequest) UpdateAttachedVolumePayload(updateAttachedVolumePayload UpdateAttachedVolumePayload) ApiUpdateAttachedVolumeRequest { + r.updateAttachedVolumePayload = &updateAttachedVolumePayload + return r +} + +func (r ApiUpdateAttachedVolumeRequest) Execute() (*VolumeAttachment, error) { + return r.ApiService.UpdateAttachedVolumeExecute(r) +} + +/* +UpdateAttachedVolume Update Volume Attachment Parameters. + +Update the properties of an existing Volume Attachment. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateAttachedVolumeRequest +*/ +func (a *DefaultAPIService) UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { + return ApiUpdateAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return VolumeAttachment +func (a *DefaultAPIService) UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *VolumeAttachment + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateAttachedVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}/volume-attachments/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + if r.updateAttachedVolumePayload == nil { + return localVarReturnValue, reportError("updateAttachedVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateAttachedVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateImageRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + updateImagePayload *UpdateImagePayload +} + +// Request an update of an Image. +func (r ApiUpdateImageRequest) UpdateImagePayload(updateImagePayload UpdateImagePayload) ApiUpdateImageRequest { + r.updateImagePayload = &updateImagePayload + return r +} + +func (r ApiUpdateImageRequest) Execute() (*Image, error) { + return r.ApiService.UpdateImageExecute(r) +} + +/* +UpdateImage Update Image Parameters. + +Update the properties of an existing Image inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageRequest +*/ +func (a *DefaultAPIService) UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest { + return ApiUpdateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return Image +func (a *DefaultAPIService) UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Image + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateImage") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.updateImagePayload == nil { + return localVarReturnValue, reportError("updateImagePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateImagePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateImageShareRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + imageId string + updateImageSharePayload *UpdateImageSharePayload +} + +// Update an Image Share. +func (r ApiUpdateImageShareRequest) UpdateImageSharePayload(updateImageSharePayload UpdateImageSharePayload) ApiUpdateImageShareRequest { + r.updateImageSharePayload = &updateImageSharePayload + return r +} + +func (r ApiUpdateImageShareRequest) Execute() (*ImageShare, error) { + return r.ApiService.UpdateImageShareExecute(r) +} + +/* +UpdateImageShare Update image share. + +Update share of an Image. Projects will be appended to existing list. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param imageId The identifier (ID) of a STACKIT Image. + @return ApiUpdateImageShareRequest +*/ +func (a *DefaultAPIService) UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest { + return ApiUpdateImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// Execute executes the request +// +// @return ImageShare +func (a *DefaultAPIService) UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ImageShare + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateImageShare") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/images/{imageId}/share" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"imageId"+"}", url.PathEscape(parameterValueToString(r.imageId, "imageId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.imageId) < 36 { + return localVarReturnValue, reportError("imageId must have at least 36 elements") + } + if strlen(r.imageId) > 36 { + return localVarReturnValue, reportError("imageId must have less than 36 elements") + } + if r.updateImageSharePayload == nil { + return localVarReturnValue, reportError("updateImageSharePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateImageSharePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateKeyPairRequest struct { + ctx context.Context + ApiService DefaultAPI + keypairName string + updateKeyPairPayload *UpdateKeyPairPayload +} + +// Request an update of an SSH keypair. +func (r ApiUpdateKeyPairRequest) UpdateKeyPairPayload(updateKeyPairPayload UpdateKeyPairPayload) ApiUpdateKeyPairRequest { + r.updateKeyPairPayload = &updateKeyPairPayload + return r +} + +func (r ApiUpdateKeyPairRequest) Execute() (*Keypair, error) { + return r.ApiService.UpdateKeyPairExecute(r) +} + +/* +UpdateKeyPair Update information of an SSH keypair. + +Update labels of the SSH keypair. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param keypairName The name of an SSH keypair. + @return ApiUpdateKeyPairRequest +*/ +func (a *DefaultAPIService) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { + return ApiUpdateKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// Execute executes the request +// +// @return Keypair +func (a *DefaultAPIService) UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Keypair + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateKeyPair") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/keypairs/{keypairName}" + localVarPath = strings.Replace(localVarPath, "{"+"keypairName"+"}", url.PathEscape(parameterValueToString(r.keypairName, "keypairName")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.keypairName) > 127 { + return localVarReturnValue, reportError("keypairName must have less than 127 elements") + } + if r.updateKeyPairPayload == nil { + return localVarReturnValue, reportError("updateKeyPairPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateKeyPairPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateNicRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + networkId string + nicId string + updateNicPayload *UpdateNicPayload +} + +// Request an update of a network interface. +func (r ApiUpdateNicRequest) UpdateNicPayload(updateNicPayload UpdateNicPayload) ApiUpdateNicRequest { + r.updateNicPayload = &updateNicPayload + return r +} + +func (r ApiUpdateNicRequest) Execute() (*NIC, error) { + return r.ApiService.UpdateNicExecute(r) +} + +/* +UpdateNic Update a network interface. + +Update the properties of an existing network interface inside a network. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param networkId The identifier (ID) of a STACKIT Network. + @param nicId The identifier (ID) of a network interface. + @return ApiUpdateNicRequest +*/ +func (a *DefaultAPIService) UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest { + return ApiUpdateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// Execute executes the request +// +// @return NIC +func (a *DefaultAPIService) UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *NIC + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateNic") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/networks/{networkId}/nics/{nicId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"networkId"+"}", url.PathEscape(parameterValueToString(r.networkId, "networkId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"nicId"+"}", url.PathEscape(parameterValueToString(r.nicId, "nicId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.networkId) < 36 { + return localVarReturnValue, reportError("networkId must have at least 36 elements") + } + if strlen(r.networkId) > 36 { + return localVarReturnValue, reportError("networkId must have less than 36 elements") + } + if strlen(r.nicId) < 36 { + return localVarReturnValue, reportError("nicId must have at least 36 elements") + } + if strlen(r.nicId) > 36 { + return localVarReturnValue, reportError("nicId must have less than 36 elements") + } + if r.updateNicPayload == nil { + return localVarReturnValue, reportError("updateNicPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateNicPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdatePublicIPRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + publicIpId string + updatePublicIPPayload *UpdatePublicIPPayload +} + +// Request an update of a public IP. +func (r ApiUpdatePublicIPRequest) UpdatePublicIPPayload(updatePublicIPPayload UpdatePublicIPPayload) ApiUpdatePublicIPRequest { + r.updatePublicIPPayload = &updatePublicIPPayload + return r +} + +func (r ApiUpdatePublicIPRequest) Execute() (*PublicIp, error) { + return r.ApiService.UpdatePublicIPExecute(r) +} + +/* +UpdatePublicIP Update a public IP. + +Update the properties of an existing public IP inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param publicIpId The identifier (ID) of a Public IP. + @return ApiUpdatePublicIPRequest +*/ +func (a *DefaultAPIService) UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest { + return ApiUpdatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// Execute executes the request +// +// @return PublicIp +func (a *DefaultAPIService) UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *PublicIp + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdatePublicIP") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/public-ips/{publicIpId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"publicIpId"+"}", url.PathEscape(parameterValueToString(r.publicIpId, "publicIpId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.publicIpId) < 36 { + return localVarReturnValue, reportError("publicIpId must have at least 36 elements") + } + if strlen(r.publicIpId) > 36 { + return localVarReturnValue, reportError("publicIpId must have less than 36 elements") + } + if r.updatePublicIPPayload == nil { + return localVarReturnValue, reportError("updatePublicIPPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updatePublicIPPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateRouteOfRoutingTableRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + routeId string + updateRouteOfRoutingTablePayload *UpdateRouteOfRoutingTablePayload +} + +// Request an update of a route in a routing table. +func (r ApiUpdateRouteOfRoutingTableRequest) UpdateRouteOfRoutingTablePayload(updateRouteOfRoutingTablePayload UpdateRouteOfRoutingTablePayload) ApiUpdateRouteOfRoutingTableRequest { + r.updateRouteOfRoutingTablePayload = &updateRouteOfRoutingTablePayload + return r +} + +func (r ApiUpdateRouteOfRoutingTableRequest) Execute() (*Route, error) { + return r.ApiService.UpdateRouteOfRoutingTableExecute(r) +} + +/* +UpdateRouteOfRoutingTable Update a route of a routing table. + +Update a route defined in a routing table. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiUpdateRouteOfRoutingTableRequest +*/ +func (a *DefaultAPIService) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { + return ApiUpdateRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRouteOfRoutingTable") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + if r.updateRouteOfRoutingTablePayload == nil { + return localVarReturnValue, reportError("updateRouteOfRoutingTablePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRouteOfRoutingTablePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateRoutingTableOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routingTableId string + updateRoutingTableOfAreaPayload *UpdateRoutingTableOfAreaPayload +} + +// Request an update of a routing table. +func (r ApiUpdateRoutingTableOfAreaRequest) UpdateRoutingTableOfAreaPayload(updateRoutingTableOfAreaPayload UpdateRoutingTableOfAreaPayload) ApiUpdateRoutingTableOfAreaRequest { + r.updateRoutingTableOfAreaPayload = &updateRoutingTableOfAreaPayload + return r +} + +func (r ApiUpdateRoutingTableOfAreaRequest) Execute() (*RoutingTable, error) { + return r.ApiService.UpdateRoutingTableOfAreaExecute(r) +} + +/* +UpdateRoutingTableOfArea Update a routing table. + +Update a routing table defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routingTableId The identifier (ID) of a STACKIT Routing Table. + @return ApiUpdateRoutingTableOfAreaRequest +*/ +func (a *DefaultAPIService) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { + return ApiUpdateRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// Execute executes the request +// +// @return RoutingTable +func (a *DefaultAPIService) UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RoutingTable + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateRoutingTableOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routing-tables/{routingTableId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routingTableId"+"}", url.PathEscape(parameterValueToString(r.routingTableId, "routingTableId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routingTableId) < 36 { + return localVarReturnValue, reportError("routingTableId must have at least 36 elements") + } + if strlen(r.routingTableId) > 36 { + return localVarReturnValue, reportError("routingTableId must have less than 36 elements") + } + if r.updateRoutingTableOfAreaPayload == nil { + return localVarReturnValue, reportError("updateRoutingTableOfAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateRoutingTableOfAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateServerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + serverId string + updateServerPayload *UpdateServerPayload +} + +// Request an update of a server. +func (r ApiUpdateServerRequest) UpdateServerPayload(updateServerPayload UpdateServerPayload) ApiUpdateServerRequest { + r.updateServerPayload = &updateServerPayload + return r +} + +func (r ApiUpdateServerRequest) Execute() (*Server, error) { + return r.ApiService.UpdateServerExecute(r) +} + +/* +UpdateServer Update information of a server. + +Update name or labels of the server. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param serverId The identifier (ID) of a STACKIT Server. + @return ApiUpdateServerRequest +*/ +func (a *DefaultAPIService) UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest { + return ApiUpdateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return Server +func (a *DefaultAPIService) UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Server + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateServer") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.serverId) < 36 { + return localVarReturnValue, reportError("serverId must have at least 36 elements") + } + if strlen(r.serverId) > 36 { + return localVarReturnValue, reportError("serverId must have less than 36 elements") + } + if r.updateServerPayload == nil { + return localVarReturnValue, reportError("updateServerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateServerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiUpdateVolumeRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + volumeId string + updateVolumePayload *UpdateVolumePayload +} + +// Request an update of a volume. +func (r ApiUpdateVolumeRequest) UpdateVolumePayload(updateVolumePayload UpdateVolumePayload) ApiUpdateVolumeRequest { + r.updateVolumePayload = &updateVolumePayload + return r +} + +func (r ApiUpdateVolumeRequest) Execute() (*Volume, error) { + return r.ApiService.UpdateVolumeExecute(r) +} + +/* +UpdateVolume Update information of a volume. + +Update name, description or labels of the volume. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param volumeId The identifier (ID) of a STACKIT Volume. + @return ApiUpdateVolumeRequest +*/ +func (a *DefaultAPIService) UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest { + return ApiUpdateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// Execute executes the request +// +// @return Volume +func (a *DefaultAPIService) UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Volume + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateVolume") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/volumes/{volumeId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeId"+"}", url.PathEscape(parameterValueToString(r.volumeId, "volumeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.volumeId) < 36 { + return localVarReturnValue, reportError("volumeId must have at least 36 elements") + } + if strlen(r.volumeId) > 36 { + return localVarReturnValue, reportError("volumeId must have less than 36 elements") + } + if r.updateVolumePayload == nil { + return localVarReturnValue, reportError("updateVolumePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateVolumePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1ConfigureNetworkAreaRegionRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + v2beta1ConfigureNetworkAreaRegionPayload *V2beta1ConfigureNetworkAreaRegionPayload +} + +// Request to add a new regional network area configuration. +func (r ApiV2beta1ConfigureNetworkAreaRegionRequest) V2beta1ConfigureNetworkAreaRegionPayload(v2beta1ConfigureNetworkAreaRegionPayload V2beta1ConfigureNetworkAreaRegionPayload) ApiV2beta1ConfigureNetworkAreaRegionRequest { + r.v2beta1ConfigureNetworkAreaRegionPayload = &v2beta1ConfigureNetworkAreaRegionPayload + return r +} + +func (r ApiV2beta1ConfigureNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { + return r.ApiService.V2beta1ConfigureNetworkAreaRegionExecute(r) +} + +/* +V2beta1ConfigureNetworkAreaRegion Configure a region for a network area. + +Configure a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiV2beta1ConfigureNetworkAreaRegionRequest +*/ +func (a *DefaultAPIService) V2beta1ConfigureNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1ConfigureNetworkAreaRegionRequest { + return ApiV2beta1ConfigureNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RegionalArea +func (a *DefaultAPIService) V2beta1ConfigureNetworkAreaRegionExecute(r ApiV2beta1ConfigureNetworkAreaRegionRequest) (*RegionalArea, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegionalArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1ConfigureNetworkAreaRegion") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.v2beta1ConfigureNetworkAreaRegionPayload == nil { + return localVarReturnValue, reportError("v2beta1ConfigureNetworkAreaRegionPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.v2beta1ConfigureNetworkAreaRegionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1CreateSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + v2beta1CreateSnapshotPayload *V2beta1CreateSnapshotPayload +} + +// Request a snapshot creation. +func (r ApiV2beta1CreateSnapshotRequest) V2beta1CreateSnapshotPayload(v2beta1CreateSnapshotPayload V2beta1CreateSnapshotPayload) ApiV2beta1CreateSnapshotRequest { + r.v2beta1CreateSnapshotPayload = &v2beta1CreateSnapshotPayload + return r +} + +func (r ApiV2beta1CreateSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.V2beta1CreateSnapshotExecute(r) +} + +/* +V2beta1CreateSnapshot Create new Snapshot. + +Create a new Snapshot from a Volume in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiV2beta1CreateSnapshotRequest +*/ +func (a *DefaultAPIService) V2beta1CreateSnapshot(ctx context.Context, projectId string, region string) ApiV2beta1CreateSnapshotRequest { + return ApiV2beta1CreateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return Snapshot +func (a *DefaultAPIService) V2beta1CreateSnapshotExecute(r ApiV2beta1CreateSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1CreateSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.v2beta1CreateSnapshotPayload == nil { + return localVarReturnValue, reportError("v2beta1CreateSnapshotPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.v2beta1CreateSnapshotPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1DeleteNetworkAreaRegionRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string +} + +func (r ApiV2beta1DeleteNetworkAreaRegionRequest) Execute() error { + return r.ApiService.V2beta1DeleteNetworkAreaRegionExecute(r) +} + +/* +V2beta1DeleteNetworkAreaRegion Delete a configuration of region for a network area. + +Delete a current configuration of region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiV2beta1DeleteNetworkAreaRegionRequest +*/ +func (a *DefaultAPIService) V2beta1DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1DeleteNetworkAreaRegionRequest { + return ApiV2beta1DeleteNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) V2beta1DeleteNetworkAreaRegionExecute(r ApiV2beta1DeleteNetworkAreaRegionRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1DeleteNetworkAreaRegion") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiV2beta1DeleteSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + snapshotId string +} + +func (r ApiV2beta1DeleteSnapshotRequest) Execute() error { + return r.ApiService.V2beta1DeleteSnapshotExecute(r) +} + +/* +V2beta1DeleteSnapshot Delete a snapshot. + +Delete a snapshot that is part of the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiV2beta1DeleteSnapshotRequest +*/ +func (a *DefaultAPIService) V2beta1DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1DeleteSnapshotRequest { + return ApiV2beta1DeleteSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) V2beta1DeleteSnapshotExecute(r ApiV2beta1DeleteSnapshotRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1DeleteSnapshot") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return reportError("snapshotId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiV2beta1GetAreaRegionRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string +} + +func (r ApiV2beta1GetAreaRegionRequest) Execute() (*RegionalArea, error) { + return r.ApiService.V2beta1GetAreaRegionExecute(r) +} + +/* +V2beta1GetAreaRegion Get details about a configured region. + +Get details about a configured region in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiV2beta1GetAreaRegionRequest +*/ +func (a *DefaultAPIService) V2beta1GetAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1GetAreaRegionRequest { + return ApiV2beta1GetAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RegionalArea +func (a *DefaultAPIService) V2beta1GetAreaRegionExecute(r ApiV2beta1GetAreaRegionRequest) (*RegionalArea, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegionalArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1GetAreaRegion") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1GetSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + snapshotId string +} + +func (r ApiV2beta1GetSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.V2beta1GetSnapshotExecute(r) +} + +/* +V2beta1GetSnapshot Get details about a snapshot. + +Get details about a block device snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiV2beta1GetSnapshotRequest +*/ +func (a *DefaultAPIService) V2beta1GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1GetSnapshotRequest { + return ApiV2beta1GetSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// Execute executes the request +// +// @return Snapshot +func (a *DefaultAPIService) V2beta1GetSnapshotExecute(r ApiV2beta1GetSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1GetSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return localVarReturnValue, reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return localVarReturnValue, reportError("snapshotId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1ListAreaRegionsRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string +} + +func (r ApiV2beta1ListAreaRegionsRequest) Execute() (*RegionalAreaListResponse, error) { + return r.ApiService.V2beta1ListAreaRegionsExecute(r) +} + +/* +V2beta1ListAreaRegions List all configured regions in a network area. + +Get a list of all configured regions. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @return ApiV2beta1ListAreaRegionsRequest +*/ +func (a *DefaultAPIService) V2beta1ListAreaRegions(ctx context.Context, organizationId string, areaId string) ApiV2beta1ListAreaRegionsRequest { + return ApiV2beta1ListAreaRegionsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// Execute executes the request +// +// @return RegionalAreaListResponse +func (a *DefaultAPIService) V2beta1ListAreaRegionsExecute(r ApiV2beta1ListAreaRegionsRequest) (*RegionalAreaListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegionalAreaListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1ListAreaRegions") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1ListSnapshotsInProjectRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + labelSelector *string +} + +// Filter resources by labels. +func (r ApiV2beta1ListSnapshotsInProjectRequest) LabelSelector(labelSelector string) ApiV2beta1ListSnapshotsInProjectRequest { + r.labelSelector = &labelSelector + return r +} + +func (r ApiV2beta1ListSnapshotsInProjectRequest) Execute() (*SnapshotListResponse, error) { + return r.ApiService.V2beta1ListSnapshotsInProjectExecute(r) +} + +/* +V2beta1ListSnapshotsInProject List all snapshots inside a project. + +Get a list of all snapshots inside a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @return ApiV2beta1ListSnapshotsInProjectRequest +*/ +func (a *DefaultAPIService) V2beta1ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiV2beta1ListSnapshotsInProjectRequest { + return ApiV2beta1ListSnapshotsInProjectRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// Execute executes the request +// +// @return SnapshotListResponse +func (a *DefaultAPIService) V2beta1ListSnapshotsInProjectExecute(r ApiV2beta1ListSnapshotsInProjectRequest) (*SnapshotListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SnapshotListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1ListSnapshotsInProject") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/snapshots" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + if r.labelSelector != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "label_selector", r.labelSelector, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1UpdateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + backupId string + v2beta1UpdateBackupPayload *V2beta1UpdateBackupPayload +} + +// Request an update of a backup. +func (r ApiV2beta1UpdateBackupRequest) V2beta1UpdateBackupPayload(v2beta1UpdateBackupPayload V2beta1UpdateBackupPayload) ApiV2beta1UpdateBackupRequest { + r.v2beta1UpdateBackupPayload = &v2beta1UpdateBackupPayload + return r +} + +func (r ApiV2beta1UpdateBackupRequest) Execute() (*Backup, error) { + return r.ApiService.V2beta1UpdateBackupExecute(r) +} + +/* +V2beta1UpdateBackup Update information of a backup. + +Update name or labels of the backup. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param backupId The identifier (ID) of a STACKIT Backup. + @return ApiV2beta1UpdateBackupRequest +*/ +func (a *DefaultAPIService) V2beta1UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiV2beta1UpdateBackupRequest { + return ApiV2beta1UpdateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return Backup +func (a *DefaultAPIService) V2beta1UpdateBackupExecute(r ApiV2beta1UpdateBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1UpdateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.backupId) < 36 { + return localVarReturnValue, reportError("backupId must have at least 36 elements") + } + if strlen(r.backupId) > 36 { + return localVarReturnValue, reportError("backupId must have less than 36 elements") + } + if r.v2beta1UpdateBackupPayload == nil { + return localVarReturnValue, reportError("v2beta1UpdateBackupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.v2beta1UpdateBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1UpdateNetworkAreaRegionRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + v2beta1UpdateNetworkAreaRegionPayload *V2beta1UpdateNetworkAreaRegionPayload +} + +// Request an update of a regional network area. +func (r ApiV2beta1UpdateNetworkAreaRegionRequest) V2beta1UpdateNetworkAreaRegionPayload(v2beta1UpdateNetworkAreaRegionPayload V2beta1UpdateNetworkAreaRegionPayload) ApiV2beta1UpdateNetworkAreaRegionRequest { + r.v2beta1UpdateNetworkAreaRegionPayload = &v2beta1UpdateNetworkAreaRegionPayload + return r +} + +func (r ApiV2beta1UpdateNetworkAreaRegionRequest) Execute() (*RegionalArea, error) { + return r.ApiService.V2beta1UpdateNetworkAreaRegionExecute(r) +} + +/* +V2beta1UpdateNetworkAreaRegion Update a region for a network area. + +Update a new region for a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @return ApiV2beta1UpdateNetworkAreaRegionRequest +*/ +func (a *DefaultAPIService) V2beta1UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1UpdateNetworkAreaRegionRequest { + return ApiV2beta1UpdateNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// Execute executes the request +// +// @return RegionalArea +func (a *DefaultAPIService) V2beta1UpdateNetworkAreaRegionExecute(r ApiV2beta1UpdateNetworkAreaRegionRequest) (*RegionalArea, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RegionalArea + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1UpdateNetworkAreaRegion") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if r.v2beta1UpdateNetworkAreaRegionPayload == nil { + return localVarReturnValue, reportError("v2beta1UpdateNetworkAreaRegionPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.v2beta1UpdateNetworkAreaRegionPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1UpdateRouteOfAreaRequest struct { + ctx context.Context + ApiService DefaultAPI + organizationId string + areaId string + region string + routeId string + v2beta1UpdateRouteOfAreaPayload *V2beta1UpdateRouteOfAreaPayload +} + +// Request an update of a network route. +func (r ApiV2beta1UpdateRouteOfAreaRequest) V2beta1UpdateRouteOfAreaPayload(v2beta1UpdateRouteOfAreaPayload V2beta1UpdateRouteOfAreaPayload) ApiV2beta1UpdateRouteOfAreaRequest { + r.v2beta1UpdateRouteOfAreaPayload = &v2beta1UpdateRouteOfAreaPayload + return r +} + +func (r ApiV2beta1UpdateRouteOfAreaRequest) Execute() (*Route, error) { + return r.ApiService.V2beta1UpdateRouteOfAreaExecute(r) +} + +/* +V2beta1UpdateRouteOfArea Update a network route. + +Update a network route defined in a network area. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param organizationId The identifier (ID) of a STACKIT Organization. + @param areaId The identifier (ID) of a STACKIT Network Area. + @param region The STACKIT Region of the resources. + @param routeId The identifier (ID) of a STACKIT Route. + @return ApiV2beta1UpdateRouteOfAreaRequest +*/ +func (a *DefaultAPIService) V2beta1UpdateRouteOfArea(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiV2beta1UpdateRouteOfAreaRequest { + return ApiV2beta1UpdateRouteOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// Execute executes the request +// +// @return Route +func (a *DefaultAPIService) V2beta1UpdateRouteOfAreaExecute(r ApiV2beta1UpdateRouteOfAreaRequest) (*Route, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Route + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1UpdateRouteOfArea") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/organizations/{organizationId}/network-areas/{areaId}/regions/{region}/routes/{routeId}" + localVarPath = strings.Replace(localVarPath, "{"+"organizationId"+"}", url.PathEscape(parameterValueToString(r.organizationId, "organizationId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"areaId"+"}", url.PathEscape(parameterValueToString(r.areaId, "areaId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"routeId"+"}", url.PathEscape(parameterValueToString(r.routeId, "routeId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.organizationId) < 36 { + return localVarReturnValue, reportError("organizationId must have at least 36 elements") + } + if strlen(r.organizationId) > 36 { + return localVarReturnValue, reportError("organizationId must have less than 36 elements") + } + if strlen(r.areaId) < 36 { + return localVarReturnValue, reportError("areaId must have at least 36 elements") + } + if strlen(r.areaId) > 36 { + return localVarReturnValue, reportError("areaId must have less than 36 elements") + } + if strlen(r.routeId) < 36 { + return localVarReturnValue, reportError("routeId must have at least 36 elements") + } + if strlen(r.routeId) > 36 { + return localVarReturnValue, reportError("routeId must have less than 36 elements") + } + if r.v2beta1UpdateRouteOfAreaPayload == nil { + return localVarReturnValue, reportError("v2beta1UpdateRouteOfAreaPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.v2beta1UpdateRouteOfAreaPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1UpdateSecurityGroupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + securityGroupId string + v2beta1UpdateSecurityGroupPayload *V2beta1UpdateSecurityGroupPayload +} + +// Request an update of a security group. +func (r ApiV2beta1UpdateSecurityGroupRequest) V2beta1UpdateSecurityGroupPayload(v2beta1UpdateSecurityGroupPayload V2beta1UpdateSecurityGroupPayload) ApiV2beta1UpdateSecurityGroupRequest { + r.v2beta1UpdateSecurityGroupPayload = &v2beta1UpdateSecurityGroupPayload + return r +} + +func (r ApiV2beta1UpdateSecurityGroupRequest) Execute() (*SecurityGroup, error) { + return r.ApiService.V2beta1UpdateSecurityGroupExecute(r) +} + +/* +V2beta1UpdateSecurityGroup Update information of a security group. + +Update labels of the security group. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param securityGroupId The identifier (ID) of a STACKIT Security Group. + @return ApiV2beta1UpdateSecurityGroupRequest +*/ +func (a *DefaultAPIService) V2beta1UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiV2beta1UpdateSecurityGroupRequest { + return ApiV2beta1UpdateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// Execute executes the request +// +// @return SecurityGroup +func (a *DefaultAPIService) V2beta1UpdateSecurityGroupExecute(r ApiV2beta1UpdateSecurityGroupRequest) (*SecurityGroup, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *SecurityGroup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1UpdateSecurityGroup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/security-groups/{securityGroupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"securityGroupId"+"}", url.PathEscape(parameterValueToString(r.securityGroupId, "securityGroupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.securityGroupId) < 36 { + return localVarReturnValue, reportError("securityGroupId must have at least 36 elements") + } + if strlen(r.securityGroupId) > 36 { + return localVarReturnValue, reportError("securityGroupId must have less than 36 elements") + } + if r.v2beta1UpdateSecurityGroupPayload == nil { + return localVarReturnValue, reportError("v2beta1UpdateSecurityGroupPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.v2beta1UpdateSecurityGroupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiV2beta1UpdateSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + snapshotId string + v2beta1UpdateSnapshotPayload *V2beta1UpdateSnapshotPayload +} + +// Request an update of a snapshot. +func (r ApiV2beta1UpdateSnapshotRequest) V2beta1UpdateSnapshotPayload(v2beta1UpdateSnapshotPayload V2beta1UpdateSnapshotPayload) ApiV2beta1UpdateSnapshotRequest { + r.v2beta1UpdateSnapshotPayload = &v2beta1UpdateSnapshotPayload + return r +} + +func (r ApiV2beta1UpdateSnapshotRequest) Execute() (*Snapshot, error) { + return r.ApiService.V2beta1UpdateSnapshotExecute(r) +} + +/* +V2beta1UpdateSnapshot Update information of the snapshot. + +Update information like name or labels of the snapshot. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId The identifier (ID) of a STACKIT Project. + @param region The STACKIT Region of the resources. + @param snapshotId The identifier (ID) of a STACKIT Snapshot. + @return ApiV2beta1UpdateSnapshotRequest +*/ +func (a *DefaultAPIService) V2beta1UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1UpdateSnapshotRequest { + return ApiV2beta1UpdateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// Execute executes the request +// +// @return Snapshot +func (a *DefaultAPIService) V2beta1UpdateSnapshotExecute(r ApiV2beta1UpdateSnapshotRequest) (*Snapshot, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Snapshot + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.V2beta1UpdateSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2beta1/projects/{projectId}/regions/{region}/snapshots/{snapshotId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotId"+"}", url.PathEscape(parameterValueToString(r.snapshotId, "snapshotId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.snapshotId) < 36 { + return localVarReturnValue, reportError("snapshotId must have at least 36 elements") + } + if strlen(r.snapshotId) > 36 { + return localVarReturnValue, reportError("snapshotId must have less than 36 elements") + } + if r.v2beta1UpdateSnapshotPayload == nil { + return localVarReturnValue, reportError("v2beta1UpdateSnapshotPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.v2beta1UpdateSnapshotPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/iaas/v2beta1api/api_default_mock.go b/services/iaas/v2beta1api/api_default_mock.go new file mode 100644 index 000000000..9d1db5051 --- /dev/null +++ b/services/iaas/v2beta1api/api_default_mock.go @@ -0,0 +1,2940 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // AddNetworkToServerExecuteMock can be populated to implement the behavior of the AddNetworkToServerExecute function of this mock + AddNetworkToServerExecuteMock *func(r ApiAddNetworkToServerRequest) error + // AddNicToServerExecuteMock can be populated to implement the behavior of the AddNicToServerExecute function of this mock + AddNicToServerExecuteMock *func(r ApiAddNicToServerRequest) error + // AddPublicIpToServerExecuteMock can be populated to implement the behavior of the AddPublicIpToServerExecute function of this mock + AddPublicIpToServerExecuteMock *func(r ApiAddPublicIpToServerRequest) error + // AddRoutesToRoutingTableExecuteMock can be populated to implement the behavior of the AddRoutesToRoutingTableExecute function of this mock + AddRoutesToRoutingTableExecuteMock *func(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) + // AddRoutingTableToAreaExecuteMock can be populated to implement the behavior of the AddRoutingTableToAreaExecute function of this mock + AddRoutingTableToAreaExecuteMock *func(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) + // AddSecurityGroupToServerExecuteMock can be populated to implement the behavior of the AddSecurityGroupToServerExecute function of this mock + AddSecurityGroupToServerExecuteMock *func(r ApiAddSecurityGroupToServerRequest) error + // AddServiceAccountToServerExecuteMock can be populated to implement the behavior of the AddServiceAccountToServerExecute function of this mock + AddServiceAccountToServerExecuteMock *func(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) + // AddVolumeToServerExecuteMock can be populated to implement the behavior of the AddVolumeToServerExecute function of this mock + AddVolumeToServerExecuteMock *func(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) + // CreateAffinityGroupExecuteMock can be populated to implement the behavior of the CreateAffinityGroupExecute function of this mock + CreateAffinityGroupExecuteMock *func(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) (*Backup, error) + // CreateImageExecuteMock can be populated to implement the behavior of the CreateImageExecute function of this mock + CreateImageExecuteMock *func(r ApiCreateImageRequest) (*ImageCreateResponse, error) + // CreateIsolatedNetworkExecuteMock can be populated to implement the behavior of the CreateIsolatedNetworkExecute function of this mock + CreateIsolatedNetworkExecuteMock *func(r ApiCreateIsolatedNetworkRequest) (*Network, error) + // CreateKeyPairExecuteMock can be populated to implement the behavior of the CreateKeyPairExecute function of this mock + CreateKeyPairExecuteMock *func(r ApiCreateKeyPairRequest) (*Keypair, error) + // CreateNetworkExecuteMock can be populated to implement the behavior of the CreateNetworkExecute function of this mock + CreateNetworkExecuteMock *func(r ApiCreateNetworkRequest) (*Network, error) + // CreateNetworkAreaExecuteMock can be populated to implement the behavior of the CreateNetworkAreaExecute function of this mock + CreateNetworkAreaExecuteMock *func(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) + // CreateNetworkAreaRangeExecuteMock can be populated to implement the behavior of the CreateNetworkAreaRangeExecute function of this mock + CreateNetworkAreaRangeExecuteMock *func(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) + // CreateNetworkAreaRouteExecuteMock can be populated to implement the behavior of the CreateNetworkAreaRouteExecute function of this mock + CreateNetworkAreaRouteExecuteMock *func(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) + // CreateNicExecuteMock can be populated to implement the behavior of the CreateNicExecute function of this mock + CreateNicExecuteMock *func(r ApiCreateNicRequest) (*NIC, error) + // CreatePublicIPExecuteMock can be populated to implement the behavior of the CreatePublicIPExecute function of this mock + CreatePublicIPExecuteMock *func(r ApiCreatePublicIPRequest) (*PublicIp, error) + // CreateSecurityGroupExecuteMock can be populated to implement the behavior of the CreateSecurityGroupExecute function of this mock + CreateSecurityGroupExecuteMock *func(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) + // CreateSecurityGroupRuleExecuteMock can be populated to implement the behavior of the CreateSecurityGroupRuleExecute function of this mock + CreateSecurityGroupRuleExecuteMock *func(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) + // CreateServerExecuteMock can be populated to implement the behavior of the CreateServerExecute function of this mock + CreateServerExecuteMock *func(r ApiCreateServerRequest) (*Server, error) + // CreateVolumeExecuteMock can be populated to implement the behavior of the CreateVolumeExecute function of this mock + CreateVolumeExecuteMock *func(r ApiCreateVolumeRequest) (*Volume, error) + // DeallocateServerExecuteMock can be populated to implement the behavior of the DeallocateServerExecute function of this mock + DeallocateServerExecuteMock *func(r ApiDeallocateServerRequest) error + // DeleteAffinityGroupExecuteMock can be populated to implement the behavior of the DeleteAffinityGroupExecute function of this mock + DeleteAffinityGroupExecuteMock *func(r ApiDeleteAffinityGroupRequest) error + // DeleteBackupExecuteMock can be populated to implement the behavior of the DeleteBackupExecute function of this mock + DeleteBackupExecuteMock *func(r ApiDeleteBackupRequest) error + // DeleteImageExecuteMock can be populated to implement the behavior of the DeleteImageExecute function of this mock + DeleteImageExecuteMock *func(r ApiDeleteImageRequest) error + // DeleteImageShareExecuteMock can be populated to implement the behavior of the DeleteImageShareExecute function of this mock + DeleteImageShareExecuteMock *func(r ApiDeleteImageShareRequest) error + // DeleteImageShareConsumerExecuteMock can be populated to implement the behavior of the DeleteImageShareConsumerExecute function of this mock + DeleteImageShareConsumerExecuteMock *func(r ApiDeleteImageShareConsumerRequest) error + // DeleteKeyPairExecuteMock can be populated to implement the behavior of the DeleteKeyPairExecute function of this mock + DeleteKeyPairExecuteMock *func(r ApiDeleteKeyPairRequest) error + // DeleteNetworkExecuteMock can be populated to implement the behavior of the DeleteNetworkExecute function of this mock + DeleteNetworkExecuteMock *func(r ApiDeleteNetworkRequest) error + // DeleteNetworkAreaExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaExecute function of this mock + DeleteNetworkAreaExecuteMock *func(r ApiDeleteNetworkAreaRequest) error + // DeleteNetworkAreaRangeExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaRangeExecute function of this mock + DeleteNetworkAreaRangeExecuteMock *func(r ApiDeleteNetworkAreaRangeRequest) error + // DeleteNetworkAreaRouteExecuteMock can be populated to implement the behavior of the DeleteNetworkAreaRouteExecute function of this mock + DeleteNetworkAreaRouteExecuteMock *func(r ApiDeleteNetworkAreaRouteRequest) error + // DeleteNicExecuteMock can be populated to implement the behavior of the DeleteNicExecute function of this mock + DeleteNicExecuteMock *func(r ApiDeleteNicRequest) error + // DeletePublicIPExecuteMock can be populated to implement the behavior of the DeletePublicIPExecute function of this mock + DeletePublicIPExecuteMock *func(r ApiDeletePublicIPRequest) error + // DeleteRouteFromRoutingTableExecuteMock can be populated to implement the behavior of the DeleteRouteFromRoutingTableExecute function of this mock + DeleteRouteFromRoutingTableExecuteMock *func(r ApiDeleteRouteFromRoutingTableRequest) error + // DeleteRoutingTableFromAreaExecuteMock can be populated to implement the behavior of the DeleteRoutingTableFromAreaExecute function of this mock + DeleteRoutingTableFromAreaExecuteMock *func(r ApiDeleteRoutingTableFromAreaRequest) error + // DeleteSecurityGroupExecuteMock can be populated to implement the behavior of the DeleteSecurityGroupExecute function of this mock + DeleteSecurityGroupExecuteMock *func(r ApiDeleteSecurityGroupRequest) error + // DeleteSecurityGroupRuleExecuteMock can be populated to implement the behavior of the DeleteSecurityGroupRuleExecute function of this mock + DeleteSecurityGroupRuleExecuteMock *func(r ApiDeleteSecurityGroupRuleRequest) error + // DeleteServerExecuteMock can be populated to implement the behavior of the DeleteServerExecute function of this mock + DeleteServerExecuteMock *func(r ApiDeleteServerRequest) error + // DeleteVolumeExecuteMock can be populated to implement the behavior of the DeleteVolumeExecute function of this mock + DeleteVolumeExecuteMock *func(r ApiDeleteVolumeRequest) error + // GetAffinityGroupExecuteMock can be populated to implement the behavior of the GetAffinityGroupExecute function of this mock + GetAffinityGroupExecuteMock *func(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) + // GetAttachedVolumeExecuteMock can be populated to implement the behavior of the GetAttachedVolumeExecute function of this mock + GetAttachedVolumeExecuteMock *func(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*Backup, error) + // GetImageExecuteMock can be populated to implement the behavior of the GetImageExecute function of this mock + GetImageExecuteMock *func(r ApiGetImageRequest) (*Image, error) + // GetImageShareExecuteMock can be populated to implement the behavior of the GetImageShareExecute function of this mock + GetImageShareExecuteMock *func(r ApiGetImageShareRequest) (*ImageShare, error) + // GetImageShareConsumerExecuteMock can be populated to implement the behavior of the GetImageShareConsumerExecute function of this mock + GetImageShareConsumerExecuteMock *func(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) + // GetKeyPairExecuteMock can be populated to implement the behavior of the GetKeyPairExecute function of this mock + GetKeyPairExecuteMock *func(r ApiGetKeyPairRequest) (*Keypair, error) + // GetMachineTypeExecuteMock can be populated to implement the behavior of the GetMachineTypeExecute function of this mock + GetMachineTypeExecuteMock *func(r ApiGetMachineTypeRequest) (*MachineType, error) + // GetNetworkExecuteMock can be populated to implement the behavior of the GetNetworkExecute function of this mock + GetNetworkExecuteMock *func(r ApiGetNetworkRequest) (*Network, error) + // GetNetworkAreaExecuteMock can be populated to implement the behavior of the GetNetworkAreaExecute function of this mock + GetNetworkAreaExecuteMock *func(r ApiGetNetworkAreaRequest) (*NetworkArea, error) + // GetNetworkAreaRangeExecuteMock can be populated to implement the behavior of the GetNetworkAreaRangeExecute function of this mock + GetNetworkAreaRangeExecuteMock *func(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) + // GetNetworkAreaRouteExecuteMock can be populated to implement the behavior of the GetNetworkAreaRouteExecute function of this mock + GetNetworkAreaRouteExecuteMock *func(r ApiGetNetworkAreaRouteRequest) (*Route, error) + // GetNicExecuteMock can be populated to implement the behavior of the GetNicExecute function of this mock + GetNicExecuteMock *func(r ApiGetNicRequest) (*NIC, error) + // GetOrganizationRequestExecuteMock can be populated to implement the behavior of the GetOrganizationRequestExecute function of this mock + GetOrganizationRequestExecuteMock *func(r ApiGetOrganizationRequestRequest) (*Request, error) + // GetProjectDetailsExecuteMock can be populated to implement the behavior of the GetProjectDetailsExecute function of this mock + GetProjectDetailsExecuteMock *func(r ApiGetProjectDetailsRequest) (*Project, error) + // GetProjectNICExecuteMock can be populated to implement the behavior of the GetProjectNICExecute function of this mock + GetProjectNICExecuteMock *func(r ApiGetProjectNICRequest) (*NIC, error) + // GetProjectRequestExecuteMock can be populated to implement the behavior of the GetProjectRequestExecute function of this mock + GetProjectRequestExecuteMock *func(r ApiGetProjectRequestRequest) (*Request, error) + // GetPublicIPExecuteMock can be populated to implement the behavior of the GetPublicIPExecute function of this mock + GetPublicIPExecuteMock *func(r ApiGetPublicIPRequest) (*PublicIp, error) + // GetRouteOfRoutingTableExecuteMock can be populated to implement the behavior of the GetRouteOfRoutingTableExecute function of this mock + GetRouteOfRoutingTableExecuteMock *func(r ApiGetRouteOfRoutingTableRequest) (*Route, error) + // GetRoutingTableOfAreaExecuteMock can be populated to implement the behavior of the GetRoutingTableOfAreaExecute function of this mock + GetRoutingTableOfAreaExecuteMock *func(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) + // GetSecurityGroupExecuteMock can be populated to implement the behavior of the GetSecurityGroupExecute function of this mock + GetSecurityGroupExecuteMock *func(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) + // GetSecurityGroupRuleExecuteMock can be populated to implement the behavior of the GetSecurityGroupRuleExecute function of this mock + GetSecurityGroupRuleExecuteMock *func(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) + // GetServerExecuteMock can be populated to implement the behavior of the GetServerExecute function of this mock + GetServerExecuteMock *func(r ApiGetServerRequest) (*Server, error) + // GetServerConsoleExecuteMock can be populated to implement the behavior of the GetServerConsoleExecute function of this mock + GetServerConsoleExecuteMock *func(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) + // GetServerLogExecuteMock can be populated to implement the behavior of the GetServerLogExecute function of this mock + GetServerLogExecuteMock *func(r ApiGetServerLogRequest) (*GetServerLog200Response, error) + // GetVolumeExecuteMock can be populated to implement the behavior of the GetVolumeExecute function of this mock + GetVolumeExecuteMock *func(r ApiGetVolumeRequest) (*Volume, error) + // GetVolumePerformanceClassExecuteMock can be populated to implement the behavior of the GetVolumePerformanceClassExecute function of this mock + GetVolumePerformanceClassExecuteMock *func(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) + // ListAffinityGroupsExecuteMock can be populated to implement the behavior of the ListAffinityGroupsExecute function of this mock + ListAffinityGroupsExecuteMock *func(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) + // ListAttachedVolumesExecuteMock can be populated to implement the behavior of the ListAttachedVolumesExecute function of this mock + ListAttachedVolumesExecuteMock *func(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) + // ListAvailabilityZonesExecuteMock can be populated to implement the behavior of the ListAvailabilityZonesExecute function of this mock + ListAvailabilityZonesExecuteMock *func(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*BackupListResponse, error) + // ListImagesExecuteMock can be populated to implement the behavior of the ListImagesExecute function of this mock + ListImagesExecuteMock *func(r ApiListImagesRequest) (*ImageListResponse, error) + // ListKeyPairsExecuteMock can be populated to implement the behavior of the ListKeyPairsExecute function of this mock + ListKeyPairsExecuteMock *func(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) + // ListMachineTypesExecuteMock can be populated to implement the behavior of the ListMachineTypesExecute function of this mock + ListMachineTypesExecuteMock *func(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) + // ListNetworkAreaProjectsExecuteMock can be populated to implement the behavior of the ListNetworkAreaProjectsExecute function of this mock + ListNetworkAreaProjectsExecuteMock *func(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) + // ListNetworkAreaRangesExecuteMock can be populated to implement the behavior of the ListNetworkAreaRangesExecute function of this mock + ListNetworkAreaRangesExecuteMock *func(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) + // ListNetworkAreaRoutesExecuteMock can be populated to implement the behavior of the ListNetworkAreaRoutesExecute function of this mock + ListNetworkAreaRoutesExecuteMock *func(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) + // ListNetworkAreasExecuteMock can be populated to implement the behavior of the ListNetworkAreasExecute function of this mock + ListNetworkAreasExecuteMock *func(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) + // ListNetworksExecuteMock can be populated to implement the behavior of the ListNetworksExecute function of this mock + ListNetworksExecuteMock *func(r ApiListNetworksRequest) (*NetworkListResponse, error) + // ListNicsExecuteMock can be populated to implement the behavior of the ListNicsExecute function of this mock + ListNicsExecuteMock *func(r ApiListNicsRequest) (*NICListResponse, error) + // ListProjectNICsExecuteMock can be populated to implement the behavior of the ListProjectNICsExecute function of this mock + ListProjectNICsExecuteMock *func(r ApiListProjectNICsRequest) (*NICListResponse, error) + // ListPublicIPRangesExecuteMock can be populated to implement the behavior of the ListPublicIPRangesExecute function of this mock + ListPublicIPRangesExecuteMock *func(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) + // ListPublicIPsExecuteMock can be populated to implement the behavior of the ListPublicIPsExecute function of this mock + ListPublicIPsExecuteMock *func(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) + // ListQuotasExecuteMock can be populated to implement the behavior of the ListQuotasExecute function of this mock + ListQuotasExecuteMock *func(r ApiListQuotasRequest) (*QuotaListResponse, error) + // ListRoutesOfRoutingTableExecuteMock can be populated to implement the behavior of the ListRoutesOfRoutingTableExecute function of this mock + ListRoutesOfRoutingTableExecuteMock *func(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) + // ListRoutingTablesOfAreaExecuteMock can be populated to implement the behavior of the ListRoutingTablesOfAreaExecute function of this mock + ListRoutingTablesOfAreaExecuteMock *func(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) + // ListSecurityGroupRulesExecuteMock can be populated to implement the behavior of the ListSecurityGroupRulesExecute function of this mock + ListSecurityGroupRulesExecuteMock *func(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) + // ListSecurityGroupsExecuteMock can be populated to implement the behavior of the ListSecurityGroupsExecute function of this mock + ListSecurityGroupsExecuteMock *func(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) + // ListServerNICsExecuteMock can be populated to implement the behavior of the ListServerNICsExecute function of this mock + ListServerNICsExecuteMock *func(r ApiListServerNICsRequest) (*NICListResponse, error) + // ListServerServiceAccountsExecuteMock can be populated to implement the behavior of the ListServerServiceAccountsExecute function of this mock + ListServerServiceAccountsExecuteMock *func(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) + // ListServersExecuteMock can be populated to implement the behavior of the ListServersExecute function of this mock + ListServersExecuteMock *func(r ApiListServersRequest) (*ServerListResponse, error) + // ListVolumePerformanceClassesExecuteMock can be populated to implement the behavior of the ListVolumePerformanceClassesExecute function of this mock + ListVolumePerformanceClassesExecuteMock *func(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) + // ListVolumesExecuteMock can be populated to implement the behavior of the ListVolumesExecute function of this mock + ListVolumesExecuteMock *func(r ApiListVolumesRequest) (*VolumeListResponse, error) + // PartialUpdateNetworkExecuteMock can be populated to implement the behavior of the PartialUpdateNetworkExecute function of this mock + PartialUpdateNetworkExecuteMock *func(r ApiPartialUpdateNetworkRequest) error + // PartialUpdateNetworkAreaExecuteMock can be populated to implement the behavior of the PartialUpdateNetworkAreaExecute function of this mock + PartialUpdateNetworkAreaExecuteMock *func(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) + // RebootServerExecuteMock can be populated to implement the behavior of the RebootServerExecute function of this mock + RebootServerExecuteMock *func(r ApiRebootServerRequest) error + // RemoveNetworkFromServerExecuteMock can be populated to implement the behavior of the RemoveNetworkFromServerExecute function of this mock + RemoveNetworkFromServerExecuteMock *func(r ApiRemoveNetworkFromServerRequest) error + // RemoveNicFromServerExecuteMock can be populated to implement the behavior of the RemoveNicFromServerExecute function of this mock + RemoveNicFromServerExecuteMock *func(r ApiRemoveNicFromServerRequest) error + // RemovePublicIpFromServerExecuteMock can be populated to implement the behavior of the RemovePublicIpFromServerExecute function of this mock + RemovePublicIpFromServerExecuteMock *func(r ApiRemovePublicIpFromServerRequest) error + // RemoveSecurityGroupFromServerExecuteMock can be populated to implement the behavior of the RemoveSecurityGroupFromServerExecute function of this mock + RemoveSecurityGroupFromServerExecuteMock *func(r ApiRemoveSecurityGroupFromServerRequest) error + // RemoveServiceAccountFromServerExecuteMock can be populated to implement the behavior of the RemoveServiceAccountFromServerExecute function of this mock + RemoveServiceAccountFromServerExecuteMock *func(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) + // RemoveVolumeFromServerExecuteMock can be populated to implement the behavior of the RemoveVolumeFromServerExecute function of this mock + RemoveVolumeFromServerExecuteMock *func(r ApiRemoveVolumeFromServerRequest) error + // RescueServerExecuteMock can be populated to implement the behavior of the RescueServerExecute function of this mock + RescueServerExecuteMock *func(r ApiRescueServerRequest) error + // ResizeServerExecuteMock can be populated to implement the behavior of the ResizeServerExecute function of this mock + ResizeServerExecuteMock *func(r ApiResizeServerRequest) error + // ResizeVolumeExecuteMock can be populated to implement the behavior of the ResizeVolumeExecute function of this mock + ResizeVolumeExecuteMock *func(r ApiResizeVolumeRequest) error + // RestoreBackupExecuteMock can be populated to implement the behavior of the RestoreBackupExecute function of this mock + RestoreBackupExecuteMock *func(r ApiRestoreBackupRequest) error + // SetImageShareExecuteMock can be populated to implement the behavior of the SetImageShareExecute function of this mock + SetImageShareExecuteMock *func(r ApiSetImageShareRequest) (*ImageShare, error) + // StartServerExecuteMock can be populated to implement the behavior of the StartServerExecute function of this mock + StartServerExecuteMock *func(r ApiStartServerRequest) error + // StopServerExecuteMock can be populated to implement the behavior of the StopServerExecute function of this mock + StopServerExecuteMock *func(r ApiStopServerRequest) error + // UnrescueServerExecuteMock can be populated to implement the behavior of the UnrescueServerExecute function of this mock + UnrescueServerExecuteMock *func(r ApiUnrescueServerRequest) error + // UpdateAttachedVolumeExecuteMock can be populated to implement the behavior of the UpdateAttachedVolumeExecute function of this mock + UpdateAttachedVolumeExecuteMock *func(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) + // UpdateImageExecuteMock can be populated to implement the behavior of the UpdateImageExecute function of this mock + UpdateImageExecuteMock *func(r ApiUpdateImageRequest) (*Image, error) + // UpdateImageShareExecuteMock can be populated to implement the behavior of the UpdateImageShareExecute function of this mock + UpdateImageShareExecuteMock *func(r ApiUpdateImageShareRequest) (*ImageShare, error) + // UpdateKeyPairExecuteMock can be populated to implement the behavior of the UpdateKeyPairExecute function of this mock + UpdateKeyPairExecuteMock *func(r ApiUpdateKeyPairRequest) (*Keypair, error) + // UpdateNicExecuteMock can be populated to implement the behavior of the UpdateNicExecute function of this mock + UpdateNicExecuteMock *func(r ApiUpdateNicRequest) (*NIC, error) + // UpdatePublicIPExecuteMock can be populated to implement the behavior of the UpdatePublicIPExecute function of this mock + UpdatePublicIPExecuteMock *func(r ApiUpdatePublicIPRequest) (*PublicIp, error) + // UpdateRouteOfRoutingTableExecuteMock can be populated to implement the behavior of the UpdateRouteOfRoutingTableExecute function of this mock + UpdateRouteOfRoutingTableExecuteMock *func(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) + // UpdateRoutingTableOfAreaExecuteMock can be populated to implement the behavior of the UpdateRoutingTableOfAreaExecute function of this mock + UpdateRoutingTableOfAreaExecuteMock *func(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) + // UpdateServerExecuteMock can be populated to implement the behavior of the UpdateServerExecute function of this mock + UpdateServerExecuteMock *func(r ApiUpdateServerRequest) (*Server, error) + // UpdateVolumeExecuteMock can be populated to implement the behavior of the UpdateVolumeExecute function of this mock + UpdateVolumeExecuteMock *func(r ApiUpdateVolumeRequest) (*Volume, error) + // V2beta1ConfigureNetworkAreaRegionExecuteMock can be populated to implement the behavior of the V2beta1ConfigureNetworkAreaRegionExecute function of this mock + V2beta1ConfigureNetworkAreaRegionExecuteMock *func(r ApiV2beta1ConfigureNetworkAreaRegionRequest) (*RegionalArea, error) + // V2beta1CreateSnapshotExecuteMock can be populated to implement the behavior of the V2beta1CreateSnapshotExecute function of this mock + V2beta1CreateSnapshotExecuteMock *func(r ApiV2beta1CreateSnapshotRequest) (*Snapshot, error) + // V2beta1DeleteNetworkAreaRegionExecuteMock can be populated to implement the behavior of the V2beta1DeleteNetworkAreaRegionExecute function of this mock + V2beta1DeleteNetworkAreaRegionExecuteMock *func(r ApiV2beta1DeleteNetworkAreaRegionRequest) error + // V2beta1DeleteSnapshotExecuteMock can be populated to implement the behavior of the V2beta1DeleteSnapshotExecute function of this mock + V2beta1DeleteSnapshotExecuteMock *func(r ApiV2beta1DeleteSnapshotRequest) error + // V2beta1GetAreaRegionExecuteMock can be populated to implement the behavior of the V2beta1GetAreaRegionExecute function of this mock + V2beta1GetAreaRegionExecuteMock *func(r ApiV2beta1GetAreaRegionRequest) (*RegionalArea, error) + // V2beta1GetSnapshotExecuteMock can be populated to implement the behavior of the V2beta1GetSnapshotExecute function of this mock + V2beta1GetSnapshotExecuteMock *func(r ApiV2beta1GetSnapshotRequest) (*Snapshot, error) + // V2beta1ListAreaRegionsExecuteMock can be populated to implement the behavior of the V2beta1ListAreaRegionsExecute function of this mock + V2beta1ListAreaRegionsExecuteMock *func(r ApiV2beta1ListAreaRegionsRequest) (*RegionalAreaListResponse, error) + // V2beta1ListSnapshotsInProjectExecuteMock can be populated to implement the behavior of the V2beta1ListSnapshotsInProjectExecute function of this mock + V2beta1ListSnapshotsInProjectExecuteMock *func(r ApiV2beta1ListSnapshotsInProjectRequest) (*SnapshotListResponse, error) + // V2beta1UpdateBackupExecuteMock can be populated to implement the behavior of the V2beta1UpdateBackupExecute function of this mock + V2beta1UpdateBackupExecuteMock *func(r ApiV2beta1UpdateBackupRequest) (*Backup, error) + // V2beta1UpdateNetworkAreaRegionExecuteMock can be populated to implement the behavior of the V2beta1UpdateNetworkAreaRegionExecute function of this mock + V2beta1UpdateNetworkAreaRegionExecuteMock *func(r ApiV2beta1UpdateNetworkAreaRegionRequest) (*RegionalArea, error) + // V2beta1UpdateRouteOfAreaExecuteMock can be populated to implement the behavior of the V2beta1UpdateRouteOfAreaExecute function of this mock + V2beta1UpdateRouteOfAreaExecuteMock *func(r ApiV2beta1UpdateRouteOfAreaRequest) (*Route, error) + // V2beta1UpdateSecurityGroupExecuteMock can be populated to implement the behavior of the V2beta1UpdateSecurityGroupExecute function of this mock + V2beta1UpdateSecurityGroupExecuteMock *func(r ApiV2beta1UpdateSecurityGroupRequest) (*SecurityGroup, error) + // V2beta1UpdateSnapshotExecuteMock can be populated to implement the behavior of the V2beta1UpdateSnapshotExecute function of this mock + V2beta1UpdateSnapshotExecuteMock *func(r ApiV2beta1UpdateSnapshotRequest) (*Snapshot, error) +} + +func (a DefaultAPIServiceMock) AddNetworkToServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiAddNetworkToServerRequest { + return ApiAddNetworkToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + networkId: networkId, + } +} + +// AddNetworkToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddNetworkToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddNetworkToServerExecute(r ApiAddNetworkToServerRequest) error { + if a.AddNetworkToServerExecuteMock == nil { + return nil + } + + return (*a.AddNetworkToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddNicToServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiAddNicToServerRequest { + return ApiAddNicToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + nicId: nicId, + } +} + +// AddNicToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddNicToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddNicToServerExecute(r ApiAddNicToServerRequest) error { + if a.AddNicToServerExecuteMock == nil { + return nil + } + + return (*a.AddNicToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddPublicIpToServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiAddPublicIpToServerRequest { + return ApiAddPublicIpToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// AddPublicIpToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddPublicIpToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddPublicIpToServerExecute(r ApiAddPublicIpToServerRequest) error { + if a.AddPublicIpToServerExecuteMock == nil { + return nil + } + + return (*a.AddPublicIpToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddRoutesToRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiAddRoutesToRoutingTableRequest { + return ApiAddRoutesToRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// AddRoutesToRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddRoutesToRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddRoutesToRoutingTableExecute(r ApiAddRoutesToRoutingTableRequest) (*RouteListResponse, error) { + if a.AddRoutesToRoutingTableExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.AddRoutesToRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddRoutingTableToArea(ctx context.Context, organizationId string, areaId string, region string) ApiAddRoutingTableToAreaRequest { + return ApiAddRoutingTableToAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// AddRoutingTableToAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddRoutingTableToAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddRoutingTableToAreaExecute(r ApiAddRoutingTableToAreaRequest) (*RoutingTable, error) { + if a.AddRoutingTableToAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.AddRoutingTableToAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddSecurityGroupToServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiAddSecurityGroupToServerRequest { + return ApiAddSecurityGroupToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// AddSecurityGroupToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddSecurityGroupToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddSecurityGroupToServerExecute(r ApiAddSecurityGroupToServerRequest) error { + if a.AddSecurityGroupToServerExecuteMock == nil { + return nil + } + + return (*a.AddSecurityGroupToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddServiceAccountToServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiAddServiceAccountToServerRequest { + return ApiAddServiceAccountToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// AddServiceAccountToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddServiceAccountToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddServiceAccountToServerExecute(r ApiAddServiceAccountToServerRequest) (*ServiceAccountMailListResponse, error) { + if a.AddServiceAccountToServerExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.AddServiceAccountToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) AddVolumeToServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiAddVolumeToServerRequest { + return ApiAddVolumeToServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// AddVolumeToServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the AddVolumeToServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) AddVolumeToServerExecute(r ApiAddVolumeToServerRequest) (*VolumeAttachment, error) { + if a.AddVolumeToServerExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.AddVolumeToServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateAffinityGroup(ctx context.Context, projectId string, region string) ApiCreateAffinityGroupRequest { + return ApiCreateAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateAffinityGroupExecute(r ApiCreateAffinityGroupRequest) (*AffinityGroup, error) { + if a.CreateAffinityGroupExecuteMock == nil { + var localVarReturnValue *AffinityGroup + return localVarReturnValue, nil + } + + return (*a.CreateAffinityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, region string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) (*Backup, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateImage(ctx context.Context, projectId string, region string) ApiCreateImageRequest { + return ApiCreateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateImageExecute(r ApiCreateImageRequest) (*ImageCreateResponse, error) { + if a.CreateImageExecuteMock == nil { + var localVarReturnValue *ImageCreateResponse + return localVarReturnValue, nil + } + + return (*a.CreateImageExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateIsolatedNetwork(ctx context.Context, projectId string, region string) ApiCreateIsolatedNetworkRequest { + return ApiCreateIsolatedNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateIsolatedNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateIsolatedNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateIsolatedNetworkExecute(r ApiCreateIsolatedNetworkRequest) (*Network, error) { + if a.CreateIsolatedNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.CreateIsolatedNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateKeyPair(ctx context.Context) ApiCreateKeyPairRequest { + return ApiCreateKeyPairRequest{ + ApiService: a, + ctx: ctx, + } +} + +// CreateKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateKeyPairExecute(r ApiCreateKeyPairRequest) (*Keypair, error) { + if a.CreateKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.CreateKeyPairExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetwork(ctx context.Context, projectId string, region string) ApiCreateNetworkRequest { + return ApiCreateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkExecute(r ApiCreateNetworkRequest) (*Network, error) { + if a.CreateNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.CreateNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetworkArea(ctx context.Context, organizationId string) ApiCreateNetworkAreaRequest { + return ApiCreateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// CreateNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaExecute(r ApiCreateNetworkAreaRequest) (*NetworkArea, error) { + if a.CreateNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRangeRequest { + return ApiCreateNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// CreateNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaRangeExecute(r ApiCreateNetworkAreaRangeRequest) (*NetworkRangeListResponse, error) { + if a.CreateNetworkAreaRangeExecuteMock == nil { + var localVarReturnValue *NetworkRangeListResponse + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaRangeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string) ApiCreateNetworkAreaRouteRequest { + return ApiCreateNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// CreateNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNetworkAreaRouteExecute(r ApiCreateNetworkAreaRouteRequest) (*RouteListResponse, error) { + if a.CreateNetworkAreaRouteExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.CreateNetworkAreaRouteExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateNic(ctx context.Context, projectId string, region string, networkId string) ApiCreateNicRequest { + return ApiCreateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// CreateNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateNicExecute(r ApiCreateNicRequest) (*NIC, error) { + if a.CreateNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.CreateNicExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreatePublicIP(ctx context.Context, projectId string, region string) ApiCreatePublicIPRequest { + return ApiCreatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreatePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreatePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreatePublicIPExecute(r ApiCreatePublicIPRequest) (*PublicIp, error) { + if a.CreatePublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.CreatePublicIPExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateSecurityGroup(ctx context.Context, projectId string, region string) ApiCreateSecurityGroupRequest { + return ApiCreateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateSecurityGroupExecute(r ApiCreateSecurityGroupRequest) (*SecurityGroup, error) { + if a.CreateSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.CreateSecurityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string) ApiCreateSecurityGroupRuleRequest { + return ApiCreateSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// CreateSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateSecurityGroupRuleExecute(r ApiCreateSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + if a.CreateSecurityGroupRuleExecuteMock == nil { + var localVarReturnValue *SecurityGroupRule + return localVarReturnValue, nil + } + + return (*a.CreateSecurityGroupRuleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateServer(ctx context.Context, projectId string, region string) ApiCreateServerRequest { + return ApiCreateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateServerExecute(r ApiCreateServerRequest) (*Server, error) { + if a.CreateServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.CreateServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateVolume(ctx context.Context, projectId string, region string) ApiCreateVolumeRequest { + return ApiCreateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// CreateVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateVolumeExecute(r ApiCreateVolumeRequest) (*Volume, error) { + if a.CreateVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.CreateVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeallocateServer(ctx context.Context, projectId string, region string, serverId string) ApiDeallocateServerRequest { + return ApiDeallocateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// DeallocateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeallocateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeallocateServerExecute(r ApiDeallocateServerRequest) error { + if a.DeallocateServerExecuteMock == nil { + return nil + } + + return (*a.DeallocateServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiDeleteAffinityGroupRequest { + return ApiDeleteAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +// DeleteAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteAffinityGroupExecute(r ApiDeleteAffinityGroupRequest) error { + if a.DeleteAffinityGroupExecuteMock == nil { + return nil + } + + return (*a.DeleteAffinityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteBackup(ctx context.Context, projectId string, region string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// DeleteBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + if a.DeleteBackupExecuteMock == nil { + return nil + } + + return (*a.DeleteBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteImage(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageRequest { + return ApiDeleteImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// DeleteImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageExecute(r ApiDeleteImageRequest) error { + if a.DeleteImageExecuteMock == nil { + return nil + } + + return (*a.DeleteImageExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteImageShare(ctx context.Context, projectId string, region string, imageId string) ApiDeleteImageShareRequest { + return ApiDeleteImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// DeleteImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageShareExecute(r ApiDeleteImageShareRequest) error { + if a.DeleteImageShareExecuteMock == nil { + return nil + } + + return (*a.DeleteImageShareExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiDeleteImageShareConsumerRequest { + return ApiDeleteImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// DeleteImageShareConsumerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteImageShareConsumerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteImageShareConsumerExecute(r ApiDeleteImageShareConsumerRequest) error { + if a.DeleteImageShareConsumerExecuteMock == nil { + return nil + } + + return (*a.DeleteImageShareConsumerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteKeyPair(ctx context.Context, keypairName string) ApiDeleteKeyPairRequest { + return ApiDeleteKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// DeleteKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteKeyPairExecute(r ApiDeleteKeyPairRequest) error { + if a.DeleteKeyPairExecuteMock == nil { + return nil + } + + return (*a.DeleteKeyPairExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetwork(ctx context.Context, projectId string, region string, networkId string) ApiDeleteNetworkRequest { + return ApiDeleteNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// DeleteNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkExecute(r ApiDeleteNetworkRequest) error { + if a.DeleteNetworkExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetworkArea(ctx context.Context, organizationId string, areaId string) ApiDeleteNetworkAreaRequest { + return ApiDeleteNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// DeleteNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaExecute(r ApiDeleteNetworkAreaRequest) error { + if a.DeleteNetworkAreaExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiDeleteNetworkAreaRangeRequest { + return ApiDeleteNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, + } +} + +// DeleteNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaRangeExecute(r ApiDeleteNetworkAreaRangeRequest) error { + if a.DeleteNetworkAreaRangeExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaRangeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiDeleteNetworkAreaRouteRequest { + return ApiDeleteNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// DeleteNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNetworkAreaRouteExecute(r ApiDeleteNetworkAreaRouteRequest) error { + if a.DeleteNetworkAreaRouteExecuteMock == nil { + return nil + } + + return (*a.DeleteNetworkAreaRouteExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiDeleteNicRequest { + return ApiDeleteNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// DeleteNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteNicExecute(r ApiDeleteNicRequest) error { + if a.DeleteNicExecuteMock == nil { + return nil + } + + return (*a.DeleteNicExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeletePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiDeletePublicIPRequest { + return ApiDeletePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// DeletePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeletePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeletePublicIPExecute(r ApiDeletePublicIPRequest) error { + if a.DeletePublicIPExecuteMock == nil { + return nil + } + + return (*a.DeletePublicIPExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteRouteFromRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiDeleteRouteFromRoutingTableRequest { + return ApiDeleteRouteFromRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// DeleteRouteFromRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRouteFromRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteRouteFromRoutingTableExecute(r ApiDeleteRouteFromRoutingTableRequest) error { + if a.DeleteRouteFromRoutingTableExecuteMock == nil { + return nil + } + + return (*a.DeleteRouteFromRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteRoutingTableFromArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiDeleteRoutingTableFromAreaRequest { + return ApiDeleteRoutingTableFromAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// DeleteRoutingTableFromAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRoutingTableFromAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteRoutingTableFromAreaExecute(r ApiDeleteRoutingTableFromAreaRequest) error { + if a.DeleteRoutingTableFromAreaExecuteMock == nil { + return nil + } + + return (*a.DeleteRoutingTableFromAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiDeleteSecurityGroupRequest { + return ApiDeleteSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// DeleteSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteSecurityGroupExecute(r ApiDeleteSecurityGroupRequest) error { + if a.DeleteSecurityGroupExecuteMock == nil { + return nil + } + + return (*a.DeleteSecurityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiDeleteSecurityGroupRuleRequest { + return ApiDeleteSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// DeleteSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteSecurityGroupRuleExecute(r ApiDeleteSecurityGroupRuleRequest) error { + if a.DeleteSecurityGroupRuleExecuteMock == nil { + return nil + } + + return (*a.DeleteSecurityGroupRuleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteServer(ctx context.Context, projectId string, region string, serverId string) ApiDeleteServerRequest { + return ApiDeleteServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// DeleteServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteServerExecute(r ApiDeleteServerRequest) error { + if a.DeleteServerExecuteMock == nil { + return nil + } + + return (*a.DeleteServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteVolume(ctx context.Context, projectId string, region string, volumeId string) ApiDeleteVolumeRequest { + return ApiDeleteVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// DeleteVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteVolumeExecute(r ApiDeleteVolumeRequest) error { + if a.DeleteVolumeExecuteMock == nil { + return nil + } + + return (*a.DeleteVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetAffinityGroup(ctx context.Context, projectId string, region string, affinityGroupId string) ApiGetAffinityGroupRequest { + return ApiGetAffinityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + affinityGroupId: affinityGroupId, + } +} + +// GetAffinityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetAffinityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetAffinityGroupExecute(r ApiGetAffinityGroupRequest) (*AffinityGroup, error) { + if a.GetAffinityGroupExecuteMock == nil { + var localVarReturnValue *AffinityGroup + return localVarReturnValue, nil + } + + return (*a.GetAffinityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiGetAttachedVolumeRequest { + return ApiGetAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// GetAttachedVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetAttachedVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetAttachedVolumeExecute(r ApiGetAttachedVolumeRequest) (*VolumeAttachment, error) { + if a.GetAttachedVolumeExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.GetAttachedVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, region string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// GetBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetImage(ctx context.Context, projectId string, region string, imageId string) ApiGetImageRequest { + return ApiGetImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// GetImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageExecute(r ApiGetImageRequest) (*Image, error) { + if a.GetImageExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.GetImageExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiGetImageShareRequest { + return ApiGetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// GetImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageShareExecute(r ApiGetImageShareRequest) (*ImageShare, error) { + if a.GetImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.GetImageShareExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetImageShareConsumer(ctx context.Context, projectId string, region string, imageId string, consumerProjectId string) ApiGetImageShareConsumerRequest { + return ApiGetImageShareConsumerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + consumerProjectId: consumerProjectId, + } +} + +// GetImageShareConsumerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetImageShareConsumerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetImageShareConsumerExecute(r ApiGetImageShareConsumerRequest) (*ImageShareConsumer, error) { + if a.GetImageShareConsumerExecuteMock == nil { + var localVarReturnValue *ImageShareConsumer + return localVarReturnValue, nil + } + + return (*a.GetImageShareConsumerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetKeyPair(ctx context.Context, keypairName string) ApiGetKeyPairRequest { + return ApiGetKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// GetKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetKeyPairExecute(r ApiGetKeyPairRequest) (*Keypair, error) { + if a.GetKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.GetKeyPairExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetMachineType(ctx context.Context, projectId string, region string, machineType string) ApiGetMachineTypeRequest { + return ApiGetMachineTypeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + machineType: machineType, + } +} + +// GetMachineTypeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetMachineTypeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetMachineTypeExecute(r ApiGetMachineTypeRequest) (*MachineType, error) { + if a.GetMachineTypeExecuteMock == nil { + var localVarReturnValue *MachineType + return localVarReturnValue, nil + } + + return (*a.GetMachineTypeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetwork(ctx context.Context, projectId string, region string, networkId string) ApiGetNetworkRequest { + return ApiGetNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// GetNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkExecute(r ApiGetNetworkRequest) (*Network, error) { + if a.GetNetworkExecuteMock == nil { + var localVarReturnValue *Network + return localVarReturnValue, nil + } + + return (*a.GetNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetworkArea(ctx context.Context, organizationId string, areaId string) ApiGetNetworkAreaRequest { + return ApiGetNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// GetNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaExecute(r ApiGetNetworkAreaRequest) (*NetworkArea, error) { + if a.GetNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetworkAreaRange(ctx context.Context, organizationId string, areaId string, region string, networkRangeId string) ApiGetNetworkAreaRangeRequest { + return ApiGetNetworkAreaRangeRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + networkRangeId: networkRangeId, + } +} + +// GetNetworkAreaRangeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaRangeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaRangeExecute(r ApiGetNetworkAreaRangeRequest) (*NetworkRange, error) { + if a.GetNetworkAreaRangeExecuteMock == nil { + var localVarReturnValue *NetworkRange + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaRangeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNetworkAreaRoute(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiGetNetworkAreaRouteRequest { + return ApiGetNetworkAreaRouteRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// GetNetworkAreaRouteExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNetworkAreaRouteExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNetworkAreaRouteExecute(r ApiGetNetworkAreaRouteRequest) (*Route, error) { + if a.GetNetworkAreaRouteExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.GetNetworkAreaRouteExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiGetNicRequest { + return ApiGetNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// GetNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetNicExecute(r ApiGetNicRequest) (*NIC, error) { + if a.GetNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.GetNicExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetOrganizationRequest(ctx context.Context, organizationId string, requestId string) ApiGetOrganizationRequestRequest { + return ApiGetOrganizationRequestRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + requestId: requestId, + } +} + +// GetOrganizationRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetOrganizationRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetOrganizationRequestExecute(r ApiGetOrganizationRequestRequest) (*Request, error) { + if a.GetOrganizationRequestExecuteMock == nil { + var localVarReturnValue *Request + return localVarReturnValue, nil + } + + return (*a.GetOrganizationRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetProjectDetails(ctx context.Context, projectId string) ApiGetProjectDetailsRequest { + return ApiGetProjectDetailsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// GetProjectDetailsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectDetailsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectDetailsExecute(r ApiGetProjectDetailsRequest) (*Project, error) { + if a.GetProjectDetailsExecuteMock == nil { + var localVarReturnValue *Project + return localVarReturnValue, nil + } + + return (*a.GetProjectDetailsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetProjectNIC(ctx context.Context, projectId string, region string, nicId string) ApiGetProjectNICRequest { + return ApiGetProjectNICRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + nicId: nicId, + } +} + +// GetProjectNICExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectNICExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectNICExecute(r ApiGetProjectNICRequest) (*NIC, error) { + if a.GetProjectNICExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.GetProjectNICExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetProjectRequest(ctx context.Context, projectId string, region string, requestId string) ApiGetProjectRequestRequest { + return ApiGetProjectRequestRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + requestId: requestId, + } +} + +// GetProjectRequestExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetProjectRequestExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetProjectRequestExecute(r ApiGetProjectRequestRequest) (*Request, error) { + if a.GetProjectRequestExecuteMock == nil { + var localVarReturnValue *Request + return localVarReturnValue, nil + } + + return (*a.GetProjectRequestExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetPublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiGetPublicIPRequest { + return ApiGetPublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// GetPublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetPublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetPublicIPExecute(r ApiGetPublicIPRequest) (*PublicIp, error) { + if a.GetPublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.GetPublicIPExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiGetRouteOfRoutingTableRequest { + return ApiGetRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// GetRouteOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRouteOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetRouteOfRoutingTableExecute(r ApiGetRouteOfRoutingTableRequest) (*Route, error) { + if a.GetRouteOfRoutingTableExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.GetRouteOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiGetRoutingTableOfAreaRequest { + return ApiGetRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// GetRoutingTableOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRoutingTableOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetRoutingTableOfAreaExecute(r ApiGetRoutingTableOfAreaRequest) (*RoutingTable, error) { + if a.GetRoutingTableOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.GetRoutingTableOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiGetSecurityGroupRequest { + return ApiGetSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// GetSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSecurityGroupExecute(r ApiGetSecurityGroupRequest) (*SecurityGroup, error) { + if a.GetSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.GetSecurityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetSecurityGroupRule(ctx context.Context, projectId string, region string, securityGroupId string, securityGroupRuleId string) ApiGetSecurityGroupRuleRequest { + return ApiGetSecurityGroupRuleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + securityGroupRuleId: securityGroupRuleId, + } +} + +// GetSecurityGroupRuleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSecurityGroupRuleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSecurityGroupRuleExecute(r ApiGetSecurityGroupRuleRequest) (*SecurityGroupRule, error) { + if a.GetSecurityGroupRuleExecuteMock == nil { + var localVarReturnValue *SecurityGroupRule + return localVarReturnValue, nil + } + + return (*a.GetSecurityGroupRuleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServer(ctx context.Context, projectId string, region string, serverId string) ApiGetServerRequest { + return ApiGetServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// GetServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerExecute(r ApiGetServerRequest) (*Server, error) { + if a.GetServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.GetServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServerConsole(ctx context.Context, projectId string, region string, serverId string) ApiGetServerConsoleRequest { + return ApiGetServerConsoleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// GetServerConsoleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerConsoleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerConsoleExecute(r ApiGetServerConsoleRequest) (*ServerConsoleUrl, error) { + if a.GetServerConsoleExecuteMock == nil { + var localVarReturnValue *ServerConsoleUrl + return localVarReturnValue, nil + } + + return (*a.GetServerConsoleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServerLog(ctx context.Context, projectId string, region string, serverId string) ApiGetServerLogRequest { + return ApiGetServerLogRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// GetServerLogExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServerLogExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServerLogExecute(r ApiGetServerLogRequest) (*GetServerLog200Response, error) { + if a.GetServerLogExecuteMock == nil { + var localVarReturnValue *GetServerLog200Response + return localVarReturnValue, nil + } + + return (*a.GetServerLogExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetVolume(ctx context.Context, projectId string, region string, volumeId string) ApiGetVolumeRequest { + return ApiGetVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// GetVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetVolumeExecute(r ApiGetVolumeRequest) (*Volume, error) { + if a.GetVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.GetVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetVolumePerformanceClass(ctx context.Context, projectId string, region string, volumePerformanceClass string) ApiGetVolumePerformanceClassRequest { + return ApiGetVolumePerformanceClassRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumePerformanceClass: volumePerformanceClass, + } +} + +// GetVolumePerformanceClassExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetVolumePerformanceClassExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetVolumePerformanceClassExecute(r ApiGetVolumePerformanceClassRequest) (*VolumePerformanceClass, error) { + if a.GetVolumePerformanceClassExecuteMock == nil { + var localVarReturnValue *VolumePerformanceClass + return localVarReturnValue, nil + } + + return (*a.GetVolumePerformanceClassExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListAffinityGroups(ctx context.Context, projectId string, region string) ApiListAffinityGroupsRequest { + return ApiListAffinityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListAffinityGroupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAffinityGroupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAffinityGroupsExecute(r ApiListAffinityGroupsRequest) (*AffinityGroupListResponse, error) { + if a.ListAffinityGroupsExecuteMock == nil { + var localVarReturnValue *AffinityGroupListResponse + return localVarReturnValue, nil + } + + return (*a.ListAffinityGroupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListAttachedVolumes(ctx context.Context, projectId string, region string, serverId string) ApiListAttachedVolumesRequest { + return ApiListAttachedVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// ListAttachedVolumesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAttachedVolumesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAttachedVolumesExecute(r ApiListAttachedVolumesRequest) (*VolumeAttachmentListResponse, error) { + if a.ListAttachedVolumesExecuteMock == nil { + var localVarReturnValue *VolumeAttachmentListResponse + return localVarReturnValue, nil + } + + return (*a.ListAttachedVolumesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListAvailabilityZones(ctx context.Context, region string) ApiListAvailabilityZonesRequest { + return ApiListAvailabilityZonesRequest{ + ApiService: a, + ctx: ctx, + region: region, + } +} + +// ListAvailabilityZonesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAvailabilityZonesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAvailabilityZonesExecute(r ApiListAvailabilityZonesRequest) (*AvailabilityZoneListResponse, error) { + if a.ListAvailabilityZonesExecuteMock == nil { + var localVarReturnValue *AvailabilityZoneListResponse + return localVarReturnValue, nil + } + + return (*a.ListAvailabilityZonesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, region string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*BackupListResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *BackupListResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListImages(ctx context.Context, projectId string, region string) ApiListImagesRequest { + return ApiListImagesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListImagesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListImagesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListImagesExecute(r ApiListImagesRequest) (*ImageListResponse, error) { + if a.ListImagesExecuteMock == nil { + var localVarReturnValue *ImageListResponse + return localVarReturnValue, nil + } + + return (*a.ListImagesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListKeyPairs(ctx context.Context) ApiListKeyPairsRequest { + return ApiListKeyPairsRequest{ + ApiService: a, + ctx: ctx, + } +} + +// ListKeyPairsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListKeyPairsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListKeyPairsExecute(r ApiListKeyPairsRequest) (*KeyPairListResponse, error) { + if a.ListKeyPairsExecuteMock == nil { + var localVarReturnValue *KeyPairListResponse + return localVarReturnValue, nil + } + + return (*a.ListKeyPairsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListMachineTypes(ctx context.Context, projectId string, region string) ApiListMachineTypesRequest { + return ApiListMachineTypesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListMachineTypesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListMachineTypesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListMachineTypesExecute(r ApiListMachineTypesRequest) (*MachineTypeListResponse, error) { + if a.ListMachineTypesExecuteMock == nil { + var localVarReturnValue *MachineTypeListResponse + return localVarReturnValue, nil + } + + return (*a.ListMachineTypesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreaProjects(ctx context.Context, organizationId string, areaId string) ApiListNetworkAreaProjectsRequest { + return ApiListNetworkAreaProjectsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// ListNetworkAreaProjectsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaProjectsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaProjectsExecute(r ApiListNetworkAreaProjectsRequest) (*ProjectListResponse, error) { + if a.ListNetworkAreaProjectsExecuteMock == nil { + var localVarReturnValue *ProjectListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaProjectsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreaRanges(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRangesRequest { + return ApiListNetworkAreaRangesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// ListNetworkAreaRangesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaRangesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaRangesExecute(r ApiListNetworkAreaRangesRequest) (*NetworkRangeListResponse, error) { + if a.ListNetworkAreaRangesExecuteMock == nil { + var localVarReturnValue *NetworkRangeListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaRangesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreaRoutes(ctx context.Context, organizationId string, areaId string, region string) ApiListNetworkAreaRoutesRequest { + return ApiListNetworkAreaRoutesRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// ListNetworkAreaRoutesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreaRoutesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreaRoutesExecute(r ApiListNetworkAreaRoutesRequest) (*RouteListResponse, error) { + if a.ListNetworkAreaRoutesExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreaRoutesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworkAreas(ctx context.Context, organizationId string) ApiListNetworkAreasRequest { + return ApiListNetworkAreasRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + } +} + +// ListNetworkAreasExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworkAreasExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworkAreasExecute(r ApiListNetworkAreasRequest) (*NetworkAreaListResponse, error) { + if a.ListNetworkAreasExecuteMock == nil { + var localVarReturnValue *NetworkAreaListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworkAreasExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNetworks(ctx context.Context, projectId string, region string) ApiListNetworksRequest { + return ApiListNetworksRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListNetworksExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNetworksExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNetworksExecute(r ApiListNetworksRequest) (*NetworkListResponse, error) { + if a.ListNetworksExecuteMock == nil { + var localVarReturnValue *NetworkListResponse + return localVarReturnValue, nil + } + + return (*a.ListNetworksExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListNics(ctx context.Context, projectId string, region string, networkId string) ApiListNicsRequest { + return ApiListNicsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// ListNicsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListNicsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListNicsExecute(r ApiListNicsRequest) (*NICListResponse, error) { + if a.ListNicsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListNicsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListProjectNICs(ctx context.Context, projectId string, region string) ApiListProjectNICsRequest { + return ApiListProjectNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListProjectNICsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListProjectNICsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListProjectNICsExecute(r ApiListProjectNICsRequest) (*NICListResponse, error) { + if a.ListProjectNICsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListProjectNICsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListPublicIPRanges(ctx context.Context) ApiListPublicIPRangesRequest { + return ApiListPublicIPRangesRequest{ + ApiService: a, + ctx: ctx, + } +} + +// ListPublicIPRangesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListPublicIPRangesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListPublicIPRangesExecute(r ApiListPublicIPRangesRequest) (*PublicNetworkListResponse, error) { + if a.ListPublicIPRangesExecuteMock == nil { + var localVarReturnValue *PublicNetworkListResponse + return localVarReturnValue, nil + } + + return (*a.ListPublicIPRangesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListPublicIPs(ctx context.Context, projectId string, region string) ApiListPublicIPsRequest { + return ApiListPublicIPsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListPublicIPsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListPublicIPsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListPublicIPsExecute(r ApiListPublicIPsRequest) (*PublicIpListResponse, error) { + if a.ListPublicIPsExecuteMock == nil { + var localVarReturnValue *PublicIpListResponse + return localVarReturnValue, nil + } + + return (*a.ListPublicIPsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListQuotas(ctx context.Context, projectId string, region string) ApiListQuotasRequest { + return ApiListQuotasRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListQuotasExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListQuotasExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListQuotasExecute(r ApiListQuotasRequest) (*QuotaListResponse, error) { + if a.ListQuotasExecuteMock == nil { + var localVarReturnValue *QuotaListResponse + return localVarReturnValue, nil + } + + return (*a.ListQuotasExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoutesOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiListRoutesOfRoutingTableRequest { + return ApiListRoutesOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// ListRoutesOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRoutesOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRoutesOfRoutingTableExecute(r ApiListRoutesOfRoutingTableRequest) (*RouteListResponse, error) { + if a.ListRoutesOfRoutingTableExecuteMock == nil { + var localVarReturnValue *RouteListResponse + return localVarReturnValue, nil + } + + return (*a.ListRoutesOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRoutingTablesOfArea(ctx context.Context, organizationId string, areaId string, region string) ApiListRoutingTablesOfAreaRequest { + return ApiListRoutingTablesOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// ListRoutingTablesOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRoutingTablesOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRoutingTablesOfAreaExecute(r ApiListRoutingTablesOfAreaRequest) (*RoutingTableListResponse, error) { + if a.ListRoutingTablesOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTableListResponse + return localVarReturnValue, nil + } + + return (*a.ListRoutingTablesOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListSecurityGroupRules(ctx context.Context, projectId string, region string, securityGroupId string) ApiListSecurityGroupRulesRequest { + return ApiListSecurityGroupRulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// ListSecurityGroupRulesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSecurityGroupRulesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSecurityGroupRulesExecute(r ApiListSecurityGroupRulesRequest) (*SecurityGroupRuleListResponse, error) { + if a.ListSecurityGroupRulesExecuteMock == nil { + var localVarReturnValue *SecurityGroupRuleListResponse + return localVarReturnValue, nil + } + + return (*a.ListSecurityGroupRulesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListSecurityGroups(ctx context.Context, projectId string, region string) ApiListSecurityGroupsRequest { + return ApiListSecurityGroupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListSecurityGroupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSecurityGroupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSecurityGroupsExecute(r ApiListSecurityGroupsRequest) (*SecurityGroupListResponse, error) { + if a.ListSecurityGroupsExecuteMock == nil { + var localVarReturnValue *SecurityGroupListResponse + return localVarReturnValue, nil + } + + return (*a.ListSecurityGroupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListServerNICs(ctx context.Context, projectId string, region string, serverId string) ApiListServerNICsRequest { + return ApiListServerNICsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// ListServerNICsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServerNICsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServerNICsExecute(r ApiListServerNICsRequest) (*NICListResponse, error) { + if a.ListServerNICsExecuteMock == nil { + var localVarReturnValue *NICListResponse + return localVarReturnValue, nil + } + + return (*a.ListServerNICsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListServerServiceAccounts(ctx context.Context, projectId string, region string, serverId string) ApiListServerServiceAccountsRequest { + return ApiListServerServiceAccountsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// ListServerServiceAccountsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServerServiceAccountsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServerServiceAccountsExecute(r ApiListServerServiceAccountsRequest) (*ServiceAccountMailListResponse, error) { + if a.ListServerServiceAccountsExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.ListServerServiceAccountsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListServers(ctx context.Context, projectId string, region string) ApiListServersRequest { + return ApiListServersRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListServersExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListServersExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListServersExecute(r ApiListServersRequest) (*ServerListResponse, error) { + if a.ListServersExecuteMock == nil { + var localVarReturnValue *ServerListResponse + return localVarReturnValue, nil + } + + return (*a.ListServersExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListVolumePerformanceClasses(ctx context.Context, projectId string, region string) ApiListVolumePerformanceClassesRequest { + return ApiListVolumePerformanceClassesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListVolumePerformanceClassesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVolumePerformanceClassesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVolumePerformanceClassesExecute(r ApiListVolumePerformanceClassesRequest) (*VolumePerformanceClassListResponse, error) { + if a.ListVolumePerformanceClassesExecuteMock == nil { + var localVarReturnValue *VolumePerformanceClassListResponse + return localVarReturnValue, nil + } + + return (*a.ListVolumePerformanceClassesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListVolumes(ctx context.Context, projectId string, region string) ApiListVolumesRequest { + return ApiListVolumesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// ListVolumesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListVolumesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListVolumesExecute(r ApiListVolumesRequest) (*VolumeListResponse, error) { + if a.ListVolumesExecuteMock == nil { + var localVarReturnValue *VolumeListResponse + return localVarReturnValue, nil + } + + return (*a.ListVolumesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateNetwork(ctx context.Context, projectId string, region string, networkId string) ApiPartialUpdateNetworkRequest { + return ApiPartialUpdateNetworkRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + } +} + +// PartialUpdateNetworkExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateNetworkExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateNetworkExecute(r ApiPartialUpdateNetworkRequest) error { + if a.PartialUpdateNetworkExecuteMock == nil { + return nil + } + + return (*a.PartialUpdateNetworkExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PartialUpdateNetworkArea(ctx context.Context, organizationId string, areaId string) ApiPartialUpdateNetworkAreaRequest { + return ApiPartialUpdateNetworkAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// PartialUpdateNetworkAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PartialUpdateNetworkAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PartialUpdateNetworkAreaExecute(r ApiPartialUpdateNetworkAreaRequest) (*NetworkArea, error) { + if a.PartialUpdateNetworkAreaExecuteMock == nil { + var localVarReturnValue *NetworkArea + return localVarReturnValue, nil + } + + return (*a.PartialUpdateNetworkAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RebootServer(ctx context.Context, projectId string, region string, serverId string) ApiRebootServerRequest { + return ApiRebootServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// RebootServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RebootServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RebootServerExecute(r ApiRebootServerRequest) error { + if a.RebootServerExecuteMock == nil { + return nil + } + + return (*a.RebootServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveNetworkFromServer(ctx context.Context, projectId string, region string, serverId string, networkId string) ApiRemoveNetworkFromServerRequest { + return ApiRemoveNetworkFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + networkId: networkId, + } +} + +// RemoveNetworkFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveNetworkFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveNetworkFromServerExecute(r ApiRemoveNetworkFromServerRequest) error { + if a.RemoveNetworkFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveNetworkFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveNicFromServer(ctx context.Context, projectId string, region string, serverId string, nicId string) ApiRemoveNicFromServerRequest { + return ApiRemoveNicFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + nicId: nicId, + } +} + +// RemoveNicFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveNicFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveNicFromServerExecute(r ApiRemoveNicFromServerRequest) error { + if a.RemoveNicFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveNicFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemovePublicIpFromServer(ctx context.Context, projectId string, region string, serverId string, publicIpId string) ApiRemovePublicIpFromServerRequest { + return ApiRemovePublicIpFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + publicIpId: publicIpId, + } +} + +// RemovePublicIpFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemovePublicIpFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemovePublicIpFromServerExecute(r ApiRemovePublicIpFromServerRequest) error { + if a.RemovePublicIpFromServerExecuteMock == nil { + return nil + } + + return (*a.RemovePublicIpFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveSecurityGroupFromServer(ctx context.Context, projectId string, region string, serverId string, securityGroupId string) ApiRemoveSecurityGroupFromServerRequest { + return ApiRemoveSecurityGroupFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + securityGroupId: securityGroupId, + } +} + +// RemoveSecurityGroupFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveSecurityGroupFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveSecurityGroupFromServerExecute(r ApiRemoveSecurityGroupFromServerRequest) error { + if a.RemoveSecurityGroupFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveSecurityGroupFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveServiceAccountFromServer(ctx context.Context, projectId string, region string, serverId string, serviceAccountMail string) ApiRemoveServiceAccountFromServerRequest { + return ApiRemoveServiceAccountFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + serviceAccountMail: serviceAccountMail, + } +} + +// RemoveServiceAccountFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveServiceAccountFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveServiceAccountFromServerExecute(r ApiRemoveServiceAccountFromServerRequest) (*ServiceAccountMailListResponse, error) { + if a.RemoveServiceAccountFromServerExecuteMock == nil { + var localVarReturnValue *ServiceAccountMailListResponse + return localVarReturnValue, nil + } + + return (*a.RemoveServiceAccountFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RemoveVolumeFromServer(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiRemoveVolumeFromServerRequest { + return ApiRemoveVolumeFromServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// RemoveVolumeFromServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RemoveVolumeFromServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RemoveVolumeFromServerExecute(r ApiRemoveVolumeFromServerRequest) error { + if a.RemoveVolumeFromServerExecuteMock == nil { + return nil + } + + return (*a.RemoveVolumeFromServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RescueServer(ctx context.Context, projectId string, region string, serverId string) ApiRescueServerRequest { + return ApiRescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// RescueServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RescueServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RescueServerExecute(r ApiRescueServerRequest) error { + if a.RescueServerExecuteMock == nil { + return nil + } + + return (*a.RescueServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResizeServer(ctx context.Context, projectId string, region string, serverId string) ApiResizeServerRequest { + return ApiResizeServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// ResizeServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResizeServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResizeServerExecute(r ApiResizeServerRequest) error { + if a.ResizeServerExecuteMock == nil { + return nil + } + + return (*a.ResizeServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ResizeVolume(ctx context.Context, projectId string, region string, volumeId string) ApiResizeVolumeRequest { + return ApiResizeVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// ResizeVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ResizeVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ResizeVolumeExecute(r ApiResizeVolumeRequest) error { + if a.ResizeVolumeExecuteMock == nil { + return nil + } + + return (*a.ResizeVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RestoreBackup(ctx context.Context, projectId string, region string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// RestoreBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + if a.RestoreBackupExecuteMock == nil { + return nil + } + + return (*a.RestoreBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) SetImageShare(ctx context.Context, projectId string, region string, imageId string) ApiSetImageShareRequest { + return ApiSetImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// SetImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the SetImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) SetImageShareExecute(r ApiSetImageShareRequest) (*ImageShare, error) { + if a.SetImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.SetImageShareExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) StartServer(ctx context.Context, projectId string, region string, serverId string) ApiStartServerRequest { + return ApiStartServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// StartServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the StartServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) StartServerExecute(r ApiStartServerRequest) error { + if a.StartServerExecuteMock == nil { + return nil + } + + return (*a.StartServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) StopServer(ctx context.Context, projectId string, region string, serverId string) ApiStopServerRequest { + return ApiStopServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// StopServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the StopServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) StopServerExecute(r ApiStopServerRequest) error { + if a.StopServerExecuteMock == nil { + return nil + } + + return (*a.StopServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UnrescueServer(ctx context.Context, projectId string, region string, serverId string) ApiUnrescueServerRequest { + return ApiUnrescueServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// UnrescueServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UnrescueServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UnrescueServerExecute(r ApiUnrescueServerRequest) error { + if a.UnrescueServerExecuteMock == nil { + return nil + } + + return (*a.UnrescueServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateAttachedVolume(ctx context.Context, projectId string, region string, serverId string, volumeId string) ApiUpdateAttachedVolumeRequest { + return ApiUpdateAttachedVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + volumeId: volumeId, + } +} + +// UpdateAttachedVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateAttachedVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateAttachedVolumeExecute(r ApiUpdateAttachedVolumeRequest) (*VolumeAttachment, error) { + if a.UpdateAttachedVolumeExecuteMock == nil { + var localVarReturnValue *VolumeAttachment + return localVarReturnValue, nil + } + + return (*a.UpdateAttachedVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateImage(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageRequest { + return ApiUpdateImageRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// UpdateImageExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateImageExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateImageExecute(r ApiUpdateImageRequest) (*Image, error) { + if a.UpdateImageExecuteMock == nil { + var localVarReturnValue *Image + return localVarReturnValue, nil + } + + return (*a.UpdateImageExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateImageShare(ctx context.Context, projectId string, region string, imageId string) ApiUpdateImageShareRequest { + return ApiUpdateImageShareRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + imageId: imageId, + } +} + +// UpdateImageShareExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateImageShareExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateImageShareExecute(r ApiUpdateImageShareRequest) (*ImageShare, error) { + if a.UpdateImageShareExecuteMock == nil { + var localVarReturnValue *ImageShare + return localVarReturnValue, nil + } + + return (*a.UpdateImageShareExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateKeyPair(ctx context.Context, keypairName string) ApiUpdateKeyPairRequest { + return ApiUpdateKeyPairRequest{ + ApiService: a, + ctx: ctx, + keypairName: keypairName, + } +} + +// UpdateKeyPairExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateKeyPairExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateKeyPairExecute(r ApiUpdateKeyPairRequest) (*Keypair, error) { + if a.UpdateKeyPairExecuteMock == nil { + var localVarReturnValue *Keypair + return localVarReturnValue, nil + } + + return (*a.UpdateKeyPairExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateNic(ctx context.Context, projectId string, region string, networkId string, nicId string) ApiUpdateNicRequest { + return ApiUpdateNicRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + networkId: networkId, + nicId: nicId, + } +} + +// UpdateNicExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateNicExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateNicExecute(r ApiUpdateNicRequest) (*NIC, error) { + if a.UpdateNicExecuteMock == nil { + var localVarReturnValue *NIC + return localVarReturnValue, nil + } + + return (*a.UpdateNicExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdatePublicIP(ctx context.Context, projectId string, region string, publicIpId string) ApiUpdatePublicIPRequest { + return ApiUpdatePublicIPRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + publicIpId: publicIpId, + } +} + +// UpdatePublicIPExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdatePublicIPExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdatePublicIPExecute(r ApiUpdatePublicIPRequest) (*PublicIp, error) { + if a.UpdatePublicIPExecuteMock == nil { + var localVarReturnValue *PublicIp + return localVarReturnValue, nil + } + + return (*a.UpdatePublicIPExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateRouteOfRoutingTable(ctx context.Context, organizationId string, areaId string, region string, routingTableId string, routeId string) ApiUpdateRouteOfRoutingTableRequest { + return ApiUpdateRouteOfRoutingTableRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + routeId: routeId, + } +} + +// UpdateRouteOfRoutingTableExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRouteOfRoutingTableExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateRouteOfRoutingTableExecute(r ApiUpdateRouteOfRoutingTableRequest) (*Route, error) { + if a.UpdateRouteOfRoutingTableExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.UpdateRouteOfRoutingTableExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateRoutingTableOfArea(ctx context.Context, organizationId string, areaId string, region string, routingTableId string) ApiUpdateRoutingTableOfAreaRequest { + return ApiUpdateRoutingTableOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routingTableId: routingTableId, + } +} + +// UpdateRoutingTableOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateRoutingTableOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateRoutingTableOfAreaExecute(r ApiUpdateRoutingTableOfAreaRequest) (*RoutingTable, error) { + if a.UpdateRoutingTableOfAreaExecuteMock == nil { + var localVarReturnValue *RoutingTable + return localVarReturnValue, nil + } + + return (*a.UpdateRoutingTableOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateServer(ctx context.Context, projectId string, region string, serverId string) ApiUpdateServerRequest { + return ApiUpdateServerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + serverId: serverId, + } +} + +// UpdateServerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateServerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateServerExecute(r ApiUpdateServerRequest) (*Server, error) { + if a.UpdateServerExecuteMock == nil { + var localVarReturnValue *Server + return localVarReturnValue, nil + } + + return (*a.UpdateServerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateVolume(ctx context.Context, projectId string, region string, volumeId string) ApiUpdateVolumeRequest { + return ApiUpdateVolumeRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + volumeId: volumeId, + } +} + +// UpdateVolumeExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateVolumeExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateVolumeExecute(r ApiUpdateVolumeRequest) (*Volume, error) { + if a.UpdateVolumeExecuteMock == nil { + var localVarReturnValue *Volume + return localVarReturnValue, nil + } + + return (*a.UpdateVolumeExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1ConfigureNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1ConfigureNetworkAreaRegionRequest { + return ApiV2beta1ConfigureNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// V2beta1ConfigureNetworkAreaRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1ConfigureNetworkAreaRegionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1ConfigureNetworkAreaRegionExecute(r ApiV2beta1ConfigureNetworkAreaRegionRequest) (*RegionalArea, error) { + if a.V2beta1ConfigureNetworkAreaRegionExecuteMock == nil { + var localVarReturnValue *RegionalArea + return localVarReturnValue, nil + } + + return (*a.V2beta1ConfigureNetworkAreaRegionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1CreateSnapshot(ctx context.Context, projectId string, region string) ApiV2beta1CreateSnapshotRequest { + return ApiV2beta1CreateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// V2beta1CreateSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1CreateSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1CreateSnapshotExecute(r ApiV2beta1CreateSnapshotRequest) (*Snapshot, error) { + if a.V2beta1CreateSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.V2beta1CreateSnapshotExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1DeleteNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1DeleteNetworkAreaRegionRequest { + return ApiV2beta1DeleteNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// V2beta1DeleteNetworkAreaRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1DeleteNetworkAreaRegionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1DeleteNetworkAreaRegionExecute(r ApiV2beta1DeleteNetworkAreaRegionRequest) error { + if a.V2beta1DeleteNetworkAreaRegionExecuteMock == nil { + return nil + } + + return (*a.V2beta1DeleteNetworkAreaRegionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1DeleteSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1DeleteSnapshotRequest { + return ApiV2beta1DeleteSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// V2beta1DeleteSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1DeleteSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1DeleteSnapshotExecute(r ApiV2beta1DeleteSnapshotRequest) error { + if a.V2beta1DeleteSnapshotExecuteMock == nil { + return nil + } + + return (*a.V2beta1DeleteSnapshotExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1GetAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1GetAreaRegionRequest { + return ApiV2beta1GetAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// V2beta1GetAreaRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1GetAreaRegionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1GetAreaRegionExecute(r ApiV2beta1GetAreaRegionRequest) (*RegionalArea, error) { + if a.V2beta1GetAreaRegionExecuteMock == nil { + var localVarReturnValue *RegionalArea + return localVarReturnValue, nil + } + + return (*a.V2beta1GetAreaRegionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1GetSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1GetSnapshotRequest { + return ApiV2beta1GetSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// V2beta1GetSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1GetSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1GetSnapshotExecute(r ApiV2beta1GetSnapshotRequest) (*Snapshot, error) { + if a.V2beta1GetSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.V2beta1GetSnapshotExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1ListAreaRegions(ctx context.Context, organizationId string, areaId string) ApiV2beta1ListAreaRegionsRequest { + return ApiV2beta1ListAreaRegionsRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + } +} + +// V2beta1ListAreaRegionsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1ListAreaRegionsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1ListAreaRegionsExecute(r ApiV2beta1ListAreaRegionsRequest) (*RegionalAreaListResponse, error) { + if a.V2beta1ListAreaRegionsExecuteMock == nil { + var localVarReturnValue *RegionalAreaListResponse + return localVarReturnValue, nil + } + + return (*a.V2beta1ListAreaRegionsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1ListSnapshotsInProject(ctx context.Context, projectId string, region string) ApiV2beta1ListSnapshotsInProjectRequest { + return ApiV2beta1ListSnapshotsInProjectRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + } +} + +// V2beta1ListSnapshotsInProjectExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1ListSnapshotsInProjectExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1ListSnapshotsInProjectExecute(r ApiV2beta1ListSnapshotsInProjectRequest) (*SnapshotListResponse, error) { + if a.V2beta1ListSnapshotsInProjectExecuteMock == nil { + var localVarReturnValue *SnapshotListResponse + return localVarReturnValue, nil + } + + return (*a.V2beta1ListSnapshotsInProjectExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1UpdateBackup(ctx context.Context, projectId string, region string, backupId string) ApiV2beta1UpdateBackupRequest { + return ApiV2beta1UpdateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + backupId: backupId, + } +} + +// V2beta1UpdateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1UpdateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1UpdateBackupExecute(r ApiV2beta1UpdateBackupRequest) (*Backup, error) { + if a.V2beta1UpdateBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.V2beta1UpdateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1UpdateNetworkAreaRegion(ctx context.Context, organizationId string, areaId string, region string) ApiV2beta1UpdateNetworkAreaRegionRequest { + return ApiV2beta1UpdateNetworkAreaRegionRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + } +} + +// V2beta1UpdateNetworkAreaRegionExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1UpdateNetworkAreaRegionExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1UpdateNetworkAreaRegionExecute(r ApiV2beta1UpdateNetworkAreaRegionRequest) (*RegionalArea, error) { + if a.V2beta1UpdateNetworkAreaRegionExecuteMock == nil { + var localVarReturnValue *RegionalArea + return localVarReturnValue, nil + } + + return (*a.V2beta1UpdateNetworkAreaRegionExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1UpdateRouteOfArea(ctx context.Context, organizationId string, areaId string, region string, routeId string) ApiV2beta1UpdateRouteOfAreaRequest { + return ApiV2beta1UpdateRouteOfAreaRequest{ + ApiService: a, + ctx: ctx, + organizationId: organizationId, + areaId: areaId, + region: region, + routeId: routeId, + } +} + +// V2beta1UpdateRouteOfAreaExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1UpdateRouteOfAreaExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1UpdateRouteOfAreaExecute(r ApiV2beta1UpdateRouteOfAreaRequest) (*Route, error) { + if a.V2beta1UpdateRouteOfAreaExecuteMock == nil { + var localVarReturnValue *Route + return localVarReturnValue, nil + } + + return (*a.V2beta1UpdateRouteOfAreaExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1UpdateSecurityGroup(ctx context.Context, projectId string, region string, securityGroupId string) ApiV2beta1UpdateSecurityGroupRequest { + return ApiV2beta1UpdateSecurityGroupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + securityGroupId: securityGroupId, + } +} + +// V2beta1UpdateSecurityGroupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1UpdateSecurityGroupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1UpdateSecurityGroupExecute(r ApiV2beta1UpdateSecurityGroupRequest) (*SecurityGroup, error) { + if a.V2beta1UpdateSecurityGroupExecuteMock == nil { + var localVarReturnValue *SecurityGroup + return localVarReturnValue, nil + } + + return (*a.V2beta1UpdateSecurityGroupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) V2beta1UpdateSnapshot(ctx context.Context, projectId string, region string, snapshotId string) ApiV2beta1UpdateSnapshotRequest { + return ApiV2beta1UpdateSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + snapshotId: snapshotId, + } +} + +// V2beta1UpdateSnapshotExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the V2beta1UpdateSnapshotExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) V2beta1UpdateSnapshotExecute(r ApiV2beta1UpdateSnapshotRequest) (*Snapshot, error) { + if a.V2beta1UpdateSnapshotExecuteMock == nil { + var localVarReturnValue *Snapshot + return localVarReturnValue, nil + } + + return (*a.V2beta1UpdateSnapshotExecuteMock)(r) +} diff --git a/services/iaas/v2beta1api/client.go b/services/iaas/v2beta1api/client.go new file mode 100644 index 000000000..f38d095b0 --- /dev/null +++ b/services/iaas/v2beta1api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2beta1api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT IaaS API API v2beta1 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/iaas/v2beta1api/configuration.go b/services/iaas/v2beta1api/configuration.go new file mode 100644 index 000000000..62241c3d7 --- /dev/null +++ b/services/iaas/v2beta1api/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2beta1api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/iaas", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://iaas.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/iaas/v2beta1api/model_add_routes_to_routing_table_payload.go b/services/iaas/v2beta1api/model_add_routes_to_routing_table_payload.go new file mode 100644 index 000000000..3662f3416 --- /dev/null +++ b/services/iaas/v2beta1api/model_add_routes_to_routing_table_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AddRoutesToRoutingTablePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRoutesToRoutingTablePayload{} + +// AddRoutesToRoutingTablePayload Object represents a request to add network routes. +type AddRoutesToRoutingTablePayload struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _AddRoutesToRoutingTablePayload AddRoutesToRoutingTablePayload + +// NewAddRoutesToRoutingTablePayload instantiates a new AddRoutesToRoutingTablePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRoutesToRoutingTablePayload(items []Route) *AddRoutesToRoutingTablePayload { + this := AddRoutesToRoutingTablePayload{} + this.Items = items + return &this +} + +// NewAddRoutesToRoutingTablePayloadWithDefaults instantiates a new AddRoutesToRoutingTablePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRoutesToRoutingTablePayloadWithDefaults() *AddRoutesToRoutingTablePayload { + this := AddRoutesToRoutingTablePayload{} + return &this +} + +// GetItems returns the Items field value +func (o *AddRoutesToRoutingTablePayload) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AddRoutesToRoutingTablePayload) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AddRoutesToRoutingTablePayload) SetItems(v []Route) { + o.Items = v +} + +func (o AddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddRoutesToRoutingTablePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AddRoutesToRoutingTablePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddRoutesToRoutingTablePayload := _AddRoutesToRoutingTablePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAddRoutesToRoutingTablePayload) + + if err != nil { + return err + } + + *o = AddRoutesToRoutingTablePayload(varAddRoutesToRoutingTablePayload) + + return err +} + +type NullableAddRoutesToRoutingTablePayload struct { + value *AddRoutesToRoutingTablePayload + isSet bool +} + +func (v NullableAddRoutesToRoutingTablePayload) Get() *AddRoutesToRoutingTablePayload { + return v.value +} + +func (v *NullableAddRoutesToRoutingTablePayload) Set(val *AddRoutesToRoutingTablePayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddRoutesToRoutingTablePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRoutesToRoutingTablePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRoutesToRoutingTablePayload(val *AddRoutesToRoutingTablePayload) *NullableAddRoutesToRoutingTablePayload { + return &NullableAddRoutesToRoutingTablePayload{value: val, isSet: true} +} + +func (v NullableAddRoutesToRoutingTablePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRoutesToRoutingTablePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_add_routing_table_to_area_payload.go b/services/iaas/v2beta1api/model_add_routing_table_to_area_payload.go new file mode 100644 index 000000000..bdfc80bd1 --- /dev/null +++ b/services/iaas/v2beta1api/model_add_routing_table_to_area_payload.go @@ -0,0 +1,463 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the AddRoutingTableToAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddRoutingTableToAreaPayload{} + +// AddRoutingTableToAreaPayload An object representing a routing table. +type AddRoutingTableToAreaPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. + Default *bool `json:"default,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _AddRoutingTableToAreaPayload AddRoutingTableToAreaPayload + +// NewAddRoutingTableToAreaPayload instantiates a new AddRoutingTableToAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddRoutingTableToAreaPayload(name string) *AddRoutingTableToAreaPayload { + this := AddRoutingTableToAreaPayload{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + this.Name = name + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// NewAddRoutingTableToAreaPayloadWithDefaults instantiates a new AddRoutingTableToAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddRoutingTableToAreaPayloadWithDefaults() *AddRoutingTableToAreaPayload { + this := AddRoutingTableToAreaPayload{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *AddRoutingTableToAreaPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *AddRoutingTableToAreaPayload) SetDefault(v bool) { + o.Default = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *AddRoutingTableToAreaPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *AddRoutingTableToAreaPayload) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AddRoutingTableToAreaPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *AddRoutingTableToAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *AddRoutingTableToAreaPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AddRoutingTableToAreaPayload) SetName(v string) { + o.Name = v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *AddRoutingTableToAreaPayload) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *AddRoutingTableToAreaPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddRoutingTableToAreaPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *AddRoutingTableToAreaPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *AddRoutingTableToAreaPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o AddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddRoutingTableToAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *AddRoutingTableToAreaPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAddRoutingTableToAreaPayload := _AddRoutingTableToAreaPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAddRoutingTableToAreaPayload) + + if err != nil { + return err + } + + *o = AddRoutingTableToAreaPayload(varAddRoutingTableToAreaPayload) + + return err +} + +type NullableAddRoutingTableToAreaPayload struct { + value *AddRoutingTableToAreaPayload + isSet bool +} + +func (v NullableAddRoutingTableToAreaPayload) Get() *AddRoutingTableToAreaPayload { + return v.value +} + +func (v *NullableAddRoutingTableToAreaPayload) Set(val *AddRoutingTableToAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddRoutingTableToAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddRoutingTableToAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddRoutingTableToAreaPayload(val *AddRoutingTableToAreaPayload) *NullableAddRoutingTableToAreaPayload { + return &NullableAddRoutingTableToAreaPayload{value: val, isSet: true} +} + +func (v NullableAddRoutingTableToAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddRoutingTableToAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_add_volume_to_server_payload.go b/services/iaas/v2beta1api/model_add_volume_to_server_payload.go new file mode 100644 index 000000000..ceff2cf71 --- /dev/null +++ b/services/iaas/v2beta1api/model_add_volume_to_server_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the AddVolumeToServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AddVolumeToServerPayload{} + +// AddVolumeToServerPayload Object that represents a Volume attachment to a server. +type AddVolumeToServerPayload struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewAddVolumeToServerPayload instantiates a new AddVolumeToServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAddVolumeToServerPayload() *AddVolumeToServerPayload { + this := AddVolumeToServerPayload{} + return &this +} + +// NewAddVolumeToServerPayloadWithDefaults instantiates a new AddVolumeToServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAddVolumeToServerPayloadWithDefaults() *AddVolumeToServerPayload { + this := AddVolumeToServerPayload{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *AddVolumeToServerPayload) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *AddVolumeToServerPayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *AddVolumeToServerPayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AddVolumeToServerPayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *AddVolumeToServerPayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *AddVolumeToServerPayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o AddVolumeToServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AddVolumeToServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableAddVolumeToServerPayload struct { + value *AddVolumeToServerPayload + isSet bool +} + +func (v NullableAddVolumeToServerPayload) Get() *AddVolumeToServerPayload { + return v.value +} + +func (v *NullableAddVolumeToServerPayload) Set(val *AddVolumeToServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableAddVolumeToServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableAddVolumeToServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAddVolumeToServerPayload(val *AddVolumeToServerPayload) *NullableAddVolumeToServerPayload { + return &NullableAddVolumeToServerPayload{value: val, isSet: true} +} + +func (v NullableAddVolumeToServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAddVolumeToServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_affinity_group.go b/services/iaas/v2beta1api/model_affinity_group.go new file mode 100644 index 000000000..2b15fefca --- /dev/null +++ b/services/iaas/v2beta1api/model_affinity_group.go @@ -0,0 +1,261 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AffinityGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AffinityGroup{} + +// AffinityGroup Definition of an affinity group. +type AffinityGroup struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The servers that are part of the affinity group. + Members []string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. + Policy string `json:"policy"` +} + +type _AffinityGroup AffinityGroup + +// NewAffinityGroup instantiates a new AffinityGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAffinityGroup(name string, policy string) *AffinityGroup { + this := AffinityGroup{} + this.Name = name + this.Policy = policy + return &this +} + +// NewAffinityGroupWithDefaults instantiates a new AffinityGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAffinityGroupWithDefaults() *AffinityGroup { + this := AffinityGroup{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *AffinityGroup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *AffinityGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *AffinityGroup) SetId(v string) { + o.Id = &v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *AffinityGroup) GetMembers() []string { + if o == nil || IsNil(o.Members) { + var ret []string + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetMembersOk() ([]string, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *AffinityGroup) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []string and assigns it to the Members field. +func (o *AffinityGroup) SetMembers(v []string) { + o.Members = v +} + +// GetName returns the Name field value +func (o *AffinityGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *AffinityGroup) SetName(v string) { + o.Name = v +} + +// GetPolicy returns the Policy field value +func (o *AffinityGroup) GetPolicy() string { + if o == nil { + var ret string + return ret + } + + return o.Policy +} + +// GetPolicyOk returns a tuple with the Policy field value +// and a boolean to check if the value has been set. +func (o *AffinityGroup) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Policy, true +} + +// SetPolicy sets field value +func (o *AffinityGroup) SetPolicy(v string) { + o.Policy = v +} + +func (o AffinityGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AffinityGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + toSerialize["name"] = o.Name + toSerialize["policy"] = o.Policy + return toSerialize, nil +} + +func (o *AffinityGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "policy", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAffinityGroup := _AffinityGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAffinityGroup) + + if err != nil { + return err + } + + *o = AffinityGroup(varAffinityGroup) + + return err +} + +type NullableAffinityGroup struct { + value *AffinityGroup + isSet bool +} + +func (v NullableAffinityGroup) Get() *AffinityGroup { + return v.value +} + +func (v *NullableAffinityGroup) Set(val *AffinityGroup) { + v.value = val + v.isSet = true +} + +func (v NullableAffinityGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableAffinityGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAffinityGroup(val *AffinityGroup) *NullableAffinityGroup { + return &NullableAffinityGroup{value: val, isSet: true} +} + +func (v NullableAffinityGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAffinityGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_affinity_group_list_response.go b/services/iaas/v2beta1api/model_affinity_group_list_response.go new file mode 100644 index 000000000..8425a4f9a --- /dev/null +++ b/services/iaas/v2beta1api/model_affinity_group_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AffinityGroupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AffinityGroupListResponse{} + +// AffinityGroupListResponse Response object for affinity group list request. +type AffinityGroupListResponse struct { + // A list of affinity groups. + Items []AffinityGroup `json:"items"` +} + +type _AffinityGroupListResponse AffinityGroupListResponse + +// NewAffinityGroupListResponse instantiates a new AffinityGroupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAffinityGroupListResponse(items []AffinityGroup) *AffinityGroupListResponse { + this := AffinityGroupListResponse{} + this.Items = items + return &this +} + +// NewAffinityGroupListResponseWithDefaults instantiates a new AffinityGroupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAffinityGroupListResponseWithDefaults() *AffinityGroupListResponse { + this := AffinityGroupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AffinityGroupListResponse) GetItems() []AffinityGroup { + if o == nil { + var ret []AffinityGroup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AffinityGroupListResponse) GetItemsOk() ([]AffinityGroup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AffinityGroupListResponse) SetItems(v []AffinityGroup) { + o.Items = v +} + +func (o AffinityGroupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AffinityGroupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AffinityGroupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAffinityGroupListResponse := _AffinityGroupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAffinityGroupListResponse) + + if err != nil { + return err + } + + *o = AffinityGroupListResponse(varAffinityGroupListResponse) + + return err +} + +type NullableAffinityGroupListResponse struct { + value *AffinityGroupListResponse + isSet bool +} + +func (v NullableAffinityGroupListResponse) Get() *AffinityGroupListResponse { + return v.value +} + +func (v *NullableAffinityGroupListResponse) Set(val *AffinityGroupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAffinityGroupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAffinityGroupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAffinityGroupListResponse(val *AffinityGroupListResponse) *NullableAffinityGroupListResponse { + return &NullableAffinityGroupListResponse{value: val, isSet: true} +} + +func (v NullableAffinityGroupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAffinityGroupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_allowed_addresses_inner.go b/services/iaas/v2beta1api/model_allowed_addresses_inner.go new file mode 100644 index 000000000..af2f669e2 --- /dev/null +++ b/services/iaas/v2beta1api/model_allowed_addresses_inner.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// AllowedAddressesInner - struct for AllowedAddressesInner +type AllowedAddressesInner struct { + String *string +} + +// stringAsAllowedAddressesInner is a convenience function that returns string wrapped in AllowedAddressesInner +func StringAsAllowedAddressesInner(v *string) AllowedAddressesInner { + return AllowedAddressesInner{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *AllowedAddressesInner) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(AllowedAddressesInner)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(AllowedAddressesInner)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src AllowedAddressesInner) MarshalJSON() ([]byte, error) { + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *AllowedAddressesInner) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj AllowedAddressesInner) GetActualInstanceValue() interface{} { + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableAllowedAddressesInner struct { + value *AllowedAddressesInner + isSet bool +} + +func (v NullableAllowedAddressesInner) Get() *AllowedAddressesInner { + return v.value +} + +func (v *NullableAllowedAddressesInner) Set(val *AllowedAddressesInner) { + v.value = val + v.isSet = true +} + +func (v NullableAllowedAddressesInner) IsSet() bool { + return v.isSet +} + +func (v *NullableAllowedAddressesInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAllowedAddressesInner(val *AllowedAddressesInner) *NullableAllowedAddressesInner { + return &NullableAllowedAddressesInner{value: val, isSet: true} +} + +func (v NullableAllowedAddressesInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAllowedAddressesInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_area_id.go b/services/iaas/v2beta1api/model_area_id.go new file mode 100644 index 000000000..938c9d001 --- /dev/null +++ b/services/iaas/v2beta1api/model_area_id.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// AreaId - The identifier (ID) of an area. +type AreaId struct { + StaticAreaID *StaticAreaID + String *string +} + +// StaticAreaIDAsAreaId is a convenience function that returns StaticAreaID wrapped in AreaId +func StaticAreaIDAsAreaId(v *StaticAreaID) AreaId { + return AreaId{ + StaticAreaID: v, + } +} + +// stringAsAreaId is a convenience function that returns string wrapped in AreaId +func StringAsAreaId(v *string) AreaId { + return AreaId{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *AreaId) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into StaticAreaID + err = json.Unmarshal(data, &dst.StaticAreaID) + if err == nil { + jsonStaticAreaID, _ := json.Marshal(dst.StaticAreaID) + if string(jsonStaticAreaID) == "{}" { // empty struct + dst.StaticAreaID = nil + } else { + match++ + } + } else { + dst.StaticAreaID = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.StaticAreaID = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(AreaId)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(AreaId)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src AreaId) MarshalJSON() ([]byte, error) { + if src.StaticAreaID != nil { + return json.Marshal(&src.StaticAreaID) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *AreaId) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.StaticAreaID != nil { + return obj.StaticAreaID + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj AreaId) GetActualInstanceValue() interface{} { + if obj.StaticAreaID != nil { + return *obj.StaticAreaID + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableAreaId struct { + value *AreaId + isSet bool +} + +func (v NullableAreaId) Get() *AreaId { + return v.value +} + +func (v *NullableAreaId) Set(val *AreaId) { + v.value = val + v.isSet = true +} + +func (v NullableAreaId) IsSet() bool { + return v.isSet +} + +func (v *NullableAreaId) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAreaId(val *AreaId) *NullableAreaId { + return &NullableAreaId{value: val, isSet: true} +} + +func (v NullableAreaId) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAreaId) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_availability_zone_list_response.go b/services/iaas/v2beta1api/model_availability_zone_list_response.go new file mode 100644 index 000000000..364ad036c --- /dev/null +++ b/services/iaas/v2beta1api/model_availability_zone_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AvailabilityZoneListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AvailabilityZoneListResponse{} + +// AvailabilityZoneListResponse Availability Zone list response. +type AvailabilityZoneListResponse struct { + // A list of availability zones. + Items []string `json:"items"` +} + +type _AvailabilityZoneListResponse AvailabilityZoneListResponse + +// NewAvailabilityZoneListResponse instantiates a new AvailabilityZoneListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAvailabilityZoneListResponse(items []string) *AvailabilityZoneListResponse { + this := AvailabilityZoneListResponse{} + this.Items = items + return &this +} + +// NewAvailabilityZoneListResponseWithDefaults instantiates a new AvailabilityZoneListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAvailabilityZoneListResponseWithDefaults() *AvailabilityZoneListResponse { + this := AvailabilityZoneListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *AvailabilityZoneListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *AvailabilityZoneListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *AvailabilityZoneListResponse) SetItems(v []string) { + o.Items = v +} + +func (o AvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AvailabilityZoneListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *AvailabilityZoneListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAvailabilityZoneListResponse := _AvailabilityZoneListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAvailabilityZoneListResponse) + + if err != nil { + return err + } + + *o = AvailabilityZoneListResponse(varAvailabilityZoneListResponse) + + return err +} + +type NullableAvailabilityZoneListResponse struct { + value *AvailabilityZoneListResponse + isSet bool +} + +func (v NullableAvailabilityZoneListResponse) Get() *AvailabilityZoneListResponse { + return v.value +} + +func (v *NullableAvailabilityZoneListResponse) Set(val *AvailabilityZoneListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableAvailabilityZoneListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableAvailabilityZoneListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAvailabilityZoneListResponse(val *AvailabilityZoneListResponse) *NullableAvailabilityZoneListResponse { + return &NullableAvailabilityZoneListResponse{value: val, isSet: true} +} + +func (v NullableAvailabilityZoneListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAvailabilityZoneListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_backup.go b/services/iaas/v2beta1api/model_backup.go new file mode 100644 index 000000000..86d52ad7f --- /dev/null +++ b/services/iaas/v2beta1api/model_backup.go @@ -0,0 +1,497 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "time" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup Object that represents a backup. +type Backup struct { + // Object that represents an availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // Universally Unique Identifier (UUID). + SnapshotId *string `json:"snapshotId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewBackup instantiates a new Backup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackup() *Backup { + this := Backup{} + return &this +} + +// NewBackupWithDefaults instantiates a new Backup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *Backup) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *Backup) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *Backup) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Backup) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Backup) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Backup) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *Backup) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *Backup) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *Backup) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Backup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Backup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Backup) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Backup) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Backup) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Backup) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Backup) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Backup) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Backup) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Backup) SetSize(v int64) { + o.Size = &v +} + +// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +func (o *Backup) GetSnapshotId() string { + if o == nil || IsNil(o.SnapshotId) { + var ret string + return ret + } + return *o.SnapshotId +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetSnapshotIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotId) { + return nil, false + } + return o.SnapshotId, true +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *Backup) HasSnapshotId() bool { + if o != nil && !IsNil(o.SnapshotId) { + return true + } + + return false +} + +// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +func (o *Backup) SetSnapshotId(v string) { + o.SnapshotId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Backup) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Backup) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Backup) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Backup) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Backup) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Backup) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *Backup) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *Backup) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *Backup) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o Backup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SnapshotId) { + toSerialize["snapshotId"] = o.SnapshotId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_backup_list_response.go b/services/iaas/v2beta1api/model_backup_list_response.go new file mode 100644 index 000000000..3723dc70f --- /dev/null +++ b/services/iaas/v2beta1api/model_backup_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupListResponse{} + +// BackupListResponse Backup list response. +type BackupListResponse struct { + // A list containing backup objects. + Items []Backup `json:"items"` +} + +type _BackupListResponse BackupListResponse + +// NewBackupListResponse instantiates a new BackupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupListResponse(items []Backup) *BackupListResponse { + this := BackupListResponse{} + this.Items = items + return &this +} + +// NewBackupListResponseWithDefaults instantiates a new BackupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupListResponseWithDefaults() *BackupListResponse { + this := BackupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *BackupListResponse) GetItems() []Backup { + if o == nil { + var ret []Backup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *BackupListResponse) GetItemsOk() ([]Backup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *BackupListResponse) SetItems(v []Backup) { + o.Items = v +} + +func (o BackupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *BackupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupListResponse := _BackupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupListResponse) + + if err != nil { + return err + } + + *o = BackupListResponse(varBackupListResponse) + + return err +} + +type NullableBackupListResponse struct { + value *BackupListResponse + isSet bool +} + +func (v NullableBackupListResponse) Get() *BackupListResponse { + return v.value +} + +func (v *NullableBackupListResponse) Set(val *BackupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBackupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupListResponse(val *BackupListResponse) *NullableBackupListResponse { + return &NullableBackupListResponse{value: val, isSet: true} +} + +func (v NullableBackupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_backup_source.go b/services/iaas/v2beta1api/model_backup_source.go new file mode 100644 index 000000000..c2d000a6d --- /dev/null +++ b/services/iaas/v2beta1api/model_backup_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupSource{} + +// BackupSource The source object of a backup. +type BackupSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a backup. Possible values: `volume`, `snapshot`. + Type string `json:"type"` +} + +type _BackupSource BackupSource + +// NewBackupSource instantiates a new BackupSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBackupSource(id string, types string) *BackupSource { + this := BackupSource{} + this.Id = id + this.Type = types + return &this +} + +// NewBackupSourceWithDefaults instantiates a new BackupSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBackupSourceWithDefaults() *BackupSource { + this := BackupSource{} + return &this +} + +// GetId returns the Id field value +func (o *BackupSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BackupSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BackupSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *BackupSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BackupSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BackupSource) SetType(v string) { + o.Type = v +} + +func (o BackupSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BackupSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupSource := _BackupSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupSource) + + if err != nil { + return err + } + + *o = BackupSource(varBackupSource) + + return err +} + +type NullableBackupSource struct { + value *BackupSource + isSet bool +} + +func (v NullableBackupSource) Get() *BackupSource { + return v.value +} + +func (v *NullableBackupSource) Set(val *BackupSource) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSource) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSource(val *BackupSource) *NullableBackupSource { + return &NullableBackupSource{value: val, isSet: true} +} + +func (v NullableBackupSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_base_security_group_rule.go b/services/iaas/v2beta1api/model_base_security_group_rule.go new file mode 100644 index 000000000..2ff87d2d5 --- /dev/null +++ b/services/iaas/v2beta1api/model_base_security_group_rule.go @@ -0,0 +1,531 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the BaseSecurityGroupRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BaseSecurityGroupRule{} + +// BaseSecurityGroupRule The base schema for a security group rule. +type BaseSecurityGroupRule struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _BaseSecurityGroupRule BaseSecurityGroupRule + +// NewBaseSecurityGroupRule instantiates a new BaseSecurityGroupRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBaseSecurityGroupRule(direction string) *BaseSecurityGroupRule { + this := BaseSecurityGroupRule{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewBaseSecurityGroupRuleWithDefaults instantiates a new BaseSecurityGroupRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBaseSecurityGroupRuleWithDefaults() *BaseSecurityGroupRule { + this := BaseSecurityGroupRule{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *BaseSecurityGroupRule) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *BaseSecurityGroupRule) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *BaseSecurityGroupRule) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *BaseSecurityGroupRule) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *BaseSecurityGroupRule) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *BaseSecurityGroupRule) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BaseSecurityGroupRule) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *BaseSecurityGroupRule) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *BaseSecurityGroupRule) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *BaseSecurityGroupRule) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *BaseSecurityGroupRule) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *BaseSecurityGroupRule) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BaseSecurityGroupRule) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *BaseSecurityGroupRule) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *BaseSecurityGroupRule) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o BaseSecurityGroupRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BaseSecurityGroupRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *BaseSecurityGroupRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBaseSecurityGroupRule := _BaseSecurityGroupRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBaseSecurityGroupRule) + + if err != nil { + return err + } + + *o = BaseSecurityGroupRule(varBaseSecurityGroupRule) + + return err +} + +type NullableBaseSecurityGroupRule struct { + value *BaseSecurityGroupRule + isSet bool +} + +func (v NullableBaseSecurityGroupRule) Get() *BaseSecurityGroupRule { + return v.value +} + +func (v *NullableBaseSecurityGroupRule) Set(val *BaseSecurityGroupRule) { + v.value = val + v.isSet = true +} + +func (v NullableBaseSecurityGroupRule) IsSet() bool { + return v.isSet +} + +func (v *NullableBaseSecurityGroupRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBaseSecurityGroupRule(val *BaseSecurityGroupRule) *NullableBaseSecurityGroupRule { + return &NullableBaseSecurityGroupRule{value: val, isSet: true} +} + +func (v NullableBaseSecurityGroupRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBaseSecurityGroupRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_boot_volume.go b/services/iaas/v2beta1api/model_boot_volume.go new file mode 100644 index 000000000..9c8516a8c --- /dev/null +++ b/services/iaas/v2beta1api/model_boot_volume.go @@ -0,0 +1,273 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the BootVolume type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BootVolume{} + +// BootVolume The boot device for the server. +type BootVolume struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *BootVolumeSource `json:"source,omitempty"` +} + +// NewBootVolume instantiates a new BootVolume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBootVolume() *BootVolume { + this := BootVolume{} + return &this +} + +// NewBootVolumeWithDefaults instantiates a new BootVolume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBootVolumeWithDefaults() *BootVolume { + this := BootVolume{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *BootVolume) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *BootVolume) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *BootVolume) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BootVolume) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BootVolume) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BootVolume) SetId(v string) { + o.Id = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *BootVolume) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *BootVolume) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *BootVolume) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *BootVolume) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *BootVolume) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *BootVolume) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *BootVolume) GetSource() BootVolumeSource { + if o == nil || IsNil(o.Source) { + var ret BootVolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BootVolume) GetSourceOk() (*BootVolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *BootVolume) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given BootVolumeSource and assigns it to the Source field. +func (o *BootVolume) SetSource(v BootVolumeSource) { + o.Source = &v +} + +func (o BootVolume) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BootVolume) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + return toSerialize, nil +} + +type NullableBootVolume struct { + value *BootVolume + isSet bool +} + +func (v NullableBootVolume) Get() *BootVolume { + return v.value +} + +func (v *NullableBootVolume) Set(val *BootVolume) { + v.value = val + v.isSet = true +} + +func (v NullableBootVolume) IsSet() bool { + return v.isSet +} + +func (v *NullableBootVolume) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBootVolume(val *BootVolume) *NullableBootVolume { + return &NullableBootVolume{value: val, isSet: true} +} + +func (v NullableBootVolume) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBootVolume) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_boot_volume_source.go b/services/iaas/v2beta1api/model_boot_volume_source.go new file mode 100644 index 000000000..866408cf1 --- /dev/null +++ b/services/iaas/v2beta1api/model_boot_volume_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BootVolumeSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BootVolumeSource{} + +// BootVolumeSource The source object of a boot volume. +type BootVolumeSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a boot volume. Possible values: `image`, `volume`. + Type string `json:"type"` +} + +type _BootVolumeSource BootVolumeSource + +// NewBootVolumeSource instantiates a new BootVolumeSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBootVolumeSource(id string, types string) *BootVolumeSource { + this := BootVolumeSource{} + this.Id = id + this.Type = types + return &this +} + +// NewBootVolumeSourceWithDefaults instantiates a new BootVolumeSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBootVolumeSourceWithDefaults() *BootVolumeSource { + this := BootVolumeSource{} + return &this +} + +// GetId returns the Id field value +func (o *BootVolumeSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BootVolumeSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BootVolumeSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *BootVolumeSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *BootVolumeSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *BootVolumeSource) SetType(v string) { + o.Type = v +} + +func (o BootVolumeSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BootVolumeSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *BootVolumeSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBootVolumeSource := _BootVolumeSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBootVolumeSource) + + if err != nil { + return err + } + + *o = BootVolumeSource(varBootVolumeSource) + + return err +} + +type NullableBootVolumeSource struct { + value *BootVolumeSource + isSet bool +} + +func (v NullableBootVolumeSource) Get() *BootVolumeSource { + return v.value +} + +func (v *NullableBootVolumeSource) Set(val *BootVolumeSource) { + v.value = val + v.isSet = true +} + +func (v NullableBootVolumeSource) IsSet() bool { + return v.isSet +} + +func (v *NullableBootVolumeSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBootVolumeSource(val *BootVolumeSource) *NullableBootVolumeSource { + return &NullableBootVolumeSource{value: val, isSet: true} +} + +func (v NullableBootVolumeSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBootVolumeSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_affinity_group_payload.go b/services/iaas/v2beta1api/model_create_affinity_group_payload.go new file mode 100644 index 000000000..f434a5341 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_affinity_group_payload.go @@ -0,0 +1,261 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateAffinityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAffinityGroupPayload{} + +// CreateAffinityGroupPayload Definition of an affinity group. +type CreateAffinityGroupPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The servers that are part of the affinity group. + Members []string `json:"members,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The affinity group policy. `hard-affinity`: All servers in this group will be hosted on the same compute node. `soft-affinity`: All servers in this group will be hosted on as few compute nodes as possible. `hard-anti-affinity`: All servers in this group will be hosted on different compute nodes. `soft-anti-affinity`: All servers in this group will be hosted on as many compute nodes as possible. Possible values: `hard-anti-affinity`, `hard-affinity`, `soft-anti-affinity`, `soft-affinity`. + Policy string `json:"policy"` +} + +type _CreateAffinityGroupPayload CreateAffinityGroupPayload + +// NewCreateAffinityGroupPayload instantiates a new CreateAffinityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAffinityGroupPayload(name string, policy string) *CreateAffinityGroupPayload { + this := CreateAffinityGroupPayload{} + this.Name = name + this.Policy = policy + return &this +} + +// NewCreateAffinityGroupPayloadWithDefaults instantiates a new CreateAffinityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAffinityGroupPayloadWithDefaults() *CreateAffinityGroupPayload { + this := CreateAffinityGroupPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateAffinityGroupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateAffinityGroupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateAffinityGroupPayload) SetId(v string) { + o.Id = &v +} + +// GetMembers returns the Members field value if set, zero value otherwise. +func (o *CreateAffinityGroupPayload) GetMembers() []string { + if o == nil || IsNil(o.Members) { + var ret []string + return ret + } + return o.Members +} + +// GetMembersOk returns a tuple with the Members field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetMembersOk() ([]string, bool) { + if o == nil || IsNil(o.Members) { + return nil, false + } + return o.Members, true +} + +// HasMembers returns a boolean if a field has been set. +func (o *CreateAffinityGroupPayload) HasMembers() bool { + if o != nil && !IsNil(o.Members) { + return true + } + + return false +} + +// SetMembers gets a reference to the given []string and assigns it to the Members field. +func (o *CreateAffinityGroupPayload) SetMembers(v []string) { + o.Members = v +} + +// GetName returns the Name field value +func (o *CreateAffinityGroupPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateAffinityGroupPayload) SetName(v string) { + o.Name = v +} + +// GetPolicy returns the Policy field value +func (o *CreateAffinityGroupPayload) GetPolicy() string { + if o == nil { + var ret string + return ret + } + + return o.Policy +} + +// GetPolicyOk returns a tuple with the Policy field value +// and a boolean to check if the value has been set. +func (o *CreateAffinityGroupPayload) GetPolicyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Policy, true +} + +// SetPolicy sets field value +func (o *CreateAffinityGroupPayload) SetPolicy(v string) { + o.Policy = v +} + +func (o CreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAffinityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Members) { + toSerialize["members"] = o.Members + } + toSerialize["name"] = o.Name + toSerialize["policy"] = o.Policy + return toSerialize, nil +} + +func (o *CreateAffinityGroupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "policy", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateAffinityGroupPayload := _CreateAffinityGroupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateAffinityGroupPayload) + + if err != nil { + return err + } + + *o = CreateAffinityGroupPayload(varCreateAffinityGroupPayload) + + return err +} + +type NullableCreateAffinityGroupPayload struct { + value *CreateAffinityGroupPayload + isSet bool +} + +func (v NullableCreateAffinityGroupPayload) Get() *CreateAffinityGroupPayload { + return v.value +} + +func (v *NullableCreateAffinityGroupPayload) Set(val *CreateAffinityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAffinityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAffinityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAffinityGroupPayload(val *CreateAffinityGroupPayload) *NullableCreateAffinityGroupPayload { + return &NullableCreateAffinityGroupPayload{value: val, isSet: true} +} + +func (v NullableCreateAffinityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAffinityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_backup_payload.go b/services/iaas/v2beta1api/model_create_backup_payload.go new file mode 100644 index 000000000..84dfaebdc --- /dev/null +++ b/services/iaas/v2beta1api/model_create_backup_payload.go @@ -0,0 +1,231 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupPayload{} + +// CreateBackupPayload Object that represents a backup create request body. +type CreateBackupPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + Source BackupSource `json:"source"` +} + +type _CreateBackupPayload CreateBackupPayload + +// NewCreateBackupPayload instantiates a new CreateBackupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateBackupPayload(source BackupSource) *CreateBackupPayload { + this := CreateBackupPayload{} + this.Source = source + return &this +} + +// NewCreateBackupPayloadWithDefaults instantiates a new CreateBackupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { + this := CreateBackupPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateBackupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateBackupPayload) SetName(v string) { + o.Name = &v +} + +// GetSource returns the Source field value +func (o *CreateBackupPayload) GetSource() BackupSource { + if o == nil { + var ret BackupSource + return ret + } + + return o.Source +} + +// GetSourceOk returns a tuple with the Source field value +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetSourceOk() (*BackupSource, bool) { + if o == nil { + return nil, false + } + return &o.Source, true +} + +// SetSource sets field value +func (o *CreateBackupPayload) SetSource(v BackupSource) { + o.Source = v +} + +func (o CreateBackupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["source"] = o.Source + return toSerialize, nil +} + +func (o *CreateBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "source", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupPayload := _CreateBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateBackupPayload) + + if err != nil { + return err + } + + *o = CreateBackupPayload(varCreateBackupPayload) + + return err +} + +type NullableCreateBackupPayload struct { + value *CreateBackupPayload + isSet bool +} + +func (v NullableCreateBackupPayload) Get() *CreateBackupPayload { + return v.value +} + +func (v *NullableCreateBackupPayload) Set(val *CreateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupPayload(val *CreateBackupPayload) *NullableCreateBackupPayload { + return &NullableCreateBackupPayload{value: val, isSet: true} +} + +func (v NullableCreateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_image_payload.go b/services/iaas/v2beta1api/model_create_image_payload.go new file mode 100644 index 000000000..ed2af1c6f --- /dev/null +++ b/services/iaas/v2beta1api/model_create_image_payload.go @@ -0,0 +1,740 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateImagePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateImagePayload{} + +// CreateImagePayload Object that represents an Image and its parameters. Used for Creating and returning (get/list). +type CreateImagePayload struct { + Agent *ImageAgent `json:"agent,omitempty"` + Checksum *ImageChecksum `json:"checksum,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat string `json:"diskFormat"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Indicates Image Import Progress in percent. + ImportProgress *int64 `json:"importProgress,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + Owner *string `json:"owner,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` + // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. + Scope *string `json:"scope,omitempty"` + // Size in bytes. + Size *int64 `json:"size,omitempty"` + // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateImagePayload CreateImagePayload + +// NewCreateImagePayload instantiates a new CreateImagePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateImagePayload(diskFormat string, name string) *CreateImagePayload { + this := CreateImagePayload{} + this.DiskFormat = diskFormat + this.Name = name + return &this +} + +// NewCreateImagePayloadWithDefaults instantiates a new CreateImagePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateImagePayloadWithDefaults() *CreateImagePayload { + this := CreateImagePayload{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *CreateImagePayload) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *CreateImagePayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *CreateImagePayload) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *CreateImagePayload) GetChecksum() ImageChecksum { + if o == nil || IsNil(o.Checksum) { + var ret ImageChecksum + return ret + } + return *o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetChecksumOk() (*ImageChecksum, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *CreateImagePayload) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +func (o *CreateImagePayload) SetChecksum(v ImageChecksum) { + o.Checksum = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *CreateImagePayload) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *CreateImagePayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *CreateImagePayload) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateImagePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateImagePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateImagePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDiskFormat returns the DiskFormat field value +func (o *CreateImagePayload) GetDiskFormat() string { + if o == nil { + var ret string + return ret + } + + return o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetDiskFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DiskFormat, true +} + +// SetDiskFormat sets field value +func (o *CreateImagePayload) SetDiskFormat(v string) { + o.DiskFormat = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateImagePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateImagePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateImagePayload) SetId(v string) { + o.Id = &v +} + +// GetImportProgress returns the ImportProgress field value if set, zero value otherwise. +func (o *CreateImagePayload) GetImportProgress() int64 { + if o == nil || IsNil(o.ImportProgress) { + var ret int64 + return ret + } + return *o.ImportProgress +} + +// GetImportProgressOk returns a tuple with the ImportProgress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetImportProgressOk() (*int64, bool) { + if o == nil || IsNil(o.ImportProgress) { + return nil, false + } + return o.ImportProgress, true +} + +// HasImportProgress returns a boolean if a field has been set. +func (o *CreateImagePayload) HasImportProgress() bool { + if o != nil && !IsNil(o.ImportProgress) { + return true + } + + return false +} + +// SetImportProgress gets a reference to the given int64 and assigns it to the ImportProgress field. +func (o *CreateImagePayload) SetImportProgress(v int64) { + o.ImportProgress = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateImagePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateImagePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateImagePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *CreateImagePayload) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *CreateImagePayload) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *CreateImagePayload) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *CreateImagePayload) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *CreateImagePayload) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *CreateImagePayload) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value +func (o *CreateImagePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateImagePayload) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *CreateImagePayload) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *CreateImagePayload) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *CreateImagePayload) SetOwner(v string) { + o.Owner = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *CreateImagePayload) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *CreateImagePayload) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *CreateImagePayload) SetProtected(v bool) { + o.Protected = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *CreateImagePayload) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *CreateImagePayload) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *CreateImagePayload) SetScope(v string) { + o.Scope = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateImagePayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateImagePayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateImagePayload) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateImagePayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateImagePayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateImagePayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateImagePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateImagePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateImagePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateImagePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateImagePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateImagePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["diskFormat"] = o.DiskFormat + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImportProgress) { + toSerialize["importProgress"] = o.ImportProgress + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateImagePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "diskFormat", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateImagePayload := _CreateImagePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateImagePayload) + + if err != nil { + return err + } + + *o = CreateImagePayload(varCreateImagePayload) + + return err +} + +type NullableCreateImagePayload struct { + value *CreateImagePayload + isSet bool +} + +func (v NullableCreateImagePayload) Get() *CreateImagePayload { + return v.value +} + +func (v *NullableCreateImagePayload) Set(val *CreateImagePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateImagePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateImagePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateImagePayload(val *CreateImagePayload) *NullableCreateImagePayload { + return &NullableCreateImagePayload{value: val, isSet: true} +} + +func (v NullableCreateImagePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateImagePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_isolated_network_payload.go b/services/iaas/v2beta1api/model_create_isolated_network_payload.go new file mode 100644 index 000000000..d614903be --- /dev/null +++ b/services/iaas/v2beta1api/model_create_isolated_network_payload.go @@ -0,0 +1,272 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateIsolatedNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateIsolatedNetworkPayload{} + +// CreateIsolatedNetworkPayload Object that represents the request body for a single isolated network create. +type CreateIsolatedNetworkPayload struct { + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + Ipv4 *CreateNetworkIPv4 `json:"ipv4,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +type _CreateIsolatedNetworkPayload CreateIsolatedNetworkPayload + +// NewCreateIsolatedNetworkPayload instantiates a new CreateIsolatedNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateIsolatedNetworkPayload(name string) *CreateIsolatedNetworkPayload { + this := CreateIsolatedNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + this.Name = name + return &this +} + +// NewCreateIsolatedNetworkPayloadWithDefaults instantiates a new CreateIsolatedNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateIsolatedNetworkPayloadWithDefaults() *CreateIsolatedNetworkPayload { + this := CreateIsolatedNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + return &this +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *CreateIsolatedNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateIsolatedNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *CreateIsolatedNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *CreateIsolatedNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateIsolatedNetworkPayload) GetIpv4() CreateNetworkIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret CreateNetworkIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateIsolatedNetworkPayload) GetIpv4Ok() (*CreateNetworkIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateIsolatedNetworkPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. +func (o *CreateIsolatedNetworkPayload) SetIpv4(v CreateNetworkIPv4) { + o.Ipv4 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateIsolatedNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateIsolatedNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateIsolatedNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateIsolatedNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateIsolatedNetworkPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateIsolatedNetworkPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateIsolatedNetworkPayload) SetName(v string) { + o.Name = v +} + +func (o CreateIsolatedNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateIsolatedNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *CreateIsolatedNetworkPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateIsolatedNetworkPayload := _CreateIsolatedNetworkPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateIsolatedNetworkPayload) + + if err != nil { + return err + } + + *o = CreateIsolatedNetworkPayload(varCreateIsolatedNetworkPayload) + + return err +} + +type NullableCreateIsolatedNetworkPayload struct { + value *CreateIsolatedNetworkPayload + isSet bool +} + +func (v NullableCreateIsolatedNetworkPayload) Get() *CreateIsolatedNetworkPayload { + return v.value +} + +func (v *NullableCreateIsolatedNetworkPayload) Set(val *CreateIsolatedNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateIsolatedNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateIsolatedNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateIsolatedNetworkPayload(val *CreateIsolatedNetworkPayload) *NullableCreateIsolatedNetworkPayload { + return &NullableCreateIsolatedNetworkPayload{value: val, isSet: true} +} + +func (v NullableCreateIsolatedNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateIsolatedNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_key_pair_payload.go b/services/iaas/v2beta1api/model_create_key_pair_payload.go new file mode 100644 index 000000000..94dff18ca --- /dev/null +++ b/services/iaas/v2beta1api/model_create_key_pair_payload.go @@ -0,0 +1,344 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateKeyPairPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateKeyPairPayload{} + +// CreateKeyPairPayload Object that represents the public key of an SSH keypair and its name. +type CreateKeyPairPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents an SSH keypair MD5 fingerprint. + Fingerprint *string `json:"fingerprint,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // Object that represents a public SSH key. + PublicKey string `json:"publicKey" validate:"regexp=^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\\\\s+[A-Za-z0-9+\\/]+[=]{0,3}(\\\\s+.+)?\\\\s*$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateKeyPairPayload CreateKeyPairPayload + +// NewCreateKeyPairPayload instantiates a new CreateKeyPairPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateKeyPairPayload(publicKey string) *CreateKeyPairPayload { + this := CreateKeyPairPayload{} + this.PublicKey = publicKey + return &this +} + +// NewCreateKeyPairPayloadWithDefaults instantiates a new CreateKeyPairPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateKeyPairPayloadWithDefaults() *CreateKeyPairPayload { + this := CreateKeyPairPayload{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateKeyPairPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetFingerprint() string { + if o == nil || IsNil(o.Fingerprint) { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetFingerprintOk() (*string, bool) { + if o == nil || IsNil(o.Fingerprint) { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasFingerprint() bool { + if o != nil && !IsNil(o.Fingerprint) { + return true + } + + return false +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *CreateKeyPairPayload) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateKeyPairPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateKeyPairPayload) SetName(v string) { + o.Name = &v +} + +// GetPublicKey returns the PublicKey field value +func (o *CreateKeyPairPayload) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *CreateKeyPairPayload) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateKeyPairPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateKeyPairPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateKeyPairPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateKeyPairPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateKeyPairPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateKeyPairPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Fingerprint) { + toSerialize["fingerprint"] = o.Fingerprint + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["publicKey"] = o.PublicKey + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateKeyPairPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "publicKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateKeyPairPayload := _CreateKeyPairPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateKeyPairPayload) + + if err != nil { + return err + } + + *o = CreateKeyPairPayload(varCreateKeyPairPayload) + + return err +} + +type NullableCreateKeyPairPayload struct { + value *CreateKeyPairPayload + isSet bool +} + +func (v NullableCreateKeyPairPayload) Get() *CreateKeyPairPayload { + return v.value +} + +func (v *NullableCreateKeyPairPayload) Set(val *CreateKeyPairPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateKeyPairPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateKeyPairPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateKeyPairPayload(val *CreateKeyPairPayload) *NullableCreateKeyPairPayload { + return &NullableCreateKeyPairPayload{value: val, isSet: true} +} + +func (v NullableCreateKeyPairPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateKeyPairPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_area_payload.go b/services/iaas/v2beta1api/model_create_network_area_payload.go new file mode 100644 index 000000000..bd675879f --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_area_payload.go @@ -0,0 +1,194 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaPayload{} + +// CreateNetworkAreaPayload Object that represents the network area create request. +type CreateNetworkAreaPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` +} + +type _CreateNetworkAreaPayload CreateNetworkAreaPayload + +// NewCreateNetworkAreaPayload instantiates a new CreateNetworkAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaPayload(name string) *CreateNetworkAreaPayload { + this := CreateNetworkAreaPayload{} + this.Name = name + return &this +} + +// NewCreateNetworkAreaPayloadWithDefaults instantiates a new CreateNetworkAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaPayloadWithDefaults() *CreateNetworkAreaPayload { + this := CreateNetworkAreaPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkAreaPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkAreaPayload) SetName(v string) { + o.Name = v +} + +func (o CreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *CreateNetworkAreaPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkAreaPayload := _CreateNetworkAreaPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkAreaPayload) + + if err != nil { + return err + } + + *o = CreateNetworkAreaPayload(varCreateNetworkAreaPayload) + + return err +} + +type NullableCreateNetworkAreaPayload struct { + value *CreateNetworkAreaPayload + isSet bool +} + +func (v NullableCreateNetworkAreaPayload) Get() *CreateNetworkAreaPayload { + return v.value +} + +func (v *NullableCreateNetworkAreaPayload) Set(val *CreateNetworkAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaPayload(val *CreateNetworkAreaPayload) *NullableCreateNetworkAreaPayload { + return &NullableCreateNetworkAreaPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_area_range_payload.go b/services/iaas/v2beta1api/model_create_network_area_range_payload.go new file mode 100644 index 000000000..d95605cd3 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_area_range_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the CreateNetworkAreaRangePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRangePayload{} + +// CreateNetworkAreaRangePayload struct for CreateNetworkAreaRangePayload +type CreateNetworkAreaRangePayload struct { + // A list of network ranges. + Ipv4 []NetworkRange `json:"ipv4,omitempty"` +} + +// NewCreateNetworkAreaRangePayload instantiates a new CreateNetworkAreaRangePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaRangePayload() *CreateNetworkAreaRangePayload { + this := CreateNetworkAreaRangePayload{} + return &this +} + +// NewCreateNetworkAreaRangePayloadWithDefaults instantiates a new CreateNetworkAreaRangePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaRangePayloadWithDefaults() *CreateNetworkAreaRangePayload { + this := CreateNetworkAreaRangePayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkAreaRangePayload) GetIpv4() []NetworkRange { + if o == nil || IsNil(o.Ipv4) { + var ret []NetworkRange + return ret + } + return o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRangePayload) GetIpv4Ok() ([]NetworkRange, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkAreaRangePayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given []NetworkRange and assigns it to the Ipv4 field. +func (o *CreateNetworkAreaRangePayload) SetIpv4(v []NetworkRange) { + o.Ipv4 = v +} + +func (o CreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaRangePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableCreateNetworkAreaRangePayload struct { + value *CreateNetworkAreaRangePayload + isSet bool +} + +func (v NullableCreateNetworkAreaRangePayload) Get() *CreateNetworkAreaRangePayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRangePayload) Set(val *CreateNetworkAreaRangePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRangePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRangePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRangePayload(val *CreateNetworkAreaRangePayload) *NullableCreateNetworkAreaRangePayload { + return &NullableCreateNetworkAreaRangePayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRangePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRangePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_area_route_payload.go b/services/iaas/v2beta1api/model_create_network_area_route_payload.go new file mode 100644 index 000000000..e2d23307b --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_area_route_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkAreaRoutePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkAreaRoutePayload{} + +// CreateNetworkAreaRoutePayload Object represents a request to add network routes. +type CreateNetworkAreaRoutePayload struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _CreateNetworkAreaRoutePayload CreateNetworkAreaRoutePayload + +// NewCreateNetworkAreaRoutePayload instantiates a new CreateNetworkAreaRoutePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkAreaRoutePayload(items []Route) *CreateNetworkAreaRoutePayload { + this := CreateNetworkAreaRoutePayload{} + this.Items = items + return &this +} + +// NewCreateNetworkAreaRoutePayloadWithDefaults instantiates a new CreateNetworkAreaRoutePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkAreaRoutePayloadWithDefaults() *CreateNetworkAreaRoutePayload { + this := CreateNetworkAreaRoutePayload{} + return &this +} + +// GetItems returns the Items field value +func (o *CreateNetworkAreaRoutePayload) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkAreaRoutePayload) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *CreateNetworkAreaRoutePayload) SetItems(v []Route) { + o.Items = v +} + +func (o CreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkAreaRoutePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *CreateNetworkAreaRoutePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkAreaRoutePayload := _CreateNetworkAreaRoutePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkAreaRoutePayload) + + if err != nil { + return err + } + + *o = CreateNetworkAreaRoutePayload(varCreateNetworkAreaRoutePayload) + + return err +} + +type NullableCreateNetworkAreaRoutePayload struct { + value *CreateNetworkAreaRoutePayload + isSet bool +} + +func (v NullableCreateNetworkAreaRoutePayload) Get() *CreateNetworkAreaRoutePayload { + return v.value +} + +func (v *NullableCreateNetworkAreaRoutePayload) Set(val *CreateNetworkAreaRoutePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkAreaRoutePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkAreaRoutePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkAreaRoutePayload(val *CreateNetworkAreaRoutePayload) *NullableCreateNetworkAreaRoutePayload { + return &NullableCreateNetworkAreaRoutePayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkAreaRoutePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkAreaRoutePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_ipv4.go b/services/iaas/v2beta1api/model_create_network_ipv4.go new file mode 100644 index 000000000..0d9d3916e --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_ipv4.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// CreateNetworkIPv4 - The create request for an IPv4 network. +type CreateNetworkIPv4 struct { + CreateNetworkIPv4WithPrefix *CreateNetworkIPv4WithPrefix + CreateNetworkIPv4WithPrefixLength *CreateNetworkIPv4WithPrefixLength +} + +// CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefix wrapped in CreateNetworkIPv4 +func CreateNetworkIPv4WithPrefixAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefix) CreateNetworkIPv4 { + return CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefix: v, + } +} + +// CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4 is a convenience function that returns CreateNetworkIPv4WithPrefixLength wrapped in CreateNetworkIPv4 +func CreateNetworkIPv4WithPrefixLengthAsCreateNetworkIPv4(v *CreateNetworkIPv4WithPrefixLength) CreateNetworkIPv4 { + return CreateNetworkIPv4{ + CreateNetworkIPv4WithPrefixLength: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateNetworkIPv4) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateNetworkIPv4WithPrefix + err = json.Unmarshal(data, &dst.CreateNetworkIPv4WithPrefix) + if err == nil { + jsonCreateNetworkIPv4WithPrefix, _ := json.Marshal(dst.CreateNetworkIPv4WithPrefix) + if string(jsonCreateNetworkIPv4WithPrefix) == "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefix = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv4WithPrefix = nil + } + + // try to unmarshal data into CreateNetworkIPv4WithPrefixLength + err = json.Unmarshal(data, &dst.CreateNetworkIPv4WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv4WithPrefixLength, _ := json.Marshal(dst.CreateNetworkIPv4WithPrefixLength) + if string(jsonCreateNetworkIPv4WithPrefixLength) == "{}" { // empty struct + dst.CreateNetworkIPv4WithPrefixLength = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv4WithPrefixLength = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateNetworkIPv4WithPrefix = nil + dst.CreateNetworkIPv4WithPrefixLength = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateNetworkIPv4)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv4)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateNetworkIPv4) MarshalJSON() ([]byte, error) { + if src.CreateNetworkIPv4WithPrefix != nil { + return json.Marshal(&src.CreateNetworkIPv4WithPrefix) + } + + if src.CreateNetworkIPv4WithPrefixLength != nil { + return json.Marshal(&src.CreateNetworkIPv4WithPrefixLength) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateNetworkIPv4) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateNetworkIPv4WithPrefix != nil { + return obj.CreateNetworkIPv4WithPrefix + } + + if obj.CreateNetworkIPv4WithPrefixLength != nil { + return obj.CreateNetworkIPv4WithPrefixLength + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateNetworkIPv4) GetActualInstanceValue() interface{} { + if obj.CreateNetworkIPv4WithPrefix != nil { + return *obj.CreateNetworkIPv4WithPrefix + } + + if obj.CreateNetworkIPv4WithPrefixLength != nil { + return *obj.CreateNetworkIPv4WithPrefixLength + } + + // all schemas are nil + return nil +} + +type NullableCreateNetworkIPv4 struct { + value *CreateNetworkIPv4 + isSet bool +} + +func (v NullableCreateNetworkIPv4) Get() *CreateNetworkIPv4 { + return v.value +} + +func (v *NullableCreateNetworkIPv4) Set(val *CreateNetworkIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4(val *CreateNetworkIPv4) *NullableCreateNetworkIPv4 { + return &NullableCreateNetworkIPv4{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_ipv4_with_prefix.go b/services/iaas/v2beta1api/model_create_network_ipv4_with_prefix.go new file mode 100644 index 000000000..dddc25dee --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_ipv4_with_prefix.go @@ -0,0 +1,243 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv4WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefix{} + +// CreateNetworkIPv4WithPrefix The create request for an IPv4 network with a specified prefix. +type CreateNetworkIPv4WithPrefix struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + // IPv4 Classless Inter-Domain Routing (CIDR). + Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` +} + +type _CreateNetworkIPv4WithPrefix CreateNetworkIPv4WithPrefix + +// NewCreateNetworkIPv4WithPrefix instantiates a new CreateNetworkIPv4WithPrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4WithPrefix(prefix string) *CreateNetworkIPv4WithPrefix { + this := CreateNetworkIPv4WithPrefix{} + this.Prefix = prefix + return &this +} + +// NewCreateNetworkIPv4WithPrefixWithDefaults instantiates a new CreateNetworkIPv4WithPrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4WithPrefixWithDefaults() *CreateNetworkIPv4WithPrefix { + this := CreateNetworkIPv4WithPrefix{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv4WithPrefix) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv4WithPrefix) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefix) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *CreateNetworkIPv4WithPrefix) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv4WithPrefix) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv4WithPrefix) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4WithPrefix) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefix) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefix) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4WithPrefix) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value +func (o *CreateNetworkIPv4WithPrefix) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefix) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *CreateNetworkIPv4WithPrefix) SetPrefix(v string) { + o.Prefix = v +} + +func (o CreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv4WithPrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefix"] = o.Prefix + return toSerialize, nil +} + +func (o *CreateNetworkIPv4WithPrefix) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv4WithPrefix := _CreateNetworkIPv4WithPrefix{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv4WithPrefix) + + if err != nil { + return err + } + + *o = CreateNetworkIPv4WithPrefix(varCreateNetworkIPv4WithPrefix) + + return err +} + +type NullableCreateNetworkIPv4WithPrefix struct { + value *CreateNetworkIPv4WithPrefix + isSet bool +} + +func (v NullableCreateNetworkIPv4WithPrefix) Get() *CreateNetworkIPv4WithPrefix { + return v.value +} + +func (v *NullableCreateNetworkIPv4WithPrefix) Set(val *CreateNetworkIPv4WithPrefix) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4WithPrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4WithPrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4WithPrefix(val *CreateNetworkIPv4WithPrefix) *NullableCreateNetworkIPv4WithPrefix { + return &NullableCreateNetworkIPv4WithPrefix{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4WithPrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4WithPrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_ipv4_with_prefix_length.go b/services/iaas/v2beta1api/model_create_network_ipv4_with_prefix_length.go new file mode 100644 index 000000000..a5de644ce --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_ipv4_with_prefix_length.go @@ -0,0 +1,194 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv4WithPrefixLength type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv4WithPrefixLength{} + +// CreateNetworkIPv4WithPrefixLength The create request for an IPv4 network with a wanted prefix length. +type CreateNetworkIPv4WithPrefixLength struct { + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + PrefixLength int64 `json:"prefixLength"` +} + +type _CreateNetworkIPv4WithPrefixLength CreateNetworkIPv4WithPrefixLength + +// NewCreateNetworkIPv4WithPrefixLength instantiates a new CreateNetworkIPv4WithPrefixLength object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv4WithPrefixLength(prefixLength int64) *CreateNetworkIPv4WithPrefixLength { + this := CreateNetworkIPv4WithPrefixLength{} + this.PrefixLength = prefixLength + return &this +} + +// NewCreateNetworkIPv4WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv4WithPrefixLength object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv4WithPrefixLengthWithDefaults() *CreateNetworkIPv4WithPrefixLength { + this := CreateNetworkIPv4WithPrefixLength{} + return &this +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv4WithPrefixLength) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefixLength) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv4WithPrefixLength) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv4WithPrefixLength) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixLength returns the PrefixLength field value +func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLength() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv4WithPrefixLength) GetPrefixLengthOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.PrefixLength, true +} + +// SetPrefixLength sets field value +func (o *CreateNetworkIPv4WithPrefixLength) SetPrefixLength(v int64) { + o.PrefixLength = v +} + +func (o CreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv4WithPrefixLength) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixLength"] = o.PrefixLength + return toSerialize, nil +} + +func (o *CreateNetworkIPv4WithPrefixLength) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixLength", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv4WithPrefixLength := _CreateNetworkIPv4WithPrefixLength{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv4WithPrefixLength) + + if err != nil { + return err + } + + *o = CreateNetworkIPv4WithPrefixLength(varCreateNetworkIPv4WithPrefixLength) + + return err +} + +type NullableCreateNetworkIPv4WithPrefixLength struct { + value *CreateNetworkIPv4WithPrefixLength + isSet bool +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) Get() *CreateNetworkIPv4WithPrefixLength { + return v.value +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) Set(val *CreateNetworkIPv4WithPrefixLength) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv4WithPrefixLength(val *CreateNetworkIPv4WithPrefixLength) *NullableCreateNetworkIPv4WithPrefixLength { + return &NullableCreateNetworkIPv4WithPrefixLength{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv4WithPrefixLength) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv4WithPrefixLength) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_ipv6.go b/services/iaas/v2beta1api/model_create_network_ipv6.go new file mode 100644 index 000000000..6f00fbd04 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_ipv6.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// CreateNetworkIPv6 - The create request for an IPv6 network. +type CreateNetworkIPv6 struct { + CreateNetworkIPv6WithPrefix *CreateNetworkIPv6WithPrefix + CreateNetworkIPv6WithPrefixLength *CreateNetworkIPv6WithPrefixLength +} + +// CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefix wrapped in CreateNetworkIPv6 +func CreateNetworkIPv6WithPrefixAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefix) CreateNetworkIPv6 { + return CreateNetworkIPv6{ + CreateNetworkIPv6WithPrefix: v, + } +} + +// CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6 is a convenience function that returns CreateNetworkIPv6WithPrefixLength wrapped in CreateNetworkIPv6 +func CreateNetworkIPv6WithPrefixLengthAsCreateNetworkIPv6(v *CreateNetworkIPv6WithPrefixLength) CreateNetworkIPv6 { + return CreateNetworkIPv6{ + CreateNetworkIPv6WithPrefixLength: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateNetworkIPv6) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateNetworkIPv6WithPrefix + err = json.Unmarshal(data, &dst.CreateNetworkIPv6WithPrefix) + if err == nil { + jsonCreateNetworkIPv6WithPrefix, _ := json.Marshal(dst.CreateNetworkIPv6WithPrefix) + if string(jsonCreateNetworkIPv6WithPrefix) == "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefix = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv6WithPrefix = nil + } + + // try to unmarshal data into CreateNetworkIPv6WithPrefixLength + err = json.Unmarshal(data, &dst.CreateNetworkIPv6WithPrefixLength) + if err == nil { + jsonCreateNetworkIPv6WithPrefixLength, _ := json.Marshal(dst.CreateNetworkIPv6WithPrefixLength) + if string(jsonCreateNetworkIPv6WithPrefixLength) == "{}" { // empty struct + dst.CreateNetworkIPv6WithPrefixLength = nil + } else { + match++ + } + } else { + dst.CreateNetworkIPv6WithPrefixLength = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateNetworkIPv6WithPrefix = nil + dst.CreateNetworkIPv6WithPrefixLength = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateNetworkIPv6)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateNetworkIPv6)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateNetworkIPv6) MarshalJSON() ([]byte, error) { + if src.CreateNetworkIPv6WithPrefix != nil { + return json.Marshal(&src.CreateNetworkIPv6WithPrefix) + } + + if src.CreateNetworkIPv6WithPrefixLength != nil { + return json.Marshal(&src.CreateNetworkIPv6WithPrefixLength) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateNetworkIPv6) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateNetworkIPv6WithPrefix != nil { + return obj.CreateNetworkIPv6WithPrefix + } + + if obj.CreateNetworkIPv6WithPrefixLength != nil { + return obj.CreateNetworkIPv6WithPrefixLength + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateNetworkIPv6) GetActualInstanceValue() interface{} { + if obj.CreateNetworkIPv6WithPrefix != nil { + return *obj.CreateNetworkIPv6WithPrefix + } + + if obj.CreateNetworkIPv6WithPrefixLength != nil { + return *obj.CreateNetworkIPv6WithPrefixLength + } + + // all schemas are nil + return nil +} + +type NullableCreateNetworkIPv6 struct { + value *CreateNetworkIPv6 + isSet bool +} + +func (v NullableCreateNetworkIPv6) Get() *CreateNetworkIPv6 { + return v.value +} + +func (v *NullableCreateNetworkIPv6) Set(val *CreateNetworkIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6(val *CreateNetworkIPv6) *NullableCreateNetworkIPv6 { + return &NullableCreateNetworkIPv6{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_ipv6_with_prefix.go b/services/iaas/v2beta1api/model_create_network_ipv6_with_prefix.go new file mode 100644 index 000000000..d10dbb1ec --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_ipv6_with_prefix.go @@ -0,0 +1,243 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv6WithPrefix type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefix{} + +// CreateNetworkIPv6WithPrefix The create request for an IPv6 network with a specified prefix. +type CreateNetworkIPv6WithPrefix struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + // Classless Inter-Domain Routing (CIDR) for IPv6. + Prefix string `json:"prefix" validate:"regexp=^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +type _CreateNetworkIPv6WithPrefix CreateNetworkIPv6WithPrefix + +// NewCreateNetworkIPv6WithPrefix instantiates a new CreateNetworkIPv6WithPrefix object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6WithPrefix(prefix string) *CreateNetworkIPv6WithPrefix { + this := CreateNetworkIPv6WithPrefix{} + this.Prefix = prefix + return &this +} + +// NewCreateNetworkIPv6WithPrefixWithDefaults instantiates a new CreateNetworkIPv6WithPrefix object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6WithPrefixWithDefaults() *CreateNetworkIPv6WithPrefix { + this := CreateNetworkIPv6WithPrefix{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateNetworkIPv6WithPrefix) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateNetworkIPv6WithPrefix) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefix) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *CreateNetworkIPv6WithPrefix) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *CreateNetworkIPv6WithPrefix) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *CreateNetworkIPv6WithPrefix) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6WithPrefix) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefix) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefix) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6WithPrefix) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefix returns the Prefix field value +func (o *CreateNetworkIPv6WithPrefix) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefix) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *CreateNetworkIPv6WithPrefix) SetPrefix(v string) { + o.Prefix = v +} + +func (o CreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv6WithPrefix) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefix"] = o.Prefix + return toSerialize, nil +} + +func (o *CreateNetworkIPv6WithPrefix) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv6WithPrefix := _CreateNetworkIPv6WithPrefix{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv6WithPrefix) + + if err != nil { + return err + } + + *o = CreateNetworkIPv6WithPrefix(varCreateNetworkIPv6WithPrefix) + + return err +} + +type NullableCreateNetworkIPv6WithPrefix struct { + value *CreateNetworkIPv6WithPrefix + isSet bool +} + +func (v NullableCreateNetworkIPv6WithPrefix) Get() *CreateNetworkIPv6WithPrefix { + return v.value +} + +func (v *NullableCreateNetworkIPv6WithPrefix) Set(val *CreateNetworkIPv6WithPrefix) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6WithPrefix) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6WithPrefix) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6WithPrefix(val *CreateNetworkIPv6WithPrefix) *NullableCreateNetworkIPv6WithPrefix { + return &NullableCreateNetworkIPv6WithPrefix{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6WithPrefix) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6WithPrefix) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_ipv6_with_prefix_length.go b/services/iaas/v2beta1api/model_create_network_ipv6_with_prefix_length.go new file mode 100644 index 000000000..64d466f52 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_ipv6_with_prefix_length.go @@ -0,0 +1,194 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkIPv6WithPrefixLength type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkIPv6WithPrefixLength{} + +// CreateNetworkIPv6WithPrefixLength The create request for an IPv6 network with a wanted prefix length. +type CreateNetworkIPv6WithPrefixLength struct { + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + PrefixLength int64 `json:"prefixLength"` +} + +type _CreateNetworkIPv6WithPrefixLength CreateNetworkIPv6WithPrefixLength + +// NewCreateNetworkIPv6WithPrefixLength instantiates a new CreateNetworkIPv6WithPrefixLength object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkIPv6WithPrefixLength(prefixLength int64) *CreateNetworkIPv6WithPrefixLength { + this := CreateNetworkIPv6WithPrefixLength{} + this.PrefixLength = prefixLength + return &this +} + +// NewCreateNetworkIPv6WithPrefixLengthWithDefaults instantiates a new CreateNetworkIPv6WithPrefixLength object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkIPv6WithPrefixLengthWithDefaults() *CreateNetworkIPv6WithPrefixLength { + this := CreateNetworkIPv6WithPrefixLength{} + return &this +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *CreateNetworkIPv6WithPrefixLength) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefixLength) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *CreateNetworkIPv6WithPrefixLength) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *CreateNetworkIPv6WithPrefixLength) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixLength returns the PrefixLength field value +func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLength() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.PrefixLength +} + +// GetPrefixLengthOk returns a tuple with the PrefixLength field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkIPv6WithPrefixLength) GetPrefixLengthOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.PrefixLength, true +} + +// SetPrefixLength sets field value +func (o *CreateNetworkIPv6WithPrefixLength) SetPrefixLength(v int64) { + o.PrefixLength = v +} + +func (o CreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkIPv6WithPrefixLength) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixLength"] = o.PrefixLength + return toSerialize, nil +} + +func (o *CreateNetworkIPv6WithPrefixLength) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixLength", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkIPv6WithPrefixLength := _CreateNetworkIPv6WithPrefixLength{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkIPv6WithPrefixLength) + + if err != nil { + return err + } + + *o = CreateNetworkIPv6WithPrefixLength(varCreateNetworkIPv6WithPrefixLength) + + return err +} + +type NullableCreateNetworkIPv6WithPrefixLength struct { + value *CreateNetworkIPv6WithPrefixLength + isSet bool +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) Get() *CreateNetworkIPv6WithPrefixLength { + return v.value +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) Set(val *CreateNetworkIPv6WithPrefixLength) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkIPv6WithPrefixLength(val *CreateNetworkIPv6WithPrefixLength) *NullableCreateNetworkIPv6WithPrefixLength { + return &NullableCreateNetworkIPv6WithPrefixLength{value: val, isSet: true} +} + +func (v NullableCreateNetworkIPv6WithPrefixLength) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkIPv6WithPrefixLength) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_network_payload.go b/services/iaas/v2beta1api/model_create_network_payload.go new file mode 100644 index 000000000..c2f506897 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_network_payload.go @@ -0,0 +1,382 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNetworkPayload{} + +// CreateNetworkPayload Object that represents the request body for a network create. +type CreateNetworkPayload struct { + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + Ipv4 *CreateNetworkIPv4 `json:"ipv4,omitempty"` + Ipv6 *CreateNetworkIPv6 `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _CreateNetworkPayload CreateNetworkPayload + +// NewCreateNetworkPayload instantiates a new CreateNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNetworkPayload(name string) *CreateNetworkPayload { + this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + this.Name = name + return &this +} + +// NewCreateNetworkPayloadWithDefaults instantiates a new CreateNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { + this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp + return &this +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *CreateNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetIpv4() CreateNetworkIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret CreateNetworkIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetIpv4Ok() (*CreateNetworkIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given CreateNetworkIPv4 and assigns it to the Ipv4 field. +func (o *CreateNetworkPayload) SetIpv4(v CreateNetworkIPv4) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetIpv6() CreateNetworkIPv6 { + if o == nil || IsNil(o.Ipv6) { + var ret CreateNetworkIPv6 + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetIpv6Ok() (*CreateNetworkIPv6, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given CreateNetworkIPv6 and assigns it to the Ipv6 field. +func (o *CreateNetworkPayload) SetIpv6(v CreateNetworkIPv6) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateNetworkPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateNetworkPayload) SetName(v string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *CreateNetworkPayload) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *CreateNetworkPayload) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +func (o CreateNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + return toSerialize, nil +} + +func (o *CreateNetworkPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateNetworkPayload := _CreateNetworkPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateNetworkPayload) + + if err != nil { + return err + } + + *o = CreateNetworkPayload(varCreateNetworkPayload) + + return err +} + +type NullableCreateNetworkPayload struct { + value *CreateNetworkPayload + isSet bool +} + +func (v NullableCreateNetworkPayload) Get() *CreateNetworkPayload { + return v.value +} + +func (v *NullableCreateNetworkPayload) Set(val *CreateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNetworkPayload(val *CreateNetworkPayload) *NullableCreateNetworkPayload { + return &NullableCreateNetworkPayload{value: val, isSet: true} +} + +func (v NullableCreateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_nic_payload.go b/services/iaas/v2beta1api/model_create_nic_payload.go new file mode 100644 index 000000000..0e65c95a7 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_nic_payload.go @@ -0,0 +1,611 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the CreateNicPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateNicPayload{} + +// CreateNicPayload Object that represents a network interface. +type CreateNicPayload struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Device *string `json:"device,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents an MAC address. + Mac *string `json:"mac,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` + // Possible values: `ACTIVE`, `DOWN`. + Status *string `json:"status,omitempty"` + // Possible values: `server`, `metadata`, `gateway`, `none`. + Type *string `json:"type,omitempty"` +} + +// NewCreateNicPayload instantiates a new CreateNicPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateNicPayload() *CreateNicPayload { + this := CreateNicPayload{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// NewCreateNicPayloadWithDefaults instantiates a new CreateNicPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateNicPayloadWithDefaults() *CreateNicPayload { + this := CreateNicPayload{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *CreateNicPayload) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *CreateNicPayload) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *CreateNicPayload) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateNicPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateNicPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateNicPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *CreateNicPayload) GetDevice() string { + if o == nil || IsNil(o.Device) { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetDeviceOk() (*string, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *CreateNicPayload) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *CreateNicPayload) SetDevice(v string) { + o.Device = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateNicPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateNicPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateNicPayload) SetId(v string) { + o.Id = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *CreateNicPayload) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *CreateNicPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *CreateNicPayload) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *CreateNicPayload) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *CreateNicPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *CreateNicPayload) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateNicPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateNicPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateNicPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMac returns the Mac field value if set, zero value otherwise. +func (o *CreateNicPayload) GetMac() string { + if o == nil || IsNil(o.Mac) { + var ret string + return ret + } + return *o.Mac +} + +// GetMacOk returns a tuple with the Mac field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetMacOk() (*string, bool) { + if o == nil || IsNil(o.Mac) { + return nil, false + } + return o.Mac, true +} + +// HasMac returns a boolean if a field has been set. +func (o *CreateNicPayload) HasMac() bool { + if o != nil && !IsNil(o.Mac) { + return true + } + + return false +} + +// SetMac gets a reference to the given string and assigns it to the Mac field. +func (o *CreateNicPayload) SetMac(v string) { + o.Mac = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateNicPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateNicPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateNicPayload) SetName(v string) { + o.Name = &v +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *CreateNicPayload) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *CreateNicPayload) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *CreateNicPayload) SetNetworkId(v string) { + o.NetworkId = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *CreateNicPayload) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *CreateNicPayload) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *CreateNicPayload) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *CreateNicPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *CreateNicPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *CreateNicPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateNicPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateNicPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateNicPayload) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *CreateNicPayload) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNicPayload) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *CreateNicPayload) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *CreateNicPayload) SetType(v string) { + o.Type = &v +} + +func (o CreateNicPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateNicPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Mac) { + toSerialize["mac"] = o.Mac + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableCreateNicPayload struct { + value *CreateNicPayload + isSet bool +} + +func (v NullableCreateNicPayload) Get() *CreateNicPayload { + return v.value +} + +func (v *NullableCreateNicPayload) Set(val *CreateNicPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateNicPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateNicPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateNicPayload(val *CreateNicPayload) *NullableCreateNicPayload { + return &NullableCreateNicPayload{value: val, isSet: true} +} + +func (v NullableCreateNicPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateNicPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_protocol.go b/services/iaas/v2beta1api/model_create_protocol.go new file mode 100644 index 000000000..e75ec213a --- /dev/null +++ b/services/iaas/v2beta1api/model_create_protocol.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// CreateProtocol - The schema for a protocol when creating a security group rule. +type CreateProtocol struct { + Int64 *int64 + String *string +} + +// int64AsCreateProtocol is a convenience function that returns int64 wrapped in CreateProtocol +func Int64AsCreateProtocol(v *int64) CreateProtocol { + return CreateProtocol{ + Int64: v, + } +} + +// stringAsCreateProtocol is a convenience function that returns string wrapped in CreateProtocol +func StringAsCreateProtocol(v *string) CreateProtocol { + return CreateProtocol{ + String: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateProtocol) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into Int64 + err = json.Unmarshal(data, &dst.Int64) + if err == nil { + jsonInt64, _ := json.Marshal(dst.Int64) + if string(jsonInt64) == "{}" { // empty struct + dst.Int64 = nil + } else { + match++ + } + } else { + dst.Int64 = nil + } + + // try to unmarshal data into String + err = json.Unmarshal(data, &dst.String) + if err == nil { + jsonString, _ := json.Marshal(dst.String) + if string(jsonString) == "{}" { // empty struct + dst.String = nil + } else { + match++ + } + } else { + dst.String = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.Int64 = nil + dst.String = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateProtocol)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateProtocol)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateProtocol) MarshalJSON() ([]byte, error) { + if src.Int64 != nil { + return json.Marshal(&src.Int64) + } + + if src.String != nil { + return json.Marshal(&src.String) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateProtocol) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.Int64 != nil { + return obj.Int64 + } + + if obj.String != nil { + return obj.String + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateProtocol) GetActualInstanceValue() interface{} { + if obj.Int64 != nil { + return *obj.Int64 + } + + if obj.String != nil { + return *obj.String + } + + // all schemas are nil + return nil +} + +type NullableCreateProtocol struct { + value *CreateProtocol + isSet bool +} + +func (v NullableCreateProtocol) Get() *CreateProtocol { + return v.value +} + +func (v *NullableCreateProtocol) Set(val *CreateProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableCreateProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateProtocol(val *CreateProtocol) *NullableCreateProtocol { + return &NullableCreateProtocol{value: val, isSet: true} +} + +func (v NullableCreateProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_public_ip_payload.go b/services/iaas/v2beta1api/model_create_public_ip_payload.go new file mode 100644 index 000000000..97cdd910c --- /dev/null +++ b/services/iaas/v2beta1api/model_create_public_ip_payload.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the CreatePublicIPPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreatePublicIPPayload{} + +// CreatePublicIPPayload Object that represents a public IP. +type CreatePublicIPPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // String that represents an IPv4 address. + Ip *string `json:"ip,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewCreatePublicIPPayload instantiates a new CreatePublicIPPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreatePublicIPPayload() *CreatePublicIPPayload { + this := CreatePublicIPPayload{} + return &this +} + +// NewCreatePublicIPPayloadWithDefaults instantiates a new CreatePublicIPPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreatePublicIPPayloadWithDefaults() *CreatePublicIPPayload { + this := CreatePublicIPPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreatePublicIPPayload) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *CreatePublicIPPayload) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreatePublicIPPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreatePublicIPPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreatePublicIPPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreatePublicIPPayload) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *CreatePublicIPPayload) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *CreatePublicIPPayload) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *CreatePublicIPPayload) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *CreatePublicIPPayload) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o CreatePublicIPPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreatePublicIPPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullableCreatePublicIPPayload struct { + value *CreatePublicIPPayload + isSet bool +} + +func (v NullableCreatePublicIPPayload) Get() *CreatePublicIPPayload { + return v.value +} + +func (v *NullableCreatePublicIPPayload) Set(val *CreatePublicIPPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreatePublicIPPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreatePublicIPPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreatePublicIPPayload(val *CreatePublicIPPayload) *NullableCreatePublicIPPayload { + return &NullableCreatePublicIPPayload{value: val, isSet: true} +} + +func (v NullableCreatePublicIPPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreatePublicIPPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_security_group_payload.go b/services/iaas/v2beta1api/model_create_security_group_payload.go new file mode 100644 index 000000000..4d2c7123e --- /dev/null +++ b/services/iaas/v2beta1api/model_create_security_group_payload.go @@ -0,0 +1,422 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateSecurityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupPayload{} + +// CreateSecurityGroupPayload Object that represents a security group. +type CreateSecurityGroupPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A list containing security group rule objects. + Rules []SecurityGroupRule `json:"rules,omitempty"` + // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. + Stateful *bool `json:"stateful,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateSecurityGroupPayload CreateSecurityGroupPayload + +// NewCreateSecurityGroupPayload instantiates a new CreateSecurityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupPayload(name string) *CreateSecurityGroupPayload { + this := CreateSecurityGroupPayload{} + this.Name = name + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// NewCreateSecurityGroupPayloadWithDefaults instantiates a new CreateSecurityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupPayloadWithDefaults() *CreateSecurityGroupPayload { + this := CreateSecurityGroupPayload{} + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateSecurityGroupPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateSecurityGroupPayload) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSecurityGroupPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateSecurityGroupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *CreateSecurityGroupPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateSecurityGroupPayload) SetName(v string) { + o.Name = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetRules() []SecurityGroupRule { + if o == nil || IsNil(o.Rules) { + var ret []SecurityGroupRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetRulesOk() ([]SecurityGroupRule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. +func (o *CreateSecurityGroupPayload) SetRules(v []SecurityGroupRule) { + o.Rules = v +} + +// GetStateful returns the Stateful field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetStateful() bool { + if o == nil || IsNil(o.Stateful) { + var ret bool + return ret + } + return *o.Stateful +} + +// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetStatefulOk() (*bool, bool) { + if o == nil || IsNil(o.Stateful) { + return nil, false + } + return o.Stateful, true +} + +// HasStateful returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasStateful() bool { + if o != nil && !IsNil(o.Stateful) { + return true + } + + return false +} + +// SetStateful gets a reference to the given bool and assigns it to the Stateful field. +func (o *CreateSecurityGroupPayload) SetStateful(v bool) { + o.Stateful = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateSecurityGroupPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + if !IsNil(o.Stateful) { + toSerialize["stateful"] = o.Stateful + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateSecurityGroupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateSecurityGroupPayload := _CreateSecurityGroupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateSecurityGroupPayload) + + if err != nil { + return err + } + + *o = CreateSecurityGroupPayload(varCreateSecurityGroupPayload) + + return err +} + +type NullableCreateSecurityGroupPayload struct { + value *CreateSecurityGroupPayload + isSet bool +} + +func (v NullableCreateSecurityGroupPayload) Get() *CreateSecurityGroupPayload { + return v.value +} + +func (v *NullableCreateSecurityGroupPayload) Set(val *CreateSecurityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupPayload(val *CreateSecurityGroupPayload) *NullableCreateSecurityGroupPayload { + return &NullableCreateSecurityGroupPayload{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_security_group_rule_payload.go b/services/iaas/v2beta1api/model_create_security_group_rule_payload.go new file mode 100644 index 000000000..75a377756 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_security_group_rule_payload.go @@ -0,0 +1,567 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateSecurityGroupRulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupRulePayload{} + +// CreateSecurityGroupRulePayload Object that represents a request body for security group rule creation. +type CreateSecurityGroupRulePayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Protocol *CreateProtocol `json:"protocol,omitempty"` +} + +type _CreateSecurityGroupRulePayload CreateSecurityGroupRulePayload + +// NewCreateSecurityGroupRulePayload instantiates a new CreateSecurityGroupRulePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupRulePayload(direction string) *CreateSecurityGroupRulePayload { + this := CreateSecurityGroupRulePayload{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewCreateSecurityGroupRulePayloadWithDefaults instantiates a new CreateSecurityGroupRulePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupRulePayloadWithDefaults() *CreateSecurityGroupRulePayload { + this := CreateSecurityGroupRulePayload{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateSecurityGroupRulePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateSecurityGroupRulePayload) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *CreateSecurityGroupRulePayload) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *CreateSecurityGroupRulePayload) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *CreateSecurityGroupRulePayload) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *CreateSecurityGroupRulePayload) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateSecurityGroupRulePayload) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *CreateSecurityGroupRulePayload) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *CreateSecurityGroupRulePayload) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *CreateSecurityGroupRulePayload) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *CreateSecurityGroupRulePayload) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateSecurityGroupRulePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *CreateSecurityGroupRulePayload) GetProtocol() CreateProtocol { + if o == nil || IsNil(o.Protocol) { + var ret CreateProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRulePayload) GetProtocolOk() (*CreateProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *CreateSecurityGroupRulePayload) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +func (o *CreateSecurityGroupRulePayload) SetProtocol(v CreateProtocol) { + o.Protocol = &v +} + +func (o CreateSecurityGroupRulePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupRulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +func (o *CreateSecurityGroupRulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateSecurityGroupRulePayload := _CreateSecurityGroupRulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateSecurityGroupRulePayload) + + if err != nil { + return err + } + + *o = CreateSecurityGroupRulePayload(varCreateSecurityGroupRulePayload) + + return err +} + +type NullableCreateSecurityGroupRulePayload struct { + value *CreateSecurityGroupRulePayload + isSet bool +} + +func (v NullableCreateSecurityGroupRulePayload) Get() *CreateSecurityGroupRulePayload { + return v.value +} + +func (v *NullableCreateSecurityGroupRulePayload) Set(val *CreateSecurityGroupRulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupRulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupRulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupRulePayload(val *CreateSecurityGroupRulePayload) *NullableCreateSecurityGroupRulePayload { + return &NullableCreateSecurityGroupRulePayload{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupRulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupRulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_security_group_rule_protocol.go b/services/iaas/v2beta1api/model_create_security_group_rule_protocol.go new file mode 100644 index 000000000..d680aafdd --- /dev/null +++ b/services/iaas/v2beta1api/model_create_security_group_rule_protocol.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the CreateSecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateSecurityGroupRuleProtocol{} + +// CreateSecurityGroupRuleProtocol The internet protocol which the rule should match. +type CreateSecurityGroupRuleProtocol struct { + Protocol *CreateProtocol `json:"protocol,omitempty"` +} + +// NewCreateSecurityGroupRuleProtocol instantiates a new CreateSecurityGroupRuleProtocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateSecurityGroupRuleProtocol() *CreateSecurityGroupRuleProtocol { + this := CreateSecurityGroupRuleProtocol{} + return &this +} + +// NewCreateSecurityGroupRuleProtocolWithDefaults instantiates a new CreateSecurityGroupRuleProtocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateSecurityGroupRuleProtocolWithDefaults() *CreateSecurityGroupRuleProtocol { + this := CreateSecurityGroupRuleProtocol{} + return &this +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *CreateSecurityGroupRuleProtocol) GetProtocol() CreateProtocol { + if o == nil || IsNil(o.Protocol) { + var ret CreateProtocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateSecurityGroupRuleProtocol) GetProtocolOk() (*CreateProtocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *CreateSecurityGroupRuleProtocol) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given CreateProtocol and assigns it to the Protocol field. +func (o *CreateSecurityGroupRuleProtocol) SetProtocol(v CreateProtocol) { + o.Protocol = &v +} + +func (o CreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateSecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +type NullableCreateSecurityGroupRuleProtocol struct { + value *CreateSecurityGroupRuleProtocol + isSet bool +} + +func (v NullableCreateSecurityGroupRuleProtocol) Get() *CreateSecurityGroupRuleProtocol { + return v.value +} + +func (v *NullableCreateSecurityGroupRuleProtocol) Set(val *CreateSecurityGroupRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableCreateSecurityGroupRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateSecurityGroupRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateSecurityGroupRuleProtocol(val *CreateSecurityGroupRuleProtocol) *NullableCreateSecurityGroupRuleProtocol { + return &NullableCreateSecurityGroupRuleProtocol{value: val, isSet: true} +} + +func (v NullableCreateSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_server_networking.go b/services/iaas/v2beta1api/model_create_server_networking.go new file mode 100644 index 000000000..2d30a7dac --- /dev/null +++ b/services/iaas/v2beta1api/model_create_server_networking.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the CreateServerNetworking type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerNetworking{} + +// CreateServerNetworking The initial networking setup for the server creation with a network. +type CreateServerNetworking struct { + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewCreateServerNetworking instantiates a new CreateServerNetworking object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerNetworking() *CreateServerNetworking { + this := CreateServerNetworking{} + return &this +} + +// NewCreateServerNetworkingWithDefaults instantiates a new CreateServerNetworking object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerNetworkingWithDefaults() *CreateServerNetworking { + this := CreateServerNetworking{} + return &this +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *CreateServerNetworking) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerNetworking) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *CreateServerNetworking) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *CreateServerNetworking) SetNetworkId(v string) { + o.NetworkId = &v +} + +func (o CreateServerNetworking) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerNetworking) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + return toSerialize, nil +} + +type NullableCreateServerNetworking struct { + value *CreateServerNetworking + isSet bool +} + +func (v NullableCreateServerNetworking) Get() *CreateServerNetworking { + return v.value +} + +func (v *NullableCreateServerNetworking) Set(val *CreateServerNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerNetworking(val *CreateServerNetworking) *NullableCreateServerNetworking { + return &NullableCreateServerNetworking{value: val, isSet: true} +} + +func (v NullableCreateServerNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_server_networking_with_nics.go b/services/iaas/v2beta1api/model_create_server_networking_with_nics.go new file mode 100644 index 000000000..fe413bc84 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_server_networking_with_nics.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the CreateServerNetworkingWithNics type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerNetworkingWithNics{} + +// CreateServerNetworkingWithNics The initial networking setup for the server creation with a network interface. +type CreateServerNetworkingWithNics struct { + // A list of UUIDs. + NicIds []string `json:"nicIds,omitempty"` +} + +// NewCreateServerNetworkingWithNics instantiates a new CreateServerNetworkingWithNics object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerNetworkingWithNics() *CreateServerNetworkingWithNics { + this := CreateServerNetworkingWithNics{} + return &this +} + +// NewCreateServerNetworkingWithNicsWithDefaults instantiates a new CreateServerNetworkingWithNics object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerNetworkingWithNicsWithDefaults() *CreateServerNetworkingWithNics { + this := CreateServerNetworkingWithNics{} + return &this +} + +// GetNicIds returns the NicIds field value if set, zero value otherwise. +func (o *CreateServerNetworkingWithNics) GetNicIds() []string { + if o == nil || IsNil(o.NicIds) { + var ret []string + return ret + } + return o.NicIds +} + +// GetNicIdsOk returns a tuple with the NicIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerNetworkingWithNics) GetNicIdsOk() ([]string, bool) { + if o == nil || IsNil(o.NicIds) { + return nil, false + } + return o.NicIds, true +} + +// HasNicIds returns a boolean if a field has been set. +func (o *CreateServerNetworkingWithNics) HasNicIds() bool { + if o != nil && !IsNil(o.NicIds) { + return true + } + + return false +} + +// SetNicIds gets a reference to the given []string and assigns it to the NicIds field. +func (o *CreateServerNetworkingWithNics) SetNicIds(v []string) { + o.NicIds = v +} + +func (o CreateServerNetworkingWithNics) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerNetworkingWithNics) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.NicIds) { + toSerialize["nicIds"] = o.NicIds + } + return toSerialize, nil +} + +type NullableCreateServerNetworkingWithNics struct { + value *CreateServerNetworkingWithNics + isSet bool +} + +func (v NullableCreateServerNetworkingWithNics) Get() *CreateServerNetworkingWithNics { + return v.value +} + +func (v *NullableCreateServerNetworkingWithNics) Set(val *CreateServerNetworkingWithNics) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerNetworkingWithNics) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerNetworkingWithNics) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerNetworkingWithNics(val *CreateServerNetworkingWithNics) *NullableCreateServerNetworkingWithNics { + return &NullableCreateServerNetworkingWithNics{value: val, isSet: true} +} + +func (v NullableCreateServerNetworkingWithNics) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerNetworkingWithNics) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_server_payload.go b/services/iaas/v2beta1api/model_create_server_payload.go new file mode 100644 index 000000000..f4a56b989 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_server_payload.go @@ -0,0 +1,990 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateServerPayload{} + +// CreateServerPayload Object that represents the request body for a server create. +type CreateServerPayload struct { + // The affinity group the server is assigned to. + AffinityGroup *string `json:"affinityGroup,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Agent *ServerAgent `json:"agent,omitempty"` + // This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + BootVolume *BootVolume `json:"bootVolume,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // An error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The SSH keypair used during the server creation. + KeypairName *string `json:"keypairName,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Date-time when resource was launched. + LaunchedAt *time.Time `json:"launchedAt,omitempty"` + // Name of the machine type the server shall belong to. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + MaintenanceWindow *ServerMaintenance `json:"maintenanceWindow,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name string `json:"name" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` + Networking CreateServerPayloadAllOfNetworking `json:"networking"` + // The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested. + Nics []ServerNetwork `json:"nics,omitempty"` + // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. + PowerStatus *string `json:"powerStatus,omitempty"` + // The initial security groups for the server creation. + SecurityGroups []string `json:"securityGroups,omitempty"` + // A list of service account mails. Only shown when detailed information is requested. + ServiceAccountMails []string `json:"serviceAccountMails,omitempty"` + // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. + UserData *string `json:"userData,omitempty"` + // The list of volumes attached to the server. + Volumes []string `json:"volumes,omitempty"` +} + +type _CreateServerPayload CreateServerPayload + +// NewCreateServerPayload instantiates a new CreateServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateServerPayload(machineType string, name string, networking CreateServerPayloadAllOfNetworking) *CreateServerPayload { + this := CreateServerPayload{} + this.MachineType = machineType + this.Name = name + this.Networking = networking + return &this +} + +// NewCreateServerPayloadWithDefaults instantiates a new CreateServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateServerPayloadWithDefaults() *CreateServerPayload { + this := CreateServerPayload{} + return &this +} + +// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAffinityGroup() string { + if o == nil || IsNil(o.AffinityGroup) { + var ret string + return ret + } + return *o.AffinityGroup +} + +// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAffinityGroupOk() (*string, bool) { + if o == nil || IsNil(o.AffinityGroup) { + return nil, false + } + return o.AffinityGroup, true +} + +// HasAffinityGroup returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAffinityGroup() bool { + if o != nil && !IsNil(o.AffinityGroup) { + return true + } + + return false +} + +// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +func (o *CreateServerPayload) SetAffinityGroup(v string) { + o.AffinityGroup = &v +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAgent() ServerAgent { + if o == nil || IsNil(o.Agent) { + var ret ServerAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAgentOk() (*ServerAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ServerAgent and assigns it to the Agent field. +func (o *CreateServerPayload) SetAgent(v ServerAgent) { + o.Agent = &v +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *CreateServerPayload) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *CreateServerPayload) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *CreateServerPayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetBootVolume returns the BootVolume field value if set, zero value otherwise. +func (o *CreateServerPayload) GetBootVolume() BootVolume { + if o == nil || IsNil(o.BootVolume) { + var ret BootVolume + return ret + } + return *o.BootVolume +} + +// GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetBootVolumeOk() (*BootVolume, bool) { + if o == nil || IsNil(o.BootVolume) { + return nil, false + } + return o.BootVolume, true +} + +// HasBootVolume returns a boolean if a field has been set. +func (o *CreateServerPayload) HasBootVolume() bool { + if o != nil && !IsNil(o.BootVolume) { + return true + } + + return false +} + +// SetBootVolume gets a reference to the given BootVolume and assigns it to the BootVolume field. +func (o *CreateServerPayload) SetBootVolume(v BootVolume) { + o.BootVolume = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateServerPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *CreateServerPayload) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *CreateServerPayload) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *CreateServerPayload) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateServerPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateServerPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateServerPayload) SetId(v string) { + o.Id = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *CreateServerPayload) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *CreateServerPayload) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *CreateServerPayload) SetImageId(v string) { + o.ImageId = &v +} + +// GetKeypairName returns the KeypairName field value if set, zero value otherwise. +func (o *CreateServerPayload) GetKeypairName() string { + if o == nil || IsNil(o.KeypairName) { + var ret string + return ret + } + return *o.KeypairName +} + +// GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetKeypairNameOk() (*string, bool) { + if o == nil || IsNil(o.KeypairName) { + return nil, false + } + return o.KeypairName, true +} + +// HasKeypairName returns a boolean if a field has been set. +func (o *CreateServerPayload) HasKeypairName() bool { + if o != nil && !IsNil(o.KeypairName) { + return true + } + + return false +} + +// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. +func (o *CreateServerPayload) SetKeypairName(v string) { + o.KeypairName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateServerPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateServerPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateServerPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetLaunchedAt() time.Time { + if o == nil || IsNil(o.LaunchedAt) { + var ret time.Time + return ret + } + return *o.LaunchedAt +} + +// GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetLaunchedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LaunchedAt) { + return nil, false + } + return o.LaunchedAt, true +} + +// HasLaunchedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasLaunchedAt() bool { + if o != nil && !IsNil(o.LaunchedAt) { + return true + } + + return false +} + +// SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. +func (o *CreateServerPayload) SetLaunchedAt(v time.Time) { + o.LaunchedAt = &v +} + +// GetMachineType returns the MachineType field value +func (o *CreateServerPayload) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *CreateServerPayload) SetMachineType(v string) { + o.MachineType = v +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *CreateServerPayload) GetMaintenanceWindow() ServerMaintenance { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret ServerMaintenance + return ret + } + return *o.MaintenanceWindow +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { + if o == nil || IsNil(o.MaintenanceWindow) { + return nil, false + } + return o.MaintenanceWindow, true +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *CreateServerPayload) HasMaintenanceWindow() bool { + if o != nil && !IsNil(o.MaintenanceWindow) { + return true + } + + return false +} + +// SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. +func (o *CreateServerPayload) SetMaintenanceWindow(v ServerMaintenance) { + o.MaintenanceWindow = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *CreateServerPayload) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *CreateServerPayload) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *CreateServerPayload) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value +func (o *CreateServerPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateServerPayload) SetName(v string) { + o.Name = v +} + +// GetNetworking returns the Networking field value +func (o *CreateServerPayload) GetNetworking() CreateServerPayloadAllOfNetworking { + if o == nil { + var ret CreateServerPayloadAllOfNetworking + return ret + } + + return o.Networking +} + +// GetNetworkingOk returns a tuple with the Networking field value +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNetworkingOk() (*CreateServerPayloadAllOfNetworking, bool) { + if o == nil { + return nil, false + } + return &o.Networking, true +} + +// SetNetworking sets field value +func (o *CreateServerPayload) SetNetworking(v CreateServerPayloadAllOfNetworking) { + o.Networking = v +} + +// GetNics returns the Nics field value if set, zero value otherwise. +func (o *CreateServerPayload) GetNics() []ServerNetwork { + if o == nil || IsNil(o.Nics) { + var ret []ServerNetwork + return ret + } + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetNicsOk() ([]ServerNetwork, bool) { + if o == nil || IsNil(o.Nics) { + return nil, false + } + return o.Nics, true +} + +// HasNics returns a boolean if a field has been set. +func (o *CreateServerPayload) HasNics() bool { + if o != nil && !IsNil(o.Nics) { + return true + } + + return false +} + +// SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. +func (o *CreateServerPayload) SetNics(v []ServerNetwork) { + o.Nics = v +} + +// GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. +func (o *CreateServerPayload) GetPowerStatus() string { + if o == nil || IsNil(o.PowerStatus) { + var ret string + return ret + } + return *o.PowerStatus +} + +// GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetPowerStatusOk() (*string, bool) { + if o == nil || IsNil(o.PowerStatus) { + return nil, false + } + return o.PowerStatus, true +} + +// HasPowerStatus returns a boolean if a field has been set. +func (o *CreateServerPayload) HasPowerStatus() bool { + if o != nil && !IsNil(o.PowerStatus) { + return true + } + + return false +} + +// SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. +func (o *CreateServerPayload) SetPowerStatus(v string) { + o.PowerStatus = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *CreateServerPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *CreateServerPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *CreateServerPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. +func (o *CreateServerPayload) GetServiceAccountMails() []string { + if o == nil || IsNil(o.ServiceAccountMails) { + var ret []string + return ret + } + return o.ServiceAccountMails +} + +// GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetServiceAccountMailsOk() ([]string, bool) { + if o == nil || IsNil(o.ServiceAccountMails) { + return nil, false + } + return o.ServiceAccountMails, true +} + +// HasServiceAccountMails returns a boolean if a field has been set. +func (o *CreateServerPayload) HasServiceAccountMails() bool { + if o != nil && !IsNil(o.ServiceAccountMails) { + return true + } + + return false +} + +// SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. +func (o *CreateServerPayload) SetServiceAccountMails(v []string) { + o.ServiceAccountMails = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateServerPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateServerPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateServerPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateServerPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateServerPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateServerPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *CreateServerPayload) GetUserData() string { + if o == nil || IsNil(o.UserData) { + var ret string + return ret + } + return *o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetUserDataOk() (*string, bool) { + if o == nil || IsNil(o.UserData) { + return nil, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *CreateServerPayload) HasUserData() bool { + if o != nil && !IsNil(o.UserData) { + return true + } + + return false +} + +// SetUserData gets a reference to the given string and assigns it to the UserData field. +func (o *CreateServerPayload) SetUserData(v string) { + o.UserData = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *CreateServerPayload) GetVolumes() []string { + if o == nil || IsNil(o.Volumes) { + var ret []string + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateServerPayload) GetVolumesOk() ([]string, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *CreateServerPayload) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +func (o *CreateServerPayload) SetVolumes(v []string) { + o.Volumes = v +} + +func (o CreateServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AffinityGroup) { + toSerialize["affinityGroup"] = o.AffinityGroup + } + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.BootVolume) { + toSerialize["bootVolume"] = o.BootVolume + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.KeypairName) { + toSerialize["keypairName"] = o.KeypairName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.LaunchedAt) { + toSerialize["launchedAt"] = o.LaunchedAt + } + toSerialize["machineType"] = o.MachineType + if !IsNil(o.MaintenanceWindow) { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + toSerialize["name"] = o.Name + toSerialize["networking"] = o.Networking + if !IsNil(o.Nics) { + toSerialize["nics"] = o.Nics + } + if !IsNil(o.PowerStatus) { + toSerialize["powerStatus"] = o.PowerStatus + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.ServiceAccountMails) { + toSerialize["serviceAccountMails"] = o.ServiceAccountMails + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.UserData) { + toSerialize["userData"] = o.UserData + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + return toSerialize, nil +} + +func (o *CreateServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + "name", + "networking", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateServerPayload := _CreateServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateServerPayload) + + if err != nil { + return err + } + + *o = CreateServerPayload(varCreateServerPayload) + + return err +} + +type NullableCreateServerPayload struct { + value *CreateServerPayload + isSet bool +} + +func (v NullableCreateServerPayload) Get() *CreateServerPayload { + return v.value +} + +func (v *NullableCreateServerPayload) Set(val *CreateServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerPayload(val *CreateServerPayload) *NullableCreateServerPayload { + return &NullableCreateServerPayload{value: val, isSet: true} +} + +func (v NullableCreateServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_server_payload_all_of_networking.go b/services/iaas/v2beta1api/model_create_server_payload_all_of_networking.go new file mode 100644 index 000000000..605830344 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_server_payload_all_of_networking.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// CreateServerPayloadAllOfNetworking - struct for CreateServerPayloadAllOfNetworking +type CreateServerPayloadAllOfNetworking struct { + CreateServerNetworking *CreateServerNetworking + CreateServerNetworkingWithNics *CreateServerNetworkingWithNics +} + +// CreateServerNetworkingAsCreateServerPayloadAllOfNetworking is a convenience function that returns CreateServerNetworking wrapped in CreateServerPayloadAllOfNetworking +func CreateServerNetworkingAsCreateServerPayloadAllOfNetworking(v *CreateServerNetworking) CreateServerPayloadAllOfNetworking { + return CreateServerPayloadAllOfNetworking{ + CreateServerNetworking: v, + } +} + +// CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in CreateServerPayloadAllOfNetworking +func CreateServerNetworkingWithNicsAsCreateServerPayloadAllOfNetworking(v *CreateServerNetworkingWithNics) CreateServerPayloadAllOfNetworking { + return CreateServerPayloadAllOfNetworking{ + CreateServerNetworkingWithNics: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *CreateServerPayloadAllOfNetworking) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateServerNetworking + err = json.Unmarshal(data, &dst.CreateServerNetworking) + if err == nil { + jsonCreateServerNetworking, _ := json.Marshal(dst.CreateServerNetworking) + if string(jsonCreateServerNetworking) == "{}" { // empty struct + dst.CreateServerNetworking = nil + } else { + match++ + } + } else { + dst.CreateServerNetworking = nil + } + + // try to unmarshal data into CreateServerNetworkingWithNics + err = json.Unmarshal(data, &dst.CreateServerNetworkingWithNics) + if err == nil { + jsonCreateServerNetworkingWithNics, _ := json.Marshal(dst.CreateServerNetworkingWithNics) + if string(jsonCreateServerNetworkingWithNics) == "{}" { // empty struct + dst.CreateServerNetworkingWithNics = nil + } else { + match++ + } + } else { + dst.CreateServerNetworkingWithNics = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateServerNetworking = nil + dst.CreateServerNetworkingWithNics = nil + + return fmt.Errorf("data matches more than one schema in oneOf(CreateServerPayloadAllOfNetworking)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(CreateServerPayloadAllOfNetworking)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src CreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { + if src.CreateServerNetworking != nil { + return json.Marshal(&src.CreateServerNetworking) + } + + if src.CreateServerNetworkingWithNics != nil { + return json.Marshal(&src.CreateServerNetworkingWithNics) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *CreateServerPayloadAllOfNetworking) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateServerNetworking != nil { + return obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj CreateServerPayloadAllOfNetworking) GetActualInstanceValue() interface{} { + if obj.CreateServerNetworking != nil { + return *obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return *obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +type NullableCreateServerPayloadAllOfNetworking struct { + value *CreateServerPayloadAllOfNetworking + isSet bool +} + +func (v NullableCreateServerPayloadAllOfNetworking) Get() *CreateServerPayloadAllOfNetworking { + return v.value +} + +func (v *NullableCreateServerPayloadAllOfNetworking) Set(val *CreateServerPayloadAllOfNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableCreateServerPayloadAllOfNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateServerPayloadAllOfNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateServerPayloadAllOfNetworking(val *CreateServerPayloadAllOfNetworking) *NullableCreateServerPayloadAllOfNetworking { + return &NullableCreateServerPayloadAllOfNetworking{value: val, isSet: true} +} + +func (v NullableCreateServerPayloadAllOfNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateServerPayloadAllOfNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_create_volume_payload.go b/services/iaas/v2beta1api/model_create_volume_payload.go new file mode 100644 index 000000000..ba54f3744 --- /dev/null +++ b/services/iaas/v2beta1api/model_create_volume_payload.go @@ -0,0 +1,711 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the CreateVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateVolumePayload{} + +// CreateVolumePayload Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. +type CreateVolumePayload struct { + // Object that represents an availability zone. + AvailabilityZone string `json:"availabilityZone"` + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionParameters *VolumeEncryptionParameter `json:"encryptionParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *VolumeSource `json:"source,omitempty"` + // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _CreateVolumePayload CreateVolumePayload + +// NewCreateVolumePayload instantiates a new CreateVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateVolumePayload(availabilityZone string) *CreateVolumePayload { + this := CreateVolumePayload{} + this.AvailabilityZone = availabilityZone + return &this +} + +// NewCreateVolumePayloadWithDefaults instantiates a new CreateVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateVolumePayloadWithDefaults() *CreateVolumePayload { + this := CreateVolumePayload{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value +func (o *CreateVolumePayload) GetAvailabilityZone() string { + if o == nil { + var ret string + return ret + } + + return o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailabilityZone, true +} + +// SetAvailabilityZone sets field value +func (o *CreateVolumePayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = v +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *CreateVolumePayload) SetBootable(v bool) { + o.Bootable = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *CreateVolumePayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *CreateVolumePayload) SetDescription(v string) { + o.Description = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *CreateVolumePayload) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetEncryptionParameters returns the EncryptionParameters field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetEncryptionParameters() VolumeEncryptionParameter { + if o == nil || IsNil(o.EncryptionParameters) { + var ret VolumeEncryptionParameter + return ret + } + return *o.EncryptionParameters +} + +// GetEncryptionParametersOk returns a tuple with the EncryptionParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetEncryptionParametersOk() (*VolumeEncryptionParameter, bool) { + if o == nil || IsNil(o.EncryptionParameters) { + return nil, false + } + return o.EncryptionParameters, true +} + +// HasEncryptionParameters returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasEncryptionParameters() bool { + if o != nil && !IsNil(o.EncryptionParameters) { + return true + } + + return false +} + +// SetEncryptionParameters gets a reference to the given VolumeEncryptionParameter and assigns it to the EncryptionParameters field. +func (o *CreateVolumePayload) SetEncryptionParameters(v VolumeEncryptionParameter) { + o.EncryptionParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *CreateVolumePayload) SetId(v string) { + o.Id = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *CreateVolumePayload) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *CreateVolumePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *CreateVolumePayload) SetName(v string) { + o.Name = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *CreateVolumePayload) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *CreateVolumePayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *CreateVolumePayload) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetSource() VolumeSource { + if o == nil || IsNil(o.Source) { + var ret VolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetSourceOk() (*VolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given VolumeSource and assigns it to the Source field. +func (o *CreateVolumePayload) SetSource(v VolumeSource) { + o.Source = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *CreateVolumePayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *CreateVolumePayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateVolumePayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *CreateVolumePayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *CreateVolumePayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o CreateVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["availabilityZone"] = o.AvailabilityZone + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.EncryptionParameters) { + toSerialize["encryptionParameters"] = o.EncryptionParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *CreateVolumePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "availabilityZone", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateVolumePayload := _CreateVolumePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateVolumePayload) + + if err != nil { + return err + } + + *o = CreateVolumePayload(varCreateVolumePayload) + + return err +} + +type NullableCreateVolumePayload struct { + value *CreateVolumePayload + isSet bool +} + +func (v NullableCreateVolumePayload) Get() *CreateVolumePayload { + return v.value +} + +func (v *NullableCreateVolumePayload) Set(val *CreateVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateVolumePayload(val *CreateVolumePayload) *NullableCreateVolumePayload { + return &NullableCreateVolumePayload{value: val, isSet: true} +} + +func (v NullableCreateVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_destination_cidrv4.go b/services/iaas/v2beta1api/model_destination_cidrv4.go new file mode 100644 index 000000000..962cc44db --- /dev/null +++ b/services/iaas/v2beta1api/model_destination_cidrv4.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DestinationCIDRv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DestinationCIDRv4{} + +// DestinationCIDRv4 IPv4 Classless Inter-Domain Routing (CIDR) Object. +type DestinationCIDRv4 struct { + Type string `json:"type"` + // An CIDRv4 string. + Value string `json:"value" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` +} + +type _DestinationCIDRv4 DestinationCIDRv4 + +// NewDestinationCIDRv4 instantiates a new DestinationCIDRv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDestinationCIDRv4(types string, value string) *DestinationCIDRv4 { + this := DestinationCIDRv4{} + this.Type = types + this.Value = value + return &this +} + +// NewDestinationCIDRv4WithDefaults instantiates a new DestinationCIDRv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDestinationCIDRv4WithDefaults() *DestinationCIDRv4 { + this := DestinationCIDRv4{} + return &this +} + +// GetType returns the Type field value +func (o *DestinationCIDRv4) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv4) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DestinationCIDRv4) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *DestinationCIDRv4) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv4) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *DestinationCIDRv4) SetValue(v string) { + o.Value = v +} + +func (o DestinationCIDRv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DestinationCIDRv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *DestinationCIDRv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDestinationCIDRv4 := _DestinationCIDRv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDestinationCIDRv4) + + if err != nil { + return err + } + + *o = DestinationCIDRv4(varDestinationCIDRv4) + + return err +} + +type NullableDestinationCIDRv4 struct { + value *DestinationCIDRv4 + isSet bool +} + +func (v NullableDestinationCIDRv4) Get() *DestinationCIDRv4 { + return v.value +} + +func (v *NullableDestinationCIDRv4) Set(val *DestinationCIDRv4) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationCIDRv4) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationCIDRv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationCIDRv4(val *DestinationCIDRv4) *NullableDestinationCIDRv4 { + return &NullableDestinationCIDRv4{value: val, isSet: true} +} + +func (v NullableDestinationCIDRv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationCIDRv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_destination_cidrv6.go b/services/iaas/v2beta1api/model_destination_cidrv6.go new file mode 100644 index 000000000..98a64d3aa --- /dev/null +++ b/services/iaas/v2beta1api/model_destination_cidrv6.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the DestinationCIDRv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &DestinationCIDRv6{} + +// DestinationCIDRv6 IPv6 Classless Inter-Domain Routing (CIDR) Object. +type DestinationCIDRv6 struct { + Type string `json:"type"` + // An CIDRv6 string. + Value string `json:"value" validate:"regexp=^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` +} + +type _DestinationCIDRv6 DestinationCIDRv6 + +// NewDestinationCIDRv6 instantiates a new DestinationCIDRv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewDestinationCIDRv6(types string, value string) *DestinationCIDRv6 { + this := DestinationCIDRv6{} + this.Type = types + this.Value = value + return &this +} + +// NewDestinationCIDRv6WithDefaults instantiates a new DestinationCIDRv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewDestinationCIDRv6WithDefaults() *DestinationCIDRv6 { + this := DestinationCIDRv6{} + return &this +} + +// GetType returns the Type field value +func (o *DestinationCIDRv6) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv6) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *DestinationCIDRv6) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *DestinationCIDRv6) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *DestinationCIDRv6) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *DestinationCIDRv6) SetValue(v string) { + o.Value = v +} + +func (o DestinationCIDRv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o DestinationCIDRv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *DestinationCIDRv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varDestinationCIDRv6 := _DestinationCIDRv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varDestinationCIDRv6) + + if err != nil { + return err + } + + *o = DestinationCIDRv6(varDestinationCIDRv6) + + return err +} + +type NullableDestinationCIDRv6 struct { + value *DestinationCIDRv6 + isSet bool +} + +func (v NullableDestinationCIDRv6) Get() *DestinationCIDRv6 { + return v.value +} + +func (v *NullableDestinationCIDRv6) Set(val *DestinationCIDRv6) { + v.value = val + v.isSet = true +} + +func (v NullableDestinationCIDRv6) IsSet() bool { + return v.isSet +} + +func (v *NullableDestinationCIDRv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableDestinationCIDRv6(val *DestinationCIDRv6) *NullableDestinationCIDRv6 { + return &NullableDestinationCIDRv6{value: val, isSet: true} +} + +func (v NullableDestinationCIDRv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableDestinationCIDRv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_error.go b/services/iaas/v2beta1api/model_error.go new file mode 100644 index 000000000..1a6e53edb --- /dev/null +++ b/services/iaas/v2beta1api/model_error.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Error type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Error{} + +// Error Error with HTTP error code and an error message. +type Error struct { + Code int64 `json:"code"` + // An error message. + Msg string `json:"msg"` +} + +type _Error Error + +// NewError instantiates a new Error object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewError(code int64, msg string) *Error { + this := Error{} + this.Code = code + this.Msg = msg + return &this +} + +// NewErrorWithDefaults instantiates a new Error object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewErrorWithDefaults() *Error { + this := Error{} + return &this +} + +// GetCode returns the Code field value +func (o *Error) GetCode() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *Error) GetCodeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *Error) SetCode(v int64) { + o.Code = v +} + +// GetMsg returns the Msg field value +func (o *Error) GetMsg() string { + if o == nil { + var ret string + return ret + } + + return o.Msg +} + +// GetMsgOk returns a tuple with the Msg field value +// and a boolean to check if the value has been set. +func (o *Error) GetMsgOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Msg, true +} + +// SetMsg sets field value +func (o *Error) SetMsg(v string) { + o.Msg = v +} + +func (o Error) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Error) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["msg"] = o.Msg + return toSerialize, nil +} + +func (o *Error) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "msg", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varError := _Error{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varError) + + if err != nil { + return err + } + + *o = Error(varError) + + return err +} + +type NullableError struct { + value *Error + isSet bool +} + +func (v NullableError) Get() *Error { + return v.value +} + +func (v *NullableError) Set(val *Error) { + v.value = val + v.isSet = true +} + +func (v NullableError) IsSet() bool { + return v.isSet +} + +func (v *NullableError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableError(val *Error) *NullableError { + return &NullableError{value: val, isSet: true} +} + +func (v NullableError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_get_server_log_200_response.go b/services/iaas/v2beta1api/model_get_server_log_200_response.go new file mode 100644 index 000000000..bbddbb383 --- /dev/null +++ b/services/iaas/v2beta1api/model_get_server_log_200_response.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the GetServerLog200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetServerLog200Response{} + +// GetServerLog200Response struct for GetServerLog200Response +type GetServerLog200Response struct { + Output *string `json:"output,omitempty"` +} + +// NewGetServerLog200Response instantiates a new GetServerLog200Response object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGetServerLog200Response() *GetServerLog200Response { + this := GetServerLog200Response{} + return &this +} + +// NewGetServerLog200ResponseWithDefaults instantiates a new GetServerLog200Response object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGetServerLog200ResponseWithDefaults() *GetServerLog200Response { + this := GetServerLog200Response{} + return &this +} + +// GetOutput returns the Output field value if set, zero value otherwise. +func (o *GetServerLog200Response) GetOutput() string { + if o == nil || IsNil(o.Output) { + var ret string + return ret + } + return *o.Output +} + +// GetOutputOk returns a tuple with the Output field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetServerLog200Response) GetOutputOk() (*string, bool) { + if o == nil || IsNil(o.Output) { + return nil, false + } + return o.Output, true +} + +// HasOutput returns a boolean if a field has been set. +func (o *GetServerLog200Response) HasOutput() bool { + if o != nil && !IsNil(o.Output) { + return true + } + + return false +} + +// SetOutput gets a reference to the given string and assigns it to the Output field. +func (o *GetServerLog200Response) SetOutput(v string) { + o.Output = &v +} + +func (o GetServerLog200Response) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetServerLog200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Output) { + toSerialize["output"] = o.Output + } + return toSerialize, nil +} + +type NullableGetServerLog200Response struct { + value *GetServerLog200Response + isSet bool +} + +func (v NullableGetServerLog200Response) Get() *GetServerLog200Response { + return v.value +} + +func (v *NullableGetServerLog200Response) Set(val *GetServerLog200Response) { + v.value = val + v.isSet = true +} + +func (v NullableGetServerLog200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableGetServerLog200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetServerLog200Response(val *GetServerLog200Response) *NullableGetServerLog200Response { + return &NullableGetServerLog200Response{value: val, isSet: true} +} + +func (v NullableGetServerLog200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetServerLog200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_icmp_parameters.go b/services/iaas/v2beta1api/model_icmp_parameters.go new file mode 100644 index 000000000..894219dbd --- /dev/null +++ b/services/iaas/v2beta1api/model_icmp_parameters.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ICMPParameters type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ICMPParameters{} + +// ICMPParameters Object that represents ICMP parameters. +type ICMPParameters struct { + // ICMP code. Can be set if the protocol is ICMP. + Code int64 `json:"code"` + // ICMP type. Can be set if the protocol is ICMP. + Type int64 `json:"type"` +} + +type _ICMPParameters ICMPParameters + +// NewICMPParameters instantiates a new ICMPParameters object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewICMPParameters(code int64, types int64) *ICMPParameters { + this := ICMPParameters{} + this.Code = code + this.Type = types + return &this +} + +// NewICMPParametersWithDefaults instantiates a new ICMPParameters object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewICMPParametersWithDefaults() *ICMPParameters { + this := ICMPParameters{} + return &this +} + +// GetCode returns the Code field value +func (o *ICMPParameters) GetCode() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Code +} + +// GetCodeOk returns a tuple with the Code field value +// and a boolean to check if the value has been set. +func (o *ICMPParameters) GetCodeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Code, true +} + +// SetCode sets field value +func (o *ICMPParameters) SetCode(v int64) { + o.Code = v +} + +// GetType returns the Type field value +func (o *ICMPParameters) GetType() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *ICMPParameters) GetTypeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *ICMPParameters) SetType(v int64) { + o.Type = v +} + +func (o ICMPParameters) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ICMPParameters) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["code"] = o.Code + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *ICMPParameters) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "code", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varICMPParameters := _ICMPParameters{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varICMPParameters) + + if err != nil { + return err + } + + *o = ICMPParameters(varICMPParameters) + + return err +} + +type NullableICMPParameters struct { + value *ICMPParameters + isSet bool +} + +func (v NullableICMPParameters) Get() *ICMPParameters { + return v.value +} + +func (v *NullableICMPParameters) Set(val *ICMPParameters) { + v.value = val + v.isSet = true +} + +func (v NullableICMPParameters) IsSet() bool { + return v.isSet +} + +func (v *NullableICMPParameters) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableICMPParameters(val *ICMPParameters) *NullableICMPParameters { + return &NullableICMPParameters{value: val, isSet: true} +} + +func (v NullableICMPParameters) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableICMPParameters) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_image.go b/services/iaas/v2beta1api/model_image.go new file mode 100644 index 000000000..c3f4df956 --- /dev/null +++ b/services/iaas/v2beta1api/model_image.go @@ -0,0 +1,740 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Image type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Image{} + +// Image Object that represents an Image and its parameters. Used for Creating and returning (get/list). +type Image struct { + Agent *ImageAgent `json:"agent,omitempty"` + Checksum *ImageChecksum `json:"checksum,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat string `json:"diskFormat"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Indicates Image Import Progress in percent. + ImportProgress *int64 `json:"importProgress,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + Owner *string `json:"owner,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` + // Scope of an Image. Possible values: `public`, `local`, `projects`, `organization`. + Scope *string `json:"scope,omitempty"` + // Size in bytes. + Size *int64 `json:"size,omitempty"` + // The status of an image object. Possible values: `AVAILABLE`, `CREATING`, `DEACTIVATED`, `DELETED`, `DELETING`, `ERROR`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Image Image + +// NewImage instantiates a new Image object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImage(diskFormat string, name string) *Image { + this := Image{} + this.DiskFormat = diskFormat + this.Name = name + return &this +} + +// NewImageWithDefaults instantiates a new Image object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageWithDefaults() *Image { + this := Image{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *Image) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *Image) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *Image) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetChecksum returns the Checksum field value if set, zero value otherwise. +func (o *Image) GetChecksum() ImageChecksum { + if o == nil || IsNil(o.Checksum) { + var ret ImageChecksum + return ret + } + return *o.Checksum +} + +// GetChecksumOk returns a tuple with the Checksum field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetChecksumOk() (*ImageChecksum, bool) { + if o == nil || IsNil(o.Checksum) { + return nil, false + } + return o.Checksum, true +} + +// HasChecksum returns a boolean if a field has been set. +func (o *Image) HasChecksum() bool { + if o != nil && !IsNil(o.Checksum) { + return true + } + + return false +} + +// SetChecksum gets a reference to the given ImageChecksum and assigns it to the Checksum field. +func (o *Image) SetChecksum(v ImageChecksum) { + o.Checksum = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *Image) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *Image) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *Image) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Image) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Image) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Image) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDiskFormat returns the DiskFormat field value +func (o *Image) GetDiskFormat() string { + if o == nil { + var ret string + return ret + } + + return o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value +// and a boolean to check if the value has been set. +func (o *Image) GetDiskFormatOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DiskFormat, true +} + +// SetDiskFormat sets field value +func (o *Image) SetDiskFormat(v string) { + o.DiskFormat = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Image) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Image) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Image) SetId(v string) { + o.Id = &v +} + +// GetImportProgress returns the ImportProgress field value if set, zero value otherwise. +func (o *Image) GetImportProgress() int64 { + if o == nil || IsNil(o.ImportProgress) { + var ret int64 + return ret + } + return *o.ImportProgress +} + +// GetImportProgressOk returns a tuple with the ImportProgress field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetImportProgressOk() (*int64, bool) { + if o == nil || IsNil(o.ImportProgress) { + return nil, false + } + return o.ImportProgress, true +} + +// HasImportProgress returns a boolean if a field has been set. +func (o *Image) HasImportProgress() bool { + if o != nil && !IsNil(o.ImportProgress) { + return true + } + + return false +} + +// SetImportProgress gets a reference to the given int64 and assigns it to the ImportProgress field. +func (o *Image) SetImportProgress(v int64) { + o.ImportProgress = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Image) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Image) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Image) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *Image) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *Image) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *Image) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *Image) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *Image) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *Image) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value +func (o *Image) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Image) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Image) SetName(v string) { + o.Name = v +} + +// GetOwner returns the Owner field value if set, zero value otherwise. +func (o *Image) GetOwner() string { + if o == nil || IsNil(o.Owner) { + var ret string + return ret + } + return *o.Owner +} + +// GetOwnerOk returns a tuple with the Owner field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetOwnerOk() (*string, bool) { + if o == nil || IsNil(o.Owner) { + return nil, false + } + return o.Owner, true +} + +// HasOwner returns a boolean if a field has been set. +func (o *Image) HasOwner() bool { + if o != nil && !IsNil(o.Owner) { + return true + } + + return false +} + +// SetOwner gets a reference to the given string and assigns it to the Owner field. +func (o *Image) SetOwner(v string) { + o.Owner = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *Image) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *Image) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *Image) SetProtected(v bool) { + o.Protected = &v +} + +// GetScope returns the Scope field value if set, zero value otherwise. +func (o *Image) GetScope() string { + if o == nil || IsNil(o.Scope) { + var ret string + return ret + } + return *o.Scope +} + +// GetScopeOk returns a tuple with the Scope field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetScopeOk() (*string, bool) { + if o == nil || IsNil(o.Scope) { + return nil, false + } + return o.Scope, true +} + +// HasScope returns a boolean if a field has been set. +func (o *Image) HasScope() bool { + if o != nil && !IsNil(o.Scope) { + return true + } + + return false +} + +// SetScope gets a reference to the given string and assigns it to the Scope field. +func (o *Image) SetScope(v string) { + o.Scope = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Image) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Image) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Image) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Image) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Image) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Image) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Image) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Image) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Image) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Image) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Image) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Image) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Checksum) { + toSerialize["checksum"] = o.Checksum + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["diskFormat"] = o.DiskFormat + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImportProgress) { + toSerialize["importProgress"] = o.ImportProgress + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + toSerialize["name"] = o.Name + if !IsNil(o.Owner) { + toSerialize["owner"] = o.Owner + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + if !IsNil(o.Scope) { + toSerialize["scope"] = o.Scope + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Image) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "diskFormat", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImage := _Image{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImage) + + if err != nil { + return err + } + + *o = Image(varImage) + + return err +} + +type NullableImage struct { + value *Image + isSet bool +} + +func (v NullableImage) Get() *Image { + return v.value +} + +func (v *NullableImage) Set(val *Image) { + v.value = val + v.isSet = true +} + +func (v NullableImage) IsSet() bool { + return v.isSet +} + +func (v *NullableImage) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImage(val *Image) *NullableImage { + return &NullableImage{value: val, isSet: true} +} + +func (v NullableImage) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImage) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_image_agent.go b/services/iaas/v2beta1api/model_image_agent.go new file mode 100644 index 000000000..79a3e653b --- /dev/null +++ b/services/iaas/v2beta1api/model_image_agent.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the ImageAgent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageAgent{} + +// ImageAgent Support status and default provioning setting for the STACKIT server agent. +type ImageAgent struct { + // Default provioning of the STACKIT server agent for new servers. The default for new images is false. Can only be enabled when supported is also true. + ProvisionByDefault *bool `json:"provisionByDefault,omitempty"` + // Indicates the STACKIT server agent for the image. The default for new images is false. + Supported *bool `json:"supported,omitempty"` +} + +// NewImageAgent instantiates a new ImageAgent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageAgent() *ImageAgent { + this := ImageAgent{} + return &this +} + +// NewImageAgentWithDefaults instantiates a new ImageAgent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageAgentWithDefaults() *ImageAgent { + this := ImageAgent{} + return &this +} + +// GetProvisionByDefault returns the ProvisionByDefault field value if set, zero value otherwise. +func (o *ImageAgent) GetProvisionByDefault() bool { + if o == nil || IsNil(o.ProvisionByDefault) { + var ret bool + return ret + } + return *o.ProvisionByDefault +} + +// GetProvisionByDefaultOk returns a tuple with the ProvisionByDefault field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAgent) GetProvisionByDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.ProvisionByDefault) { + return nil, false + } + return o.ProvisionByDefault, true +} + +// HasProvisionByDefault returns a boolean if a field has been set. +func (o *ImageAgent) HasProvisionByDefault() bool { + if o != nil && !IsNil(o.ProvisionByDefault) { + return true + } + + return false +} + +// SetProvisionByDefault gets a reference to the given bool and assigns it to the ProvisionByDefault field. +func (o *ImageAgent) SetProvisionByDefault(v bool) { + o.ProvisionByDefault = &v +} + +// GetSupported returns the Supported field value if set, zero value otherwise. +func (o *ImageAgent) GetSupported() bool { + if o == nil || IsNil(o.Supported) { + var ret bool + return ret + } + return *o.Supported +} + +// GetSupportedOk returns a tuple with the Supported field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageAgent) GetSupportedOk() (*bool, bool) { + if o == nil || IsNil(o.Supported) { + return nil, false + } + return o.Supported, true +} + +// HasSupported returns a boolean if a field has been set. +func (o *ImageAgent) HasSupported() bool { + if o != nil && !IsNil(o.Supported) { + return true + } + + return false +} + +// SetSupported gets a reference to the given bool and assigns it to the Supported field. +func (o *ImageAgent) SetSupported(v bool) { + o.Supported = &v +} + +func (o ImageAgent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageAgent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ProvisionByDefault) { + toSerialize["provisionByDefault"] = o.ProvisionByDefault + } + if !IsNil(o.Supported) { + toSerialize["supported"] = o.Supported + } + return toSerialize, nil +} + +type NullableImageAgent struct { + value *ImageAgent + isSet bool +} + +func (v NullableImageAgent) Get() *ImageAgent { + return v.value +} + +func (v *NullableImageAgent) Set(val *ImageAgent) { + v.value = val + v.isSet = true +} + +func (v NullableImageAgent) IsSet() bool { + return v.isSet +} + +func (v *NullableImageAgent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageAgent(val *ImageAgent) *NullableImageAgent { + return &NullableImageAgent{value: val, isSet: true} +} + +func (v NullableImageAgent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageAgent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_image_checksum.go b/services/iaas/v2beta1api/model_image_checksum.go new file mode 100644 index 000000000..0cf551348 --- /dev/null +++ b/services/iaas/v2beta1api/model_image_checksum.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageChecksum type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageChecksum{} + +// ImageChecksum Representation of an image checksum. +type ImageChecksum struct { + // Algorithm for the checksum of the image data. Possible values: `md5`, `sha512`. + Algorithm string `json:"algorithm"` + // Hexdigest of the checksum of the image data. + Digest string `json:"digest" validate:"regexp=^[0-9a-f]+$"` +} + +type _ImageChecksum ImageChecksum + +// NewImageChecksum instantiates a new ImageChecksum object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageChecksum(algorithm string, digest string) *ImageChecksum { + this := ImageChecksum{} + this.Algorithm = algorithm + this.Digest = digest + return &this +} + +// NewImageChecksumWithDefaults instantiates a new ImageChecksum object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageChecksumWithDefaults() *ImageChecksum { + this := ImageChecksum{} + return &this +} + +// GetAlgorithm returns the Algorithm field value +func (o *ImageChecksum) GetAlgorithm() string { + if o == nil { + var ret string + return ret + } + + return o.Algorithm +} + +// GetAlgorithmOk returns a tuple with the Algorithm field value +// and a boolean to check if the value has been set. +func (o *ImageChecksum) GetAlgorithmOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Algorithm, true +} + +// SetAlgorithm sets field value +func (o *ImageChecksum) SetAlgorithm(v string) { + o.Algorithm = v +} + +// GetDigest returns the Digest field value +func (o *ImageChecksum) GetDigest() string { + if o == nil { + var ret string + return ret + } + + return o.Digest +} + +// GetDigestOk returns a tuple with the Digest field value +// and a boolean to check if the value has been set. +func (o *ImageChecksum) GetDigestOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Digest, true +} + +// SetDigest sets field value +func (o *ImageChecksum) SetDigest(v string) { + o.Digest = v +} + +func (o ImageChecksum) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageChecksum) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["algorithm"] = o.Algorithm + toSerialize["digest"] = o.Digest + return toSerialize, nil +} + +func (o *ImageChecksum) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "algorithm", + "digest", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageChecksum := _ImageChecksum{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageChecksum) + + if err != nil { + return err + } + + *o = ImageChecksum(varImageChecksum) + + return err +} + +type NullableImageChecksum struct { + value *ImageChecksum + isSet bool +} + +func (v NullableImageChecksum) Get() *ImageChecksum { + return v.value +} + +func (v *NullableImageChecksum) Set(val *ImageChecksum) { + v.value = val + v.isSet = true +} + +func (v NullableImageChecksum) IsSet() bool { + return v.isSet +} + +func (v *NullableImageChecksum) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageChecksum(val *ImageChecksum) *NullableImageChecksum { + return &NullableImageChecksum{value: val, isSet: true} +} + +func (v NullableImageChecksum) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageChecksum) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_image_config.go b/services/iaas/v2beta1api/model_image_config.go new file mode 100644 index 000000000..edf403c83 --- /dev/null +++ b/services/iaas/v2beta1api/model_image_config.go @@ -0,0 +1,695 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the ImageConfig type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageConfig{} + +// ImageConfig Properties to set hardware and scheduling settings for an Image. +type ImageConfig struct { + // Represents CPU architecture. The default for new images is x86. Possible values: `arm64`, `x86`. + Architecture *string `json:"architecture,omitempty"` + // Enables the BIOS bootmenu. The default for new images is disabled. + BootMenu *bool `json:"bootMenu,omitempty"` + // Sets CDROM bus controller type. Possible values: `scsi`, `virtio`, `ide`, `usb`. + CdromBus NullableString `json:"cdromBus,omitempty"` + // Sets Disk bus controller type. Possible values: `scsi`, `virtio`, `ide`, `usb`. + DiskBus NullableString `json:"diskBus,omitempty"` + // Sets virtual nic model. Possible values: `e1000`, `e1000e`, `ne2k_pci`, `pcnet`, `rtl8139`, `virtio`, `vmxnet3`. + NicModel NullableString `json:"nicModel,omitempty"` + // Enables OS specific optimizations. Possible values: `windows`, `linux`. + OperatingSystem *string `json:"operatingSystem,omitempty"` + // Operating System Distribution. + OperatingSystemDistro NullableString `json:"operatingSystemDistro,omitempty"` + // Version of the OS. + OperatingSystemVersion NullableString `json:"operatingSystemVersion,omitempty"` + // Sets the device bus when the image is used as a rescue image. Possible values: `sata`, `scsi`, `virtio`, `usb`. + RescueBus NullableString `json:"rescueBus,omitempty"` + // Sets the device when the image is used as a rescue image. Possible values: `cdrom`, `disk`. + RescueDevice NullableString `json:"rescueDevice,omitempty"` + // Enables Secure Boot. The default for new images is disabled. + SecureBoot *bool `json:"secureBoot,omitempty"` + // Configure UEFI boot. The default for new images is enabled. + Uefi *bool `json:"uefi,omitempty"` + // Sets Graphic device model. Possible values: `vga`, `cirrus`, `vmvga`, `qxl`, `virtio`, `none`. + VideoModel NullableString `json:"videoModel,omitempty"` + // Enables the use of VirtIO SCSI to provide block device access. By default servers use VirtIO Block. + VirtioScsi *bool `json:"virtioScsi,omitempty"` +} + +// NewImageConfig instantiates a new ImageConfig object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageConfig() *ImageConfig { + this := ImageConfig{} + return &this +} + +// NewImageConfigWithDefaults instantiates a new ImageConfig object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageConfigWithDefaults() *ImageConfig { + this := ImageConfig{} + return &this +} + +// GetArchitecture returns the Architecture field value if set, zero value otherwise. +func (o *ImageConfig) GetArchitecture() string { + if o == nil || IsNil(o.Architecture) { + var ret string + return ret + } + return *o.Architecture +} + +// GetArchitectureOk returns a tuple with the Architecture field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetArchitectureOk() (*string, bool) { + if o == nil || IsNil(o.Architecture) { + return nil, false + } + return o.Architecture, true +} + +// HasArchitecture returns a boolean if a field has been set. +func (o *ImageConfig) HasArchitecture() bool { + if o != nil && !IsNil(o.Architecture) { + return true + } + + return false +} + +// SetArchitecture gets a reference to the given string and assigns it to the Architecture field. +func (o *ImageConfig) SetArchitecture(v string) { + o.Architecture = &v +} + +// GetBootMenu returns the BootMenu field value if set, zero value otherwise. +func (o *ImageConfig) GetBootMenu() bool { + if o == nil || IsNil(o.BootMenu) { + var ret bool + return ret + } + return *o.BootMenu +} + +// GetBootMenuOk returns a tuple with the BootMenu field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetBootMenuOk() (*bool, bool) { + if o == nil || IsNil(o.BootMenu) { + return nil, false + } + return o.BootMenu, true +} + +// HasBootMenu returns a boolean if a field has been set. +func (o *ImageConfig) HasBootMenu() bool { + if o != nil && !IsNil(o.BootMenu) { + return true + } + + return false +} + +// SetBootMenu gets a reference to the given bool and assigns it to the BootMenu field. +func (o *ImageConfig) SetBootMenu(v bool) { + o.BootMenu = &v +} + +// GetCdromBus returns the CdromBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetCdromBus() string { + if o == nil || IsNil(o.CdromBus.Get()) { + var ret string + return ret + } + return *o.CdromBus.Get() +} + +// GetCdromBusOk returns a tuple with the CdromBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetCdromBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CdromBus.Get(), o.CdromBus.IsSet() +} + +// HasCdromBus returns a boolean if a field has been set. +func (o *ImageConfig) HasCdromBus() bool { + if o != nil && o.CdromBus.IsSet() { + return true + } + + return false +} + +// SetCdromBus gets a reference to the given NullableString and assigns it to the CdromBus field. +func (o *ImageConfig) SetCdromBus(v string) { + o.CdromBus.Set(&v) +} + +// SetCdromBusNil sets the value for CdromBus to be an explicit nil +func (o *ImageConfig) SetCdromBusNil() { + o.CdromBus.Set(nil) +} + +// UnsetCdromBus ensures that no value is present for CdromBus, not even an explicit nil +func (o *ImageConfig) UnsetCdromBus() { + o.CdromBus.Unset() +} + +// GetDiskBus returns the DiskBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetDiskBus() string { + if o == nil || IsNil(o.DiskBus.Get()) { + var ret string + return ret + } + return *o.DiskBus.Get() +} + +// GetDiskBusOk returns a tuple with the DiskBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetDiskBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DiskBus.Get(), o.DiskBus.IsSet() +} + +// HasDiskBus returns a boolean if a field has been set. +func (o *ImageConfig) HasDiskBus() bool { + if o != nil && o.DiskBus.IsSet() { + return true + } + + return false +} + +// SetDiskBus gets a reference to the given NullableString and assigns it to the DiskBus field. +func (o *ImageConfig) SetDiskBus(v string) { + o.DiskBus.Set(&v) +} + +// SetDiskBusNil sets the value for DiskBus to be an explicit nil +func (o *ImageConfig) SetDiskBusNil() { + o.DiskBus.Set(nil) +} + +// UnsetDiskBus ensures that no value is present for DiskBus, not even an explicit nil +func (o *ImageConfig) UnsetDiskBus() { + o.DiskBus.Unset() +} + +// GetNicModel returns the NicModel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetNicModel() string { + if o == nil || IsNil(o.NicModel.Get()) { + var ret string + return ret + } + return *o.NicModel.Get() +} + +// GetNicModelOk returns a tuple with the NicModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetNicModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NicModel.Get(), o.NicModel.IsSet() +} + +// HasNicModel returns a boolean if a field has been set. +func (o *ImageConfig) HasNicModel() bool { + if o != nil && o.NicModel.IsSet() { + return true + } + + return false +} + +// SetNicModel gets a reference to the given NullableString and assigns it to the NicModel field. +func (o *ImageConfig) SetNicModel(v string) { + o.NicModel.Set(&v) +} + +// SetNicModelNil sets the value for NicModel to be an explicit nil +func (o *ImageConfig) SetNicModelNil() { + o.NicModel.Set(nil) +} + +// UnsetNicModel ensures that no value is present for NicModel, not even an explicit nil +func (o *ImageConfig) UnsetNicModel() { + o.NicModel.Unset() +} + +// GetOperatingSystem returns the OperatingSystem field value if set, zero value otherwise. +func (o *ImageConfig) GetOperatingSystem() string { + if o == nil || IsNil(o.OperatingSystem) { + var ret string + return ret + } + return *o.OperatingSystem +} + +// GetOperatingSystemOk returns a tuple with the OperatingSystem field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetOperatingSystemOk() (*string, bool) { + if o == nil || IsNil(o.OperatingSystem) { + return nil, false + } + return o.OperatingSystem, true +} + +// HasOperatingSystem returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystem() bool { + if o != nil && !IsNil(o.OperatingSystem) { + return true + } + + return false +} + +// SetOperatingSystem gets a reference to the given string and assigns it to the OperatingSystem field. +func (o *ImageConfig) SetOperatingSystem(v string) { + o.OperatingSystem = &v +} + +// GetOperatingSystemDistro returns the OperatingSystemDistro field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetOperatingSystemDistro() string { + if o == nil || IsNil(o.OperatingSystemDistro.Get()) { + var ret string + return ret + } + return *o.OperatingSystemDistro.Get() +} + +// GetOperatingSystemDistroOk returns a tuple with the OperatingSystemDistro field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetOperatingSystemDistroOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OperatingSystemDistro.Get(), o.OperatingSystemDistro.IsSet() +} + +// HasOperatingSystemDistro returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystemDistro() bool { + if o != nil && o.OperatingSystemDistro.IsSet() { + return true + } + + return false +} + +// SetOperatingSystemDistro gets a reference to the given NullableString and assigns it to the OperatingSystemDistro field. +func (o *ImageConfig) SetOperatingSystemDistro(v string) { + o.OperatingSystemDistro.Set(&v) +} + +// SetOperatingSystemDistroNil sets the value for OperatingSystemDistro to be an explicit nil +func (o *ImageConfig) SetOperatingSystemDistroNil() { + o.OperatingSystemDistro.Set(nil) +} + +// UnsetOperatingSystemDistro ensures that no value is present for OperatingSystemDistro, not even an explicit nil +func (o *ImageConfig) UnsetOperatingSystemDistro() { + o.OperatingSystemDistro.Unset() +} + +// GetOperatingSystemVersion returns the OperatingSystemVersion field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetOperatingSystemVersion() string { + if o == nil || IsNil(o.OperatingSystemVersion.Get()) { + var ret string + return ret + } + return *o.OperatingSystemVersion.Get() +} + +// GetOperatingSystemVersionOk returns a tuple with the OperatingSystemVersion field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetOperatingSystemVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.OperatingSystemVersion.Get(), o.OperatingSystemVersion.IsSet() +} + +// HasOperatingSystemVersion returns a boolean if a field has been set. +func (o *ImageConfig) HasOperatingSystemVersion() bool { + if o != nil && o.OperatingSystemVersion.IsSet() { + return true + } + + return false +} + +// SetOperatingSystemVersion gets a reference to the given NullableString and assigns it to the OperatingSystemVersion field. +func (o *ImageConfig) SetOperatingSystemVersion(v string) { + o.OperatingSystemVersion.Set(&v) +} + +// SetOperatingSystemVersionNil sets the value for OperatingSystemVersion to be an explicit nil +func (o *ImageConfig) SetOperatingSystemVersionNil() { + o.OperatingSystemVersion.Set(nil) +} + +// UnsetOperatingSystemVersion ensures that no value is present for OperatingSystemVersion, not even an explicit nil +func (o *ImageConfig) UnsetOperatingSystemVersion() { + o.OperatingSystemVersion.Unset() +} + +// GetRescueBus returns the RescueBus field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetRescueBus() string { + if o == nil || IsNil(o.RescueBus.Get()) { + var ret string + return ret + } + return *o.RescueBus.Get() +} + +// GetRescueBusOk returns a tuple with the RescueBus field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetRescueBusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RescueBus.Get(), o.RescueBus.IsSet() +} + +// HasRescueBus returns a boolean if a field has been set. +func (o *ImageConfig) HasRescueBus() bool { + if o != nil && o.RescueBus.IsSet() { + return true + } + + return false +} + +// SetRescueBus gets a reference to the given NullableString and assigns it to the RescueBus field. +func (o *ImageConfig) SetRescueBus(v string) { + o.RescueBus.Set(&v) +} + +// SetRescueBusNil sets the value for RescueBus to be an explicit nil +func (o *ImageConfig) SetRescueBusNil() { + o.RescueBus.Set(nil) +} + +// UnsetRescueBus ensures that no value is present for RescueBus, not even an explicit nil +func (o *ImageConfig) UnsetRescueBus() { + o.RescueBus.Unset() +} + +// GetRescueDevice returns the RescueDevice field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetRescueDevice() string { + if o == nil || IsNil(o.RescueDevice.Get()) { + var ret string + return ret + } + return *o.RescueDevice.Get() +} + +// GetRescueDeviceOk returns a tuple with the RescueDevice field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetRescueDeviceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RescueDevice.Get(), o.RescueDevice.IsSet() +} + +// HasRescueDevice returns a boolean if a field has been set. +func (o *ImageConfig) HasRescueDevice() bool { + if o != nil && o.RescueDevice.IsSet() { + return true + } + + return false +} + +// SetRescueDevice gets a reference to the given NullableString and assigns it to the RescueDevice field. +func (o *ImageConfig) SetRescueDevice(v string) { + o.RescueDevice.Set(&v) +} + +// SetRescueDeviceNil sets the value for RescueDevice to be an explicit nil +func (o *ImageConfig) SetRescueDeviceNil() { + o.RescueDevice.Set(nil) +} + +// UnsetRescueDevice ensures that no value is present for RescueDevice, not even an explicit nil +func (o *ImageConfig) UnsetRescueDevice() { + o.RescueDevice.Unset() +} + +// GetSecureBoot returns the SecureBoot field value if set, zero value otherwise. +func (o *ImageConfig) GetSecureBoot() bool { + if o == nil || IsNil(o.SecureBoot) { + var ret bool + return ret + } + return *o.SecureBoot +} + +// GetSecureBootOk returns a tuple with the SecureBoot field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetSecureBootOk() (*bool, bool) { + if o == nil || IsNil(o.SecureBoot) { + return nil, false + } + return o.SecureBoot, true +} + +// HasSecureBoot returns a boolean if a field has been set. +func (o *ImageConfig) HasSecureBoot() bool { + if o != nil && !IsNil(o.SecureBoot) { + return true + } + + return false +} + +// SetSecureBoot gets a reference to the given bool and assigns it to the SecureBoot field. +func (o *ImageConfig) SetSecureBoot(v bool) { + o.SecureBoot = &v +} + +// GetUefi returns the Uefi field value if set, zero value otherwise. +func (o *ImageConfig) GetUefi() bool { + if o == nil || IsNil(o.Uefi) { + var ret bool + return ret + } + return *o.Uefi +} + +// GetUefiOk returns a tuple with the Uefi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetUefiOk() (*bool, bool) { + if o == nil || IsNil(o.Uefi) { + return nil, false + } + return o.Uefi, true +} + +// HasUefi returns a boolean if a field has been set. +func (o *ImageConfig) HasUefi() bool { + if o != nil && !IsNil(o.Uefi) { + return true + } + + return false +} + +// SetUefi gets a reference to the given bool and assigns it to the Uefi field. +func (o *ImageConfig) SetUefi(v bool) { + o.Uefi = &v +} + +// GetVideoModel returns the VideoModel field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ImageConfig) GetVideoModel() string { + if o == nil || IsNil(o.VideoModel.Get()) { + var ret string + return ret + } + return *o.VideoModel.Get() +} + +// GetVideoModelOk returns a tuple with the VideoModel field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ImageConfig) GetVideoModelOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.VideoModel.Get(), o.VideoModel.IsSet() +} + +// HasVideoModel returns a boolean if a field has been set. +func (o *ImageConfig) HasVideoModel() bool { + if o != nil && o.VideoModel.IsSet() { + return true + } + + return false +} + +// SetVideoModel gets a reference to the given NullableString and assigns it to the VideoModel field. +func (o *ImageConfig) SetVideoModel(v string) { + o.VideoModel.Set(&v) +} + +// SetVideoModelNil sets the value for VideoModel to be an explicit nil +func (o *ImageConfig) SetVideoModelNil() { + o.VideoModel.Set(nil) +} + +// UnsetVideoModel ensures that no value is present for VideoModel, not even an explicit nil +func (o *ImageConfig) UnsetVideoModel() { + o.VideoModel.Unset() +} + +// GetVirtioScsi returns the VirtioScsi field value if set, zero value otherwise. +func (o *ImageConfig) GetVirtioScsi() bool { + if o == nil || IsNil(o.VirtioScsi) { + var ret bool + return ret + } + return *o.VirtioScsi +} + +// GetVirtioScsiOk returns a tuple with the VirtioScsi field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageConfig) GetVirtioScsiOk() (*bool, bool) { + if o == nil || IsNil(o.VirtioScsi) { + return nil, false + } + return o.VirtioScsi, true +} + +// HasVirtioScsi returns a boolean if a field has been set. +func (o *ImageConfig) HasVirtioScsi() bool { + if o != nil && !IsNil(o.VirtioScsi) { + return true + } + + return false +} + +// SetVirtioScsi gets a reference to the given bool and assigns it to the VirtioScsi field. +func (o *ImageConfig) SetVirtioScsi(v bool) { + o.VirtioScsi = &v +} + +func (o ImageConfig) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageConfig) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Architecture) { + toSerialize["architecture"] = o.Architecture + } + if !IsNil(o.BootMenu) { + toSerialize["bootMenu"] = o.BootMenu + } + if o.CdromBus.IsSet() { + toSerialize["cdromBus"] = o.CdromBus.Get() + } + if o.DiskBus.IsSet() { + toSerialize["diskBus"] = o.DiskBus.Get() + } + if o.NicModel.IsSet() { + toSerialize["nicModel"] = o.NicModel.Get() + } + if !IsNil(o.OperatingSystem) { + toSerialize["operatingSystem"] = o.OperatingSystem + } + if o.OperatingSystemDistro.IsSet() { + toSerialize["operatingSystemDistro"] = o.OperatingSystemDistro.Get() + } + if o.OperatingSystemVersion.IsSet() { + toSerialize["operatingSystemVersion"] = o.OperatingSystemVersion.Get() + } + if o.RescueBus.IsSet() { + toSerialize["rescueBus"] = o.RescueBus.Get() + } + if o.RescueDevice.IsSet() { + toSerialize["rescueDevice"] = o.RescueDevice.Get() + } + if !IsNil(o.SecureBoot) { + toSerialize["secureBoot"] = o.SecureBoot + } + if !IsNil(o.Uefi) { + toSerialize["uefi"] = o.Uefi + } + if o.VideoModel.IsSet() { + toSerialize["videoModel"] = o.VideoModel.Get() + } + if !IsNil(o.VirtioScsi) { + toSerialize["virtioScsi"] = o.VirtioScsi + } + return toSerialize, nil +} + +type NullableImageConfig struct { + value *ImageConfig + isSet bool +} + +func (v NullableImageConfig) Get() *ImageConfig { + return v.value +} + +func (v *NullableImageConfig) Set(val *ImageConfig) { + v.value = val + v.isSet = true +} + +func (v NullableImageConfig) IsSet() bool { + return v.isSet +} + +func (v *NullableImageConfig) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageConfig(val *ImageConfig) *NullableImageConfig { + return &NullableImageConfig{value: val, isSet: true} +} + +func (v NullableImageConfig) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageConfig) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_image_create_response.go b/services/iaas/v2beta1api/model_image_create_response.go new file mode 100644 index 000000000..d15ee43b4 --- /dev/null +++ b/services/iaas/v2beta1api/model_image_create_response.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageCreateResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageCreateResponse{} + +// ImageCreateResponse Image creation response. +type ImageCreateResponse struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + UploadUrl string `json:"uploadUrl"` +} + +type _ImageCreateResponse ImageCreateResponse + +// NewImageCreateResponse instantiates a new ImageCreateResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageCreateResponse(id string, uploadUrl string) *ImageCreateResponse { + this := ImageCreateResponse{} + this.Id = id + this.UploadUrl = uploadUrl + return &this +} + +// NewImageCreateResponseWithDefaults instantiates a new ImageCreateResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageCreateResponseWithDefaults() *ImageCreateResponse { + this := ImageCreateResponse{} + return &this +} + +// GetId returns the Id field value +func (o *ImageCreateResponse) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *ImageCreateResponse) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *ImageCreateResponse) SetId(v string) { + o.Id = v +} + +// GetUploadUrl returns the UploadUrl field value +func (o *ImageCreateResponse) GetUploadUrl() string { + if o == nil { + var ret string + return ret + } + + return o.UploadUrl +} + +// GetUploadUrlOk returns a tuple with the UploadUrl field value +// and a boolean to check if the value has been set. +func (o *ImageCreateResponse) GetUploadUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.UploadUrl, true +} + +// SetUploadUrl sets field value +func (o *ImageCreateResponse) SetUploadUrl(v string) { + o.UploadUrl = v +} + +func (o ImageCreateResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageCreateResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["uploadUrl"] = o.UploadUrl + return toSerialize, nil +} + +func (o *ImageCreateResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "uploadUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageCreateResponse := _ImageCreateResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageCreateResponse) + + if err != nil { + return err + } + + *o = ImageCreateResponse(varImageCreateResponse) + + return err +} + +type NullableImageCreateResponse struct { + value *ImageCreateResponse + isSet bool +} + +func (v NullableImageCreateResponse) Get() *ImageCreateResponse { + return v.value +} + +func (v *NullableImageCreateResponse) Set(val *ImageCreateResponse) { + v.value = val + v.isSet = true +} + +func (v NullableImageCreateResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableImageCreateResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageCreateResponse(val *ImageCreateResponse) *NullableImageCreateResponse { + return &NullableImageCreateResponse{value: val, isSet: true} +} + +func (v NullableImageCreateResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageCreateResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_image_list_response.go b/services/iaas/v2beta1api/model_image_list_response.go new file mode 100644 index 000000000..997d3e680 --- /dev/null +++ b/services/iaas/v2beta1api/model_image_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ImageListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageListResponse{} + +// ImageListResponse Image list response. +type ImageListResponse struct { + // A list containing image objects. + Items []Image `json:"items"` +} + +type _ImageListResponse ImageListResponse + +// NewImageListResponse instantiates a new ImageListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageListResponse(items []Image) *ImageListResponse { + this := ImageListResponse{} + this.Items = items + return &this +} + +// NewImageListResponseWithDefaults instantiates a new ImageListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageListResponseWithDefaults() *ImageListResponse { + this := ImageListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ImageListResponse) GetItems() []Image { + if o == nil { + var ret []Image + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ImageListResponse) GetItemsOk() ([]Image, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ImageListResponse) SetItems(v []Image) { + o.Items = v +} + +func (o ImageListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ImageListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varImageListResponse := _ImageListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varImageListResponse) + + if err != nil { + return err + } + + *o = ImageListResponse(varImageListResponse) + + return err +} + +type NullableImageListResponse struct { + value *ImageListResponse + isSet bool +} + +func (v NullableImageListResponse) Get() *ImageListResponse { + return v.value +} + +func (v *NullableImageListResponse) Set(val *ImageListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableImageListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableImageListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageListResponse(val *ImageListResponse) *NullableImageListResponse { + return &NullableImageListResponse{value: val, isSet: true} +} + +func (v NullableImageListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_image_share.go b/services/iaas/v2beta1api/model_image_share.go new file mode 100644 index 000000000..989e1ee56 --- /dev/null +++ b/services/iaas/v2beta1api/model_image_share.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the ImageShare type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageShare{} + +// ImageShare Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type ImageShare struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewImageShare instantiates a new ImageShare object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageShare() *ImageShare { + this := ImageShare{} + return &this +} + +// NewImageShareWithDefaults instantiates a new ImageShare object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageShareWithDefaults() *ImageShare { + this := ImageShare{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *ImageShare) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShare) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *ImageShare) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *ImageShare) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *ImageShare) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShare) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *ImageShare) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *ImageShare) SetProjects(v []string) { + o.Projects = v +} + +func (o ImageShare) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageShare) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableImageShare struct { + value *ImageShare + isSet bool +} + +func (v NullableImageShare) Get() *ImageShare { + return v.value +} + +func (v *NullableImageShare) Set(val *ImageShare) { + v.value = val + v.isSet = true +} + +func (v NullableImageShare) IsSet() bool { + return v.isSet +} + +func (v *NullableImageShare) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageShare(val *ImageShare) *NullableImageShare { + return &NullableImageShare{value: val, isSet: true} +} + +func (v NullableImageShare) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageShare) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_image_share_consumer.go b/services/iaas/v2beta1api/model_image_share_consumer.go new file mode 100644 index 000000000..90f25afd6 --- /dev/null +++ b/services/iaas/v2beta1api/model_image_share_consumer.go @@ -0,0 +1,238 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "time" +) + +// checks if the ImageShareConsumer type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ImageShareConsumer{} + +// ImageShareConsumer The details of an Image share consumer. +type ImageShareConsumer struct { + // Universally Unique Identifier (UUID). + ConsumerProjectId *string `json:"consumerProjectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +// NewImageShareConsumer instantiates a new ImageShareConsumer object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewImageShareConsumer() *ImageShareConsumer { + this := ImageShareConsumer{} + return &this +} + +// NewImageShareConsumerWithDefaults instantiates a new ImageShareConsumer object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewImageShareConsumerWithDefaults() *ImageShareConsumer { + this := ImageShareConsumer{} + return &this +} + +// GetConsumerProjectId returns the ConsumerProjectId field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetConsumerProjectId() string { + if o == nil || IsNil(o.ConsumerProjectId) { + var ret string + return ret + } + return *o.ConsumerProjectId +} + +// GetConsumerProjectIdOk returns a tuple with the ConsumerProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetConsumerProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.ConsumerProjectId) { + return nil, false + } + return o.ConsumerProjectId, true +} + +// HasConsumerProjectId returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasConsumerProjectId() bool { + if o != nil && !IsNil(o.ConsumerProjectId) { + return true + } + + return false +} + +// SetConsumerProjectId gets a reference to the given string and assigns it to the ConsumerProjectId field. +func (o *ImageShareConsumer) SetConsumerProjectId(v string) { + o.ConsumerProjectId = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *ImageShareConsumer) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *ImageShareConsumer) SetImageId(v string) { + o.ImageId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *ImageShareConsumer) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ImageShareConsumer) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *ImageShareConsumer) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *ImageShareConsumer) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o ImageShareConsumer) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ImageShareConsumer) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ConsumerProjectId) { + toSerialize["consumerProjectId"] = o.ConsumerProjectId + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +type NullableImageShareConsumer struct { + value *ImageShareConsumer + isSet bool +} + +func (v NullableImageShareConsumer) Get() *ImageShareConsumer { + return v.value +} + +func (v *NullableImageShareConsumer) Set(val *ImageShareConsumer) { + v.value = val + v.isSet = true +} + +func (v NullableImageShareConsumer) IsSet() bool { + return v.isSet +} + +func (v *NullableImageShareConsumer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableImageShareConsumer(val *ImageShareConsumer) *NullableImageShareConsumer { + return &NullableImageShareConsumer{value: val, isSet: true} +} + +func (v NullableImageShareConsumer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableImageShareConsumer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_key_pair_list_response.go b/services/iaas/v2beta1api/model_key_pair_list_response.go new file mode 100644 index 000000000..a9a219960 --- /dev/null +++ b/services/iaas/v2beta1api/model_key_pair_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the KeyPairListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &KeyPairListResponse{} + +// KeyPairListResponse SSH keypair list response. +type KeyPairListResponse struct { + // A list of SSH keypairs. + Items []Keypair `json:"items"` +} + +type _KeyPairListResponse KeyPairListResponse + +// NewKeyPairListResponse instantiates a new KeyPairListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeyPairListResponse(items []Keypair) *KeyPairListResponse { + this := KeyPairListResponse{} + this.Items = items + return &this +} + +// NewKeyPairListResponseWithDefaults instantiates a new KeyPairListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeyPairListResponseWithDefaults() *KeyPairListResponse { + this := KeyPairListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *KeyPairListResponse) GetItems() []Keypair { + if o == nil { + var ret []Keypair + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *KeyPairListResponse) GetItemsOk() ([]Keypair, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *KeyPairListResponse) SetItems(v []Keypair) { + o.Items = v +} + +func (o KeyPairListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o KeyPairListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *KeyPairListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeyPairListResponse := _KeyPairListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeyPairListResponse) + + if err != nil { + return err + } + + *o = KeyPairListResponse(varKeyPairListResponse) + + return err +} + +type NullableKeyPairListResponse struct { + value *KeyPairListResponse + isSet bool +} + +func (v NullableKeyPairListResponse) Get() *KeyPairListResponse { + return v.value +} + +func (v *NullableKeyPairListResponse) Set(val *KeyPairListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableKeyPairListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableKeyPairListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeyPairListResponse(val *KeyPairListResponse) *NullableKeyPairListResponse { + return &NullableKeyPairListResponse{value: val, isSet: true} +} + +func (v NullableKeyPairListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeyPairListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_keypair.go b/services/iaas/v2beta1api/model_keypair.go new file mode 100644 index 000000000..97a716127 --- /dev/null +++ b/services/iaas/v2beta1api/model_keypair.go @@ -0,0 +1,344 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Keypair type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Keypair{} + +// Keypair Object that represents the public key of an SSH keypair and its name. +type Keypair struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Object that represents an SSH keypair MD5 fingerprint. + Fingerprint *string `json:"fingerprint,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){15}([0-9A-Fa-f]{2})$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name of an SSH keypair. Allowed characters are letters [a-zA-Z], digits [0-9] and the following special characters: [@._-]. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // Object that represents a public SSH key. + PublicKey string `json:"publicKey" validate:"regexp=^(ssh-rsa|ssh-ed25519|ecdsa-sha2-nistp(256|384|521))\\\\s+[A-Za-z0-9+\\/]+[=]{0,3}(\\\\s+.+)?\\\\s*$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Keypair Keypair + +// NewKeypair instantiates a new Keypair object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewKeypair(publicKey string) *Keypair { + this := Keypair{} + this.PublicKey = publicKey + return &this +} + +// NewKeypairWithDefaults instantiates a new Keypair object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewKeypairWithDefaults() *Keypair { + this := Keypair{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Keypair) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Keypair) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Keypair) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetFingerprint returns the Fingerprint field value if set, zero value otherwise. +func (o *Keypair) GetFingerprint() string { + if o == nil || IsNil(o.Fingerprint) { + var ret string + return ret + } + return *o.Fingerprint +} + +// GetFingerprintOk returns a tuple with the Fingerprint field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetFingerprintOk() (*string, bool) { + if o == nil || IsNil(o.Fingerprint) { + return nil, false + } + return o.Fingerprint, true +} + +// HasFingerprint returns a boolean if a field has been set. +func (o *Keypair) HasFingerprint() bool { + if o != nil && !IsNil(o.Fingerprint) { + return true + } + + return false +} + +// SetFingerprint gets a reference to the given string and assigns it to the Fingerprint field. +func (o *Keypair) SetFingerprint(v string) { + o.Fingerprint = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Keypair) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Keypair) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Keypair) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Keypair) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Keypair) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Keypair) SetName(v string) { + o.Name = &v +} + +// GetPublicKey returns the PublicKey field value +func (o *Keypair) GetPublicKey() string { + if o == nil { + var ret string + return ret + } + + return o.PublicKey +} + +// GetPublicKeyOk returns a tuple with the PublicKey field value +// and a boolean to check if the value has been set. +func (o *Keypair) GetPublicKeyOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.PublicKey, true +} + +// SetPublicKey sets field value +func (o *Keypair) SetPublicKey(v string) { + o.PublicKey = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Keypair) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Keypair) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Keypair) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Keypair) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Keypair) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Keypair) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Fingerprint) { + toSerialize["fingerprint"] = o.Fingerprint + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + toSerialize["publicKey"] = o.PublicKey + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Keypair) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "publicKey", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varKeypair := _Keypair{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varKeypair) + + if err != nil { + return err + } + + *o = Keypair(varKeypair) + + return err +} + +type NullableKeypair struct { + value *Keypair + isSet bool +} + +func (v NullableKeypair) Get() *Keypair { + return v.value +} + +func (v *NullableKeypair) Set(val *Keypair) { + v.value = val + v.isSet = true +} + +func (v NullableKeypair) IsSet() bool { + return v.isSet +} + +func (v *NullableKeypair) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableKeypair(val *Keypair) *NullableKeypair { + return &NullableKeypair{value: val, isSet: true} +} + +func (v NullableKeypair) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableKeypair) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_machine_type.go b/services/iaas/v2beta1api/model_machine_type.go new file mode 100644 index 000000000..8d58f4b4a --- /dev/null +++ b/services/iaas/v2beta1api/model_machine_type.go @@ -0,0 +1,319 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the MachineType type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MachineType{} + +// MachineType Machine Type. Filterable Fields: `disk`, `extraSpecs`, `name`, `ram`, `vcpus`. +type MachineType struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Size in Gigabyte. + Disk int64 `json:"disk"` + // Properties to control certain aspects or scheduling behavior for an object. + ExtraSpecs map[string]interface{} `json:"extraSpecs,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Megabyte. + Ram int64 `json:"ram"` + // The number of virtual CPUs of a server. + Vcpus int64 `json:"vcpus"` +} + +type _MachineType MachineType + +// NewMachineType instantiates a new MachineType object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMachineType(disk int64, name string, ram int64, vcpus int64) *MachineType { + this := MachineType{} + this.Disk = disk + this.Name = name + this.Ram = ram + this.Vcpus = vcpus + return &this +} + +// NewMachineTypeWithDefaults instantiates a new MachineType object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMachineTypeWithDefaults() *MachineType { + this := MachineType{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *MachineType) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MachineType) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *MachineType) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *MachineType) SetDescription(v string) { + o.Description = &v +} + +// GetDisk returns the Disk field value +func (o *MachineType) GetDisk() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Disk +} + +// GetDiskOk returns a tuple with the Disk field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetDiskOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Disk, true +} + +// SetDisk sets field value +func (o *MachineType) SetDisk(v int64) { + o.Disk = v +} + +// GetExtraSpecs returns the ExtraSpecs field value if set, zero value otherwise. +func (o *MachineType) GetExtraSpecs() map[string]interface{} { + if o == nil || IsNil(o.ExtraSpecs) { + var ret map[string]interface{} + return ret + } + return o.ExtraSpecs +} + +// GetExtraSpecsOk returns a tuple with the ExtraSpecs field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *MachineType) GetExtraSpecsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.ExtraSpecs) { + return map[string]interface{}{}, false + } + return o.ExtraSpecs, true +} + +// HasExtraSpecs returns a boolean if a field has been set. +func (o *MachineType) HasExtraSpecs() bool { + if o != nil && !IsNil(o.ExtraSpecs) { + return true + } + + return false +} + +// SetExtraSpecs gets a reference to the given map[string]interface{} and assigns it to the ExtraSpecs field. +func (o *MachineType) SetExtraSpecs(v map[string]interface{}) { + o.ExtraSpecs = v +} + +// GetName returns the Name field value +func (o *MachineType) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *MachineType) SetName(v string) { + o.Name = v +} + +// GetRam returns the Ram field value +func (o *MachineType) GetRam() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Ram +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetRamOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Ram, true +} + +// SetRam sets field value +func (o *MachineType) SetRam(v int64) { + o.Ram = v +} + +// GetVcpus returns the Vcpus field value +func (o *MachineType) GetVcpus() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Vcpus +} + +// GetVcpusOk returns a tuple with the Vcpus field value +// and a boolean to check if the value has been set. +func (o *MachineType) GetVcpusOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Vcpus, true +} + +// SetVcpus sets field value +func (o *MachineType) SetVcpus(v int64) { + o.Vcpus = v +} + +func (o MachineType) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MachineType) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["disk"] = o.Disk + if !IsNil(o.ExtraSpecs) { + toSerialize["extraSpecs"] = o.ExtraSpecs + } + toSerialize["name"] = o.Name + toSerialize["ram"] = o.Ram + toSerialize["vcpus"] = o.Vcpus + return toSerialize, nil +} + +func (o *MachineType) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "disk", + "name", + "ram", + "vcpus", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMachineType := _MachineType{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMachineType) + + if err != nil { + return err + } + + *o = MachineType(varMachineType) + + return err +} + +type NullableMachineType struct { + value *MachineType + isSet bool +} + +func (v NullableMachineType) Get() *MachineType { + return v.value +} + +func (v *NullableMachineType) Set(val *MachineType) { + v.value = val + v.isSet = true +} + +func (v NullableMachineType) IsSet() bool { + return v.isSet +} + +func (v *NullableMachineType) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMachineType(val *MachineType) *NullableMachineType { + return &NullableMachineType{value: val, isSet: true} +} + +func (v NullableMachineType) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMachineType) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_machine_type_list_response.go b/services/iaas/v2beta1api/model_machine_type_list_response.go new file mode 100644 index 000000000..edf4f042e --- /dev/null +++ b/services/iaas/v2beta1api/model_machine_type_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the MachineTypeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &MachineTypeListResponse{} + +// MachineTypeListResponse Machine type list response. +type MachineTypeListResponse struct { + // Machine type list. + Items []MachineType `json:"items"` +} + +type _MachineTypeListResponse MachineTypeListResponse + +// NewMachineTypeListResponse instantiates a new MachineTypeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewMachineTypeListResponse(items []MachineType) *MachineTypeListResponse { + this := MachineTypeListResponse{} + this.Items = items + return &this +} + +// NewMachineTypeListResponseWithDefaults instantiates a new MachineTypeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewMachineTypeListResponseWithDefaults() *MachineTypeListResponse { + this := MachineTypeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *MachineTypeListResponse) GetItems() []MachineType { + if o == nil { + var ret []MachineType + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *MachineTypeListResponse) GetItemsOk() ([]MachineType, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *MachineTypeListResponse) SetItems(v []MachineType) { + o.Items = v +} + +func (o MachineTypeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o MachineTypeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *MachineTypeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varMachineTypeListResponse := _MachineTypeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varMachineTypeListResponse) + + if err != nil { + return err + } + + *o = MachineTypeListResponse(varMachineTypeListResponse) + + return err +} + +type NullableMachineTypeListResponse struct { + value *MachineTypeListResponse + isSet bool +} + +func (v NullableMachineTypeListResponse) Get() *MachineTypeListResponse { + return v.value +} + +func (v *NullableMachineTypeListResponse) Set(val *MachineTypeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableMachineTypeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableMachineTypeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableMachineTypeListResponse(val *MachineTypeListResponse) *NullableMachineTypeListResponse { + return &NullableMachineTypeListResponse{value: val, isSet: true} +} + +func (v NullableMachineTypeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableMachineTypeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_network.go b/services/iaas/v2beta1api/model_network.go new file mode 100644 index 000000000..0d4d909df --- /dev/null +++ b/services/iaas/v2beta1api/model_network.go @@ -0,0 +1,510 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Network type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Network{} + +// Network Object that represents a network. If no routing table is specified, the default routing table is used. +type Network struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Ipv4 *NetworkIPv4 `json:"ipv4,omitempty"` + Ipv6 *NetworkIPv6 `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Network Network + +// NewNetwork instantiates a new Network object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetwork(id string, name string, status string) *Network { + this := Network{} + this.Id = id + this.Name = name + this.Status = status + return &this +} + +// NewNetworkWithDefaults instantiates a new Network object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkWithDefaults() *Network { + this := Network{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Network) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Network) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Network) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *Network) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *Network) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *Network) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetId returns the Id field value +func (o *Network) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Network) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Network) SetId(v string) { + o.Id = v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *Network) GetIpv4() NetworkIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret NetworkIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetIpv4Ok() (*NetworkIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *Network) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given NetworkIPv4 and assigns it to the Ipv4 field. +func (o *Network) SetIpv4(v NetworkIPv4) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *Network) GetIpv6() NetworkIPv6 { + if o == nil || IsNil(o.Ipv6) { + var ret NetworkIPv6 + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetIpv6Ok() (*NetworkIPv6, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *Network) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given NetworkIPv6 and assigns it to the Ipv6 field. +func (o *Network) SetIpv6(v NetworkIPv6) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Network) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Network) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Network) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *Network) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Network) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Network) SetName(v string) { + o.Name = v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *Network) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *Network) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *Network) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *Network) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *Network) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *Network) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +// GetStatus returns the Status field value +func (o *Network) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Network) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Network) SetStatus(v string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Network) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Network) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Network) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Network) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Network) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + toSerialize["id"] = o.Id + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + toSerialize["status"] = o.Status + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Network) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetwork := _Network{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetwork) + + if err != nil { + return err + } + + *o = Network(varNetwork) + + return err +} + +type NullableNetwork struct { + value *Network + isSet bool +} + +func (v NullableNetwork) Get() *Network { + return v.value +} + +func (v *NullableNetwork) Set(val *Network) { + v.value = val + v.isSet = true +} + +func (v NullableNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetwork(val *Network) *NullableNetwork { + return &NullableNetwork{value: val, isSet: true} +} + +func (v NullableNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_network_area.go b/services/iaas/v2beta1api/model_network_area.go new file mode 100644 index 000000000..da2697468 --- /dev/null +++ b/services/iaas/v2beta1api/model_network_area.go @@ -0,0 +1,343 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the NetworkArea type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkArea{} + +// NetworkArea Object that represents a network area. +type NetworkArea struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name string `json:"name"` + // The amount of projects currently referencing a specific area. + ProjectCount *int64 `json:"projectCount,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _NetworkArea NetworkArea + +// NewNetworkArea instantiates a new NetworkArea object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkArea(name string) *NetworkArea { + this := NetworkArea{} + this.Name = name + return &this +} + +// NewNetworkAreaWithDefaults instantiates a new NetworkArea object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkAreaWithDefaults() *NetworkArea { + this := NetworkArea{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *NetworkArea) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *NetworkArea) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *NetworkArea) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NetworkArea) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkArea) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NetworkArea) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *NetworkArea) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *NetworkArea) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *NetworkArea) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *NetworkArea) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *NetworkArea) SetName(v string) { + o.Name = v +} + +// GetProjectCount returns the ProjectCount field value if set, zero value otherwise. +func (o *NetworkArea) GetProjectCount() int64 { + if o == nil || IsNil(o.ProjectCount) { + var ret int64 + return ret + } + return *o.ProjectCount +} + +// GetProjectCountOk returns a tuple with the ProjectCount field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetProjectCountOk() (*int64, bool) { + if o == nil || IsNil(o.ProjectCount) { + return nil, false + } + return o.ProjectCount, true +} + +// HasProjectCount returns a boolean if a field has been set. +func (o *NetworkArea) HasProjectCount() bool { + if o != nil && !IsNil(o.ProjectCount) { + return true + } + + return false +} + +// SetProjectCount gets a reference to the given int64 and assigns it to the ProjectCount field. +func (o *NetworkArea) SetProjectCount(v int64) { + o.ProjectCount = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *NetworkArea) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkArea) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *NetworkArea) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *NetworkArea) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o NetworkArea) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkArea) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.ProjectCount) { + toSerialize["projectCount"] = o.ProjectCount + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *NetworkArea) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkArea := _NetworkArea{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkArea) + + if err != nil { + return err + } + + *o = NetworkArea(varNetworkArea) + + return err +} + +type NullableNetworkArea struct { + value *NetworkArea + isSet bool +} + +func (v NullableNetworkArea) Get() *NetworkArea { + return v.value +} + +func (v *NullableNetworkArea) Set(val *NetworkArea) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkArea) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkArea) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkArea(val *NetworkArea) *NullableNetworkArea { + return &NullableNetworkArea{value: val, isSet: true} +} + +func (v NullableNetworkArea) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkArea) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_network_area_list_response.go b/services/iaas/v2beta1api/model_network_area_list_response.go new file mode 100644 index 000000000..8b68c59f4 --- /dev/null +++ b/services/iaas/v2beta1api/model_network_area_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkAreaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkAreaListResponse{} + +// NetworkAreaListResponse Network area list response. +type NetworkAreaListResponse struct { + // A list of network areas. + Items []NetworkArea `json:"items"` +} + +type _NetworkAreaListResponse NetworkAreaListResponse + +// NewNetworkAreaListResponse instantiates a new NetworkAreaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkAreaListResponse(items []NetworkArea) *NetworkAreaListResponse { + this := NetworkAreaListResponse{} + this.Items = items + return &this +} + +// NewNetworkAreaListResponseWithDefaults instantiates a new NetworkAreaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkAreaListResponseWithDefaults() *NetworkAreaListResponse { + this := NetworkAreaListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkAreaListResponse) GetItems() []NetworkArea { + if o == nil { + var ret []NetworkArea + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkAreaListResponse) GetItemsOk() ([]NetworkArea, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkAreaListResponse) SetItems(v []NetworkArea) { + o.Items = v +} + +func (o NetworkAreaListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkAreaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkAreaListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkAreaListResponse := _NetworkAreaListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkAreaListResponse) + + if err != nil { + return err + } + + *o = NetworkAreaListResponse(varNetworkAreaListResponse) + + return err +} + +type NullableNetworkAreaListResponse struct { + value *NetworkAreaListResponse + isSet bool +} + +func (v NullableNetworkAreaListResponse) Get() *NetworkAreaListResponse { + return v.value +} + +func (v *NullableNetworkAreaListResponse) Set(val *NetworkAreaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkAreaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkAreaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkAreaListResponse(val *NetworkAreaListResponse) *NullableNetworkAreaListResponse { + return &NullableNetworkAreaListResponse{value: val, isSet: true} +} + +func (v NullableNetworkAreaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkAreaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_network_ipv4.go b/services/iaas/v2beta1api/model_network_ipv4.go new file mode 100644 index 000000000..a14ae5c1e --- /dev/null +++ b/services/iaas/v2beta1api/model_network_ipv4.go @@ -0,0 +1,279 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv4{} + +// NetworkIPv4 Object that represents the IPv4 part of a network. +type NetworkIPv4 struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` + Prefixes []string `json:"prefixes"` + // String that represents an IPv4 address. + PublicIp *string `json:"publicIp,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` +} + +type _NetworkIPv4 NetworkIPv4 + +// NewNetworkIPv4 instantiates a new NetworkIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkIPv4(prefixes []string) *NetworkIPv4 { + this := NetworkIPv4{} + this.Prefixes = prefixes + return &this +} + +// NewNetworkIPv4WithDefaults instantiates a new NetworkIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkIPv4WithDefaults() *NetworkIPv4 { + this := NetworkIPv4{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NetworkIPv4) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkIPv4) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkIPv4) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *NetworkIPv4) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *NetworkIPv4) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *NetworkIPv4) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *NetworkIPv4) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *NetworkIPv4) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *NetworkIPv4) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixes returns the Prefixes field value +func (o *NetworkIPv4) GetPrefixes() []string { + if o == nil { + var ret []string + return ret + } + + return o.Prefixes +} + +// GetPrefixesOk returns a tuple with the Prefixes field value +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetPrefixesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Prefixes, true +} + +// SetPrefixes sets field value +func (o *NetworkIPv4) SetPrefixes(v []string) { + o.Prefixes = v +} + +// GetPublicIp returns the PublicIp field value if set, zero value otherwise. +func (o *NetworkIPv4) GetPublicIp() string { + if o == nil || IsNil(o.PublicIp) { + var ret string + return ret + } + return *o.PublicIp +} + +// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv4) GetPublicIpOk() (*string, bool) { + if o == nil || IsNil(o.PublicIp) { + return nil, false + } + return o.PublicIp, true +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *NetworkIPv4) HasPublicIp() bool { + if o != nil && !IsNil(o.PublicIp) { + return true + } + + return false +} + +// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +func (o *NetworkIPv4) SetPublicIp(v string) { + o.PublicIp = &v +} + +func (o NetworkIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixes"] = o.Prefixes + if !IsNil(o.PublicIp) { + toSerialize["publicIp"] = o.PublicIp + } + return toSerialize, nil +} + +func (o *NetworkIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkIPv4 := _NetworkIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkIPv4) + + if err != nil { + return err + } + + *o = NetworkIPv4(varNetworkIPv4) + + return err +} + +type NullableNetworkIPv4 struct { + value *NetworkIPv4 + isSet bool +} + +func (v NullableNetworkIPv4) Get() *NetworkIPv4 { + return v.value +} + +func (v *NullableNetworkIPv4) Set(val *NetworkIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkIPv4(val *NetworkIPv4) *NullableNetworkIPv4 { + return &NullableNetworkIPv4{value: val, isSet: true} +} + +func (v NullableNetworkIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_network_ipv6.go b/services/iaas/v2beta1api/model_network_ipv6.go new file mode 100644 index 000000000..b386bf01f --- /dev/null +++ b/services/iaas/v2beta1api/model_network_ipv6.go @@ -0,0 +1,242 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkIPv6{} + +// NetworkIPv6 Object that represents the IPv6 part of a network. +type NetworkIPv6 struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` + Prefixes []string `json:"prefixes"` +} + +type _NetworkIPv6 NetworkIPv6 + +// NewNetworkIPv6 instantiates a new NetworkIPv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkIPv6(prefixes []string) *NetworkIPv6 { + this := NetworkIPv6{} + this.Prefixes = prefixes + return &this +} + +// NewNetworkIPv6WithDefaults instantiates a new NetworkIPv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkIPv6WithDefaults() *NetworkIPv6 { + this := NetworkIPv6{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *NetworkIPv6) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *NetworkIPv6) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *NetworkIPv6) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *NetworkIPv6) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *NetworkIPv6) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *NetworkIPv6) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *NetworkIPv6) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkIPv6) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *NetworkIPv6) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *NetworkIPv6) SetNameservers(v []string) { + o.Nameservers = v +} + +// GetPrefixes returns the Prefixes field value +func (o *NetworkIPv6) GetPrefixes() []string { + if o == nil { + var ret []string + return ret + } + + return o.Prefixes +} + +// GetPrefixesOk returns a tuple with the Prefixes field value +// and a boolean to check if the value has been set. +func (o *NetworkIPv6) GetPrefixesOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Prefixes, true +} + +// SetPrefixes sets field value +func (o *NetworkIPv6) SetPrefixes(v []string) { + o.Prefixes = v +} + +func (o NetworkIPv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + toSerialize["prefixes"] = o.Prefixes + return toSerialize, nil +} + +func (o *NetworkIPv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefixes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkIPv6 := _NetworkIPv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkIPv6) + + if err != nil { + return err + } + + *o = NetworkIPv6(varNetworkIPv6) + + return err +} + +type NullableNetworkIPv6 struct { + value *NetworkIPv6 + isSet bool +} + +func (v NullableNetworkIPv6) Get() *NetworkIPv6 { + return v.value +} + +func (v *NullableNetworkIPv6) Set(val *NetworkIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkIPv6(val *NetworkIPv6) *NullableNetworkIPv6 { + return &NullableNetworkIPv6{value: val, isSet: true} +} + +func (v NullableNetworkIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_network_list_response.go b/services/iaas/v2beta1api/model_network_list_response.go new file mode 100644 index 000000000..492930625 --- /dev/null +++ b/services/iaas/v2beta1api/model_network_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkListResponse{} + +// NetworkListResponse Network list response. +type NetworkListResponse struct { + // A list of networks. + Items []Network `json:"items"` +} + +type _NetworkListResponse NetworkListResponse + +// NewNetworkListResponse instantiates a new NetworkListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkListResponse(items []Network) *NetworkListResponse { + this := NetworkListResponse{} + this.Items = items + return &this +} + +// NewNetworkListResponseWithDefaults instantiates a new NetworkListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkListResponseWithDefaults() *NetworkListResponse { + this := NetworkListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkListResponse) GetItems() []Network { + if o == nil { + var ret []Network + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkListResponse) GetItemsOk() ([]Network, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkListResponse) SetItems(v []Network) { + o.Items = v +} + +func (o NetworkListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkListResponse := _NetworkListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkListResponse) + + if err != nil { + return err + } + + *o = NetworkListResponse(varNetworkListResponse) + + return err +} + +type NullableNetworkListResponse struct { + value *NetworkListResponse + isSet bool +} + +func (v NullableNetworkListResponse) Get() *NetworkListResponse { + return v.value +} + +func (v *NullableNetworkListResponse) Set(val *NetworkListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkListResponse(val *NetworkListResponse) *NullableNetworkListResponse { + return &NullableNetworkListResponse{value: val, isSet: true} +} + +func (v NullableNetworkListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_network_range.go b/services/iaas/v2beta1api/model_network_range.go new file mode 100644 index 000000000..f649e54b4 --- /dev/null +++ b/services/iaas/v2beta1api/model_network_range.go @@ -0,0 +1,270 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the NetworkRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkRange{} + +// NetworkRange Object that represents a network range. +type NetworkRange struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Classless Inter-Domain Routing (CIDR). + Prefix string `json:"prefix" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _NetworkRange NetworkRange + +// NewNetworkRange instantiates a new NetworkRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkRange(prefix string) *NetworkRange { + this := NetworkRange{} + this.Prefix = prefix + return &this +} + +// NewNetworkRangeWithDefaults instantiates a new NetworkRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkRangeWithDefaults() *NetworkRange { + this := NetworkRange{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *NetworkRange) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *NetworkRange) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *NetworkRange) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NetworkRange) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NetworkRange) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NetworkRange) SetId(v string) { + o.Id = &v +} + +// GetPrefix returns the Prefix field value +func (o *NetworkRange) GetPrefix() string { + if o == nil { + var ret string + return ret + } + + return o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetPrefixOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Prefix, true +} + +// SetPrefix sets field value +func (o *NetworkRange) SetPrefix(v string) { + o.Prefix = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *NetworkRange) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NetworkRange) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *NetworkRange) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *NetworkRange) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o NetworkRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + toSerialize["prefix"] = o.Prefix + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *NetworkRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "prefix", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkRange := _NetworkRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkRange) + + if err != nil { + return err + } + + *o = NetworkRange(varNetworkRange) + + return err +} + +type NullableNetworkRange struct { + value *NetworkRange + isSet bool +} + +func (v NullableNetworkRange) Get() *NetworkRange { + return v.value +} + +func (v *NullableNetworkRange) Set(val *NetworkRange) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRange) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRange(val *NetworkRange) *NullableNetworkRange { + return &NullableNetworkRange{value: val, isSet: true} +} + +func (v NullableNetworkRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_network_range_list_response.go b/services/iaas/v2beta1api/model_network_range_list_response.go new file mode 100644 index 000000000..bf1ecf971 --- /dev/null +++ b/services/iaas/v2beta1api/model_network_range_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NetworkRangeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NetworkRangeListResponse{} + +// NetworkRangeListResponse Network Range list response. +type NetworkRangeListResponse struct { + // A list of network ranges. + Items []NetworkRange `json:"items"` +} + +type _NetworkRangeListResponse NetworkRangeListResponse + +// NewNetworkRangeListResponse instantiates a new NetworkRangeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNetworkRangeListResponse(items []NetworkRange) *NetworkRangeListResponse { + this := NetworkRangeListResponse{} + this.Items = items + return &this +} + +// NewNetworkRangeListResponseWithDefaults instantiates a new NetworkRangeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNetworkRangeListResponseWithDefaults() *NetworkRangeListResponse { + this := NetworkRangeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NetworkRangeListResponse) GetItems() []NetworkRange { + if o == nil { + var ret []NetworkRange + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NetworkRangeListResponse) GetItemsOk() ([]NetworkRange, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NetworkRangeListResponse) SetItems(v []NetworkRange) { + o.Items = v +} + +func (o NetworkRangeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NetworkRangeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NetworkRangeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNetworkRangeListResponse := _NetworkRangeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNetworkRangeListResponse) + + if err != nil { + return err + } + + *o = NetworkRangeListResponse(varNetworkRangeListResponse) + + return err +} + +type NullableNetworkRangeListResponse struct { + value *NetworkRangeListResponse + isSet bool +} + +func (v NullableNetworkRangeListResponse) Get() *NetworkRangeListResponse { + return v.value +} + +func (v *NullableNetworkRangeListResponse) Set(val *NetworkRangeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNetworkRangeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNetworkRangeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNetworkRangeListResponse(val *NetworkRangeListResponse) *NullableNetworkRangeListResponse { + return &NullableNetworkRangeListResponse{value: val, isSet: true} +} + +func (v NullableNetworkRangeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNetworkRangeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_nexthop_blackhole.go b/services/iaas/v2beta1api/model_nexthop_blackhole.go new file mode 100644 index 000000000..7913f3394 --- /dev/null +++ b/services/iaas/v2beta1api/model_nexthop_blackhole.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopBlackhole type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopBlackhole{} + +// NexthopBlackhole Object that represents a blackhole route. +type NexthopBlackhole struct { + Type string `json:"type"` +} + +type _NexthopBlackhole NexthopBlackhole + +// NewNexthopBlackhole instantiates a new NexthopBlackhole object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopBlackhole(types string) *NexthopBlackhole { + this := NexthopBlackhole{} + this.Type = types + return &this +} + +// NewNexthopBlackholeWithDefaults instantiates a new NexthopBlackhole object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopBlackholeWithDefaults() *NexthopBlackhole { + this := NexthopBlackhole{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopBlackhole) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopBlackhole) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopBlackhole) SetType(v string) { + o.Type = v +} + +func (o NexthopBlackhole) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopBlackhole) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *NexthopBlackhole) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopBlackhole := _NexthopBlackhole{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopBlackhole) + + if err != nil { + return err + } + + *o = NexthopBlackhole(varNexthopBlackhole) + + return err +} + +type NullableNexthopBlackhole struct { + value *NexthopBlackhole + isSet bool +} + +func (v NullableNexthopBlackhole) Get() *NexthopBlackhole { + return v.value +} + +func (v *NullableNexthopBlackhole) Set(val *NexthopBlackhole) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopBlackhole) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopBlackhole) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopBlackhole(val *NexthopBlackhole) *NullableNexthopBlackhole { + return &NullableNexthopBlackhole{value: val, isSet: true} +} + +func (v NullableNexthopBlackhole) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopBlackhole) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_nexthop_internet.go b/services/iaas/v2beta1api/model_nexthop_internet.go new file mode 100644 index 000000000..c3af67e63 --- /dev/null +++ b/services/iaas/v2beta1api/model_nexthop_internet.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopInternet type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopInternet{} + +// NexthopInternet Object that represents a route to the internet. +type NexthopInternet struct { + Type string `json:"type"` +} + +type _NexthopInternet NexthopInternet + +// NewNexthopInternet instantiates a new NexthopInternet object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopInternet(types string) *NexthopInternet { + this := NexthopInternet{} + this.Type = types + return &this +} + +// NewNexthopInternetWithDefaults instantiates a new NexthopInternet object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopInternetWithDefaults() *NexthopInternet { + this := NexthopInternet{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopInternet) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopInternet) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopInternet) SetType(v string) { + o.Type = v +} + +func (o NexthopInternet) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopInternet) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *NexthopInternet) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopInternet := _NexthopInternet{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopInternet) + + if err != nil { + return err + } + + *o = NexthopInternet(varNexthopInternet) + + return err +} + +type NullableNexthopInternet struct { + value *NexthopInternet + isSet bool +} + +func (v NullableNexthopInternet) Get() *NexthopInternet { + return v.value +} + +func (v *NullableNexthopInternet) Set(val *NexthopInternet) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopInternet) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopInternet) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopInternet(val *NexthopInternet) *NullableNexthopInternet { + return &NullableNexthopInternet{value: val, isSet: true} +} + +func (v NullableNexthopInternet) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopInternet) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_nexthop_ipv4.go b/services/iaas/v2beta1api/model_nexthop_ipv4.go new file mode 100644 index 000000000..7f1a66bf7 --- /dev/null +++ b/services/iaas/v2beta1api/model_nexthop_ipv4.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopIPv4{} + +// NexthopIPv4 Object that represents an IPv4 address. +type NexthopIPv4 struct { + Type string `json:"type"` + // An IPv4 address. + Value string `json:"value" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` +} + +type _NexthopIPv4 NexthopIPv4 + +// NewNexthopIPv4 instantiates a new NexthopIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopIPv4(types string, value string) *NexthopIPv4 { + this := NexthopIPv4{} + this.Type = types + this.Value = value + return &this +} + +// NewNexthopIPv4WithDefaults instantiates a new NexthopIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopIPv4WithDefaults() *NexthopIPv4 { + this := NexthopIPv4{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopIPv4) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv4) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopIPv4) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *NexthopIPv4) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv4) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *NexthopIPv4) SetValue(v string) { + o.Value = v +} + +func (o NexthopIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *NexthopIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopIPv4 := _NexthopIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopIPv4) + + if err != nil { + return err + } + + *o = NexthopIPv4(varNexthopIPv4) + + return err +} + +type NullableNexthopIPv4 struct { + value *NexthopIPv4 + isSet bool +} + +func (v NullableNexthopIPv4) Get() *NexthopIPv4 { + return v.value +} + +func (v *NullableNexthopIPv4) Set(val *NexthopIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopIPv4(val *NexthopIPv4) *NullableNexthopIPv4 { + return &NullableNexthopIPv4{value: val, isSet: true} +} + +func (v NullableNexthopIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_nexthop_ipv6.go b/services/iaas/v2beta1api/model_nexthop_ipv6.go new file mode 100644 index 000000000..84450cad4 --- /dev/null +++ b/services/iaas/v2beta1api/model_nexthop_ipv6.go @@ -0,0 +1,186 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NexthopIPv6 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NexthopIPv6{} + +// NexthopIPv6 Object that represents an IPv6 address. +type NexthopIPv6 struct { + Type string `json:"type"` + // An IPv6 address. + Value string `json:"value" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` +} + +type _NexthopIPv6 NexthopIPv6 + +// NewNexthopIPv6 instantiates a new NexthopIPv6 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNexthopIPv6(types string, value string) *NexthopIPv6 { + this := NexthopIPv6{} + this.Type = types + this.Value = value + return &this +} + +// NewNexthopIPv6WithDefaults instantiates a new NexthopIPv6 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNexthopIPv6WithDefaults() *NexthopIPv6 { + this := NexthopIPv6{} + return &this +} + +// GetType returns the Type field value +func (o *NexthopIPv6) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv6) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *NexthopIPv6) SetType(v string) { + o.Type = v +} + +// GetValue returns the Value field value +func (o *NexthopIPv6) GetValue() string { + if o == nil { + var ret string + return ret + } + + return o.Value +} + +// GetValueOk returns a tuple with the Value field value +// and a boolean to check if the value has been set. +func (o *NexthopIPv6) GetValueOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Value, true +} + +// SetValue sets field value +func (o *NexthopIPv6) SetValue(v string) { + o.Value = v +} + +func (o NexthopIPv6) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NexthopIPv6) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["type"] = o.Type + toSerialize["value"] = o.Value + return toSerialize, nil +} + +func (o *NexthopIPv6) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "type", + "value", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNexthopIPv6 := _NexthopIPv6{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNexthopIPv6) + + if err != nil { + return err + } + + *o = NexthopIPv6(varNexthopIPv6) + + return err +} + +type NullableNexthopIPv6 struct { + value *NexthopIPv6 + isSet bool +} + +func (v NullableNexthopIPv6) Get() *NexthopIPv6 { + return v.value +} + +func (v *NullableNexthopIPv6) Set(val *NexthopIPv6) { + v.value = val + v.isSet = true +} + +func (v NullableNexthopIPv6) IsSet() bool { + return v.isSet +} + +func (v *NullableNexthopIPv6) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNexthopIPv6(val *NexthopIPv6) *NullableNexthopIPv6 { + return &NullableNexthopIPv6{value: val, isSet: true} +} + +func (v NullableNexthopIPv6) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNexthopIPv6) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_nic.go b/services/iaas/v2beta1api/model_nic.go new file mode 100644 index 000000000..ea2c1b1fc --- /dev/null +++ b/services/iaas/v2beta1api/model_nic.go @@ -0,0 +1,611 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the NIC type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NIC{} + +// NIC Object that represents a network interface. +type NIC struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Device *string `json:"device,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents an MAC address. + Mac *string `json:"mac,omitempty" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NetworkId *string `json:"networkId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` + // Possible values: `ACTIVE`, `DOWN`. + Status *string `json:"status,omitempty"` + // Possible values: `server`, `metadata`, `gateway`, `none`. + Type *string `json:"type,omitempty"` +} + +// NewNIC instantiates a new NIC object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNIC() *NIC { + this := NIC{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// NewNICWithDefaults instantiates a new NIC object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNICWithDefaults() *NIC { + this := NIC{} + var nicSecurity bool = true + this.NicSecurity = &nicSecurity + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *NIC) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *NIC) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *NIC) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *NIC) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *NIC) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *NIC) SetDescription(v string) { + o.Description = &v +} + +// GetDevice returns the Device field value if set, zero value otherwise. +func (o *NIC) GetDevice() string { + if o == nil || IsNil(o.Device) { + var ret string + return ret + } + return *o.Device +} + +// GetDeviceOk returns a tuple with the Device field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetDeviceOk() (*string, bool) { + if o == nil || IsNil(o.Device) { + return nil, false + } + return o.Device, true +} + +// HasDevice returns a boolean if a field has been set. +func (o *NIC) HasDevice() bool { + if o != nil && !IsNil(o.Device) { + return true + } + + return false +} + +// SetDevice gets a reference to the given string and assigns it to the Device field. +func (o *NIC) SetDevice(v string) { + o.Device = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *NIC) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *NIC) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *NIC) SetId(v string) { + o.Id = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *NIC) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *NIC) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *NIC) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *NIC) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *NIC) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *NIC) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *NIC) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *NIC) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *NIC) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMac returns the Mac field value if set, zero value otherwise. +func (o *NIC) GetMac() string { + if o == nil || IsNil(o.Mac) { + var ret string + return ret + } + return *o.Mac +} + +// GetMacOk returns a tuple with the Mac field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetMacOk() (*string, bool) { + if o == nil || IsNil(o.Mac) { + return nil, false + } + return o.Mac, true +} + +// HasMac returns a boolean if a field has been set. +func (o *NIC) HasMac() bool { + if o != nil && !IsNil(o.Mac) { + return true + } + + return false +} + +// SetMac gets a reference to the given string and assigns it to the Mac field. +func (o *NIC) SetMac(v string) { + o.Mac = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *NIC) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *NIC) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *NIC) SetName(v string) { + o.Name = &v +} + +// GetNetworkId returns the NetworkId field value if set, zero value otherwise. +func (o *NIC) GetNetworkId() string { + if o == nil || IsNil(o.NetworkId) { + var ret string + return ret + } + return *o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNetworkIdOk() (*string, bool) { + if o == nil || IsNil(o.NetworkId) { + return nil, false + } + return o.NetworkId, true +} + +// HasNetworkId returns a boolean if a field has been set. +func (o *NIC) HasNetworkId() bool { + if o != nil && !IsNil(o.NetworkId) { + return true + } + + return false +} + +// SetNetworkId gets a reference to the given string and assigns it to the NetworkId field. +func (o *NIC) SetNetworkId(v string) { + o.NetworkId = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *NIC) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *NIC) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *NIC) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *NIC) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *NIC) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *NIC) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *NIC) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *NIC) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *NIC) SetStatus(v string) { + o.Status = &v +} + +// GetType returns the Type field value if set, zero value otherwise. +func (o *NIC) GetType() string { + if o == nil || IsNil(o.Type) { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NIC) GetTypeOk() (*string, bool) { + if o == nil || IsNil(o.Type) { + return nil, false + } + return o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *NIC) HasType() bool { + if o != nil && !IsNil(o.Type) { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *NIC) SetType(v string) { + o.Type = &v +} + +func (o NIC) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NIC) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Device) { + toSerialize["device"] = o.Device + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Mac) { + toSerialize["mac"] = o.Mac + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NetworkId) { + toSerialize["networkId"] = o.NetworkId + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Type) { + toSerialize["type"] = o.Type + } + return toSerialize, nil +} + +type NullableNIC struct { + value *NIC + isSet bool +} + +func (v NullableNIC) Get() *NIC { + return v.value +} + +func (v *NullableNIC) Set(val *NIC) { + v.value = val + v.isSet = true +} + +func (v NullableNIC) IsSet() bool { + return v.isSet +} + +func (v *NullableNIC) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNIC(val *NIC) *NullableNIC { + return &NullableNIC{value: val, isSet: true} +} + +func (v NullableNIC) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNIC) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_nic_list_response.go b/services/iaas/v2beta1api/model_nic_list_response.go new file mode 100644 index 000000000..49d3bd30b --- /dev/null +++ b/services/iaas/v2beta1api/model_nic_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the NICListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NICListResponse{} + +// NICListResponse NIC list response. +type NICListResponse struct { + // A list of network interfaces. + Items []NIC `json:"items"` +} + +type _NICListResponse NICListResponse + +// NewNICListResponse instantiates a new NICListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNICListResponse(items []NIC) *NICListResponse { + this := NICListResponse{} + this.Items = items + return &this +} + +// NewNICListResponseWithDefaults instantiates a new NICListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNICListResponseWithDefaults() *NICListResponse { + this := NICListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *NICListResponse) GetItems() []NIC { + if o == nil { + var ret []NIC + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *NICListResponse) GetItemsOk() ([]NIC, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *NICListResponse) SetItems(v []NIC) { + o.Items = v +} + +func (o NICListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NICListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *NICListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varNICListResponse := _NICListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varNICListResponse) + + if err != nil { + return err + } + + *o = NICListResponse(varNICListResponse) + + return err +} + +type NullableNICListResponse struct { + value *NICListResponse + isSet bool +} + +func (v NullableNICListResponse) Get() *NICListResponse { + return v.value +} + +func (v *NullableNICListResponse) Set(val *NICListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNICListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNICListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNICListResponse(val *NICListResponse) *NullableNICListResponse { + return &NullableNICListResponse{value: val, isSet: true} +} + +func (v NullableNICListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNICListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_partial_update_network_area_payload.go b/services/iaas/v2beta1api/model_partial_update_network_area_payload.go new file mode 100644 index 000000000..009f1c30c --- /dev/null +++ b/services/iaas/v2beta1api/model_partial_update_network_area_payload.go @@ -0,0 +1,162 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateNetworkAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkAreaPayload{} + +// PartialUpdateNetworkAreaPayload Object that represents the network area update request. +type PartialUpdateNetworkAreaPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Name *string `json:"name,omitempty"` +} + +// NewPartialUpdateNetworkAreaPayload instantiates a new PartialUpdateNetworkAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateNetworkAreaPayload() *PartialUpdateNetworkAreaPayload { + this := PartialUpdateNetworkAreaPayload{} + return &this +} + +// NewPartialUpdateNetworkAreaPayloadWithDefaults instantiates a new PartialUpdateNetworkAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateNetworkAreaPayloadWithDefaults() *PartialUpdateNetworkAreaPayload { + this := PartialUpdateNetworkAreaPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkAreaPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkAreaPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkAreaPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkAreaPayload) SetName(v string) { + o.Name = &v +} + +func (o PartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateNetworkAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkAreaPayload struct { + value *PartialUpdateNetworkAreaPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkAreaPayload) Get() *PartialUpdateNetworkAreaPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkAreaPayload) Set(val *PartialUpdateNetworkAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkAreaPayload(val *PartialUpdateNetworkAreaPayload) *NullablePartialUpdateNetworkAreaPayload { + return &NullablePartialUpdateNetworkAreaPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_partial_update_network_payload.go b/services/iaas/v2beta1api/model_partial_update_network_payload.go new file mode 100644 index 000000000..4e3730478 --- /dev/null +++ b/services/iaas/v2beta1api/model_partial_update_network_payload.go @@ -0,0 +1,346 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the PartialUpdateNetworkPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PartialUpdateNetworkPayload{} + +// PartialUpdateNetworkPayload Object that represents the request body for a network update. +type PartialUpdateNetworkPayload struct { + // Enable or disable DHCP for a network. + Dhcp *bool `json:"dhcp,omitempty"` + Ipv4 *UpdateNetworkIPv4Body `json:"ipv4,omitempty"` + Ipv6 *UpdateNetworkIPv6Body `json:"ipv6,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Shows if the network is routed and therefore accessible from other networks. + Routed *bool `json:"routed,omitempty"` + // Universally Unique Identifier (UUID). + RoutingTableId *string `json:"routingTableId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewPartialUpdateNetworkPayload instantiates a new PartialUpdateNetworkPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPartialUpdateNetworkPayload() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// NewPartialUpdateNetworkPayloadWithDefaults instantiates a new PartialUpdateNetworkPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPartialUpdateNetworkPayloadWithDefaults() *PartialUpdateNetworkPayload { + this := PartialUpdateNetworkPayload{} + return &this +} + +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetDhcp() bool { + if o == nil || IsNil(o.Dhcp) { + var ret bool + return ret + } + return *o.Dhcp +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetDhcpOk() (*bool, bool) { + if o == nil || IsNil(o.Dhcp) { + return nil, false + } + return o.Dhcp, true +} + +// HasDhcp returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasDhcp() bool { + if o != nil && !IsNil(o.Dhcp) { + return true + } + + return false +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *PartialUpdateNetworkPayload) SetDhcp(v bool) { + o.Dhcp = &v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetIpv4() UpdateNetworkIPv4Body { + if o == nil || IsNil(o.Ipv4) { + var ret UpdateNetworkIPv4Body + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetIpv4Ok() (*UpdateNetworkIPv4Body, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given UpdateNetworkIPv4Body and assigns it to the Ipv4 field. +func (o *PartialUpdateNetworkPayload) SetIpv4(v UpdateNetworkIPv4Body) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetIpv6() UpdateNetworkIPv6Body { + if o == nil || IsNil(o.Ipv6) { + var ret UpdateNetworkIPv6Body + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetIpv6Ok() (*UpdateNetworkIPv6Body, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given UpdateNetworkIPv6Body and assigns it to the Ipv6 field. +func (o *PartialUpdateNetworkPayload) SetIpv6(v UpdateNetworkIPv6Body) { + o.Ipv6 = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PartialUpdateNetworkPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *PartialUpdateNetworkPayload) SetName(v string) { + o.Name = &v +} + +// GetRouted returns the Routed field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRouted() bool { + if o == nil || IsNil(o.Routed) { + var ret bool + return ret + } + return *o.Routed +} + +// GetRoutedOk returns a tuple with the Routed field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutedOk() (*bool, bool) { + if o == nil || IsNil(o.Routed) { + return nil, false + } + return o.Routed, true +} + +// HasRouted returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRouted() bool { + if o != nil && !IsNil(o.Routed) { + return true + } + + return false +} + +// SetRouted gets a reference to the given bool and assigns it to the Routed field. +func (o *PartialUpdateNetworkPayload) SetRouted(v bool) { + o.Routed = &v +} + +// GetRoutingTableId returns the RoutingTableId field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetRoutingTableId() string { + if o == nil || IsNil(o.RoutingTableId) { + var ret string + return ret + } + return *o.RoutingTableId +} + +// GetRoutingTableIdOk returns a tuple with the RoutingTableId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetRoutingTableIdOk() (*string, bool) { + if o == nil || IsNil(o.RoutingTableId) { + return nil, false + } + return o.RoutingTableId, true +} + +// HasRoutingTableId returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasRoutingTableId() bool { + if o != nil && !IsNil(o.RoutingTableId) { + return true + } + + return false +} + +// SetRoutingTableId gets a reference to the given string and assigns it to the RoutingTableId field. +func (o *PartialUpdateNetworkPayload) SetRoutingTableId(v string) { + o.RoutingTableId = &v +} + +func (o PartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Dhcp) { + toSerialize["dhcp"] = o.Dhcp + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Routed) { + toSerialize["routed"] = o.Routed + } + if !IsNil(o.RoutingTableId) { + toSerialize["routingTableId"] = o.RoutingTableId + } + return toSerialize, nil +} + +type NullablePartialUpdateNetworkPayload struct { + value *PartialUpdateNetworkPayload + isSet bool +} + +func (v NullablePartialUpdateNetworkPayload) Get() *PartialUpdateNetworkPayload { + return v.value +} + +func (v *NullablePartialUpdateNetworkPayload) Set(val *PartialUpdateNetworkPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePartialUpdateNetworkPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePartialUpdateNetworkPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePartialUpdateNetworkPayload(val *PartialUpdateNetworkPayload) *NullablePartialUpdateNetworkPayload { + return &NullablePartialUpdateNetworkPayload{value: val, isSet: true} +} + +func (v NullablePartialUpdateNetworkPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePartialUpdateNetworkPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_port_range.go b/services/iaas/v2beta1api/model_port_range.go new file mode 100644 index 000000000..c53cffb27 --- /dev/null +++ b/services/iaas/v2beta1api/model_port_range.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PortRange type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PortRange{} + +// PortRange Object that represents a range of ports. +type PortRange struct { + // The maximum port number. Should be greater or equal to the minimum. + Max int64 `json:"max"` + // The minimum port number. Should be less or equal to the maximum. + Min int64 `json:"min"` +} + +type _PortRange PortRange + +// NewPortRange instantiates a new PortRange object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPortRange(max int64, min int64) *PortRange { + this := PortRange{} + this.Max = max + this.Min = min + return &this +} + +// NewPortRangeWithDefaults instantiates a new PortRange object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPortRangeWithDefaults() *PortRange { + this := PortRange{} + return &this +} + +// GetMax returns the Max field value +func (o *PortRange) GetMax() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Max +} + +// GetMaxOk returns a tuple with the Max field value +// and a boolean to check if the value has been set. +func (o *PortRange) GetMaxOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Max, true +} + +// SetMax sets field value +func (o *PortRange) SetMax(v int64) { + o.Max = v +} + +// GetMin returns the Min field value +func (o *PortRange) GetMin() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Min +} + +// GetMinOk returns a tuple with the Min field value +// and a boolean to check if the value has been set. +func (o *PortRange) GetMinOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Min, true +} + +// SetMin sets field value +func (o *PortRange) SetMin(v int64) { + o.Min = v +} + +func (o PortRange) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PortRange) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["max"] = o.Max + toSerialize["min"] = o.Min + return toSerialize, nil +} + +func (o *PortRange) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "max", + "min", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPortRange := _PortRange{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPortRange) + + if err != nil { + return err + } + + *o = PortRange(varPortRange) + + return err +} + +type NullablePortRange struct { + value *PortRange + isSet bool +} + +func (v NullablePortRange) Get() *PortRange { + return v.value +} + +func (v *NullablePortRange) Set(val *PortRange) { + v.value = val + v.isSet = true +} + +func (v NullablePortRange) IsSet() bool { + return v.isSet +} + +func (v *NullablePortRange) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePortRange(val *PortRange) *NullablePortRange { + return &NullablePortRange{value: val, isSet: true} +} + +func (v NullablePortRange) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePortRange) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_project.go b/services/iaas/v2beta1api/model_project.go new file mode 100644 index 000000000..d9409d095 --- /dev/null +++ b/services/iaas/v2beta1api/model_project.go @@ -0,0 +1,326 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Project type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Project{} + +// Project Object that represents a STACKIT project. +type Project struct { + AreaId AreaId `json:"areaId"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + InternetAccess *bool `json:"internetAccess,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Project Project + +// NewProject instantiates a new Project object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProject(areaId AreaId, id string, status string) *Project { + this := Project{} + this.AreaId = areaId + this.Id = id + this.Status = status + return &this +} + +// NewProjectWithDefaults instantiates a new Project object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectWithDefaults() *Project { + this := Project{} + return &this +} + +// GetAreaId returns the AreaId field value +func (o *Project) GetAreaId() AreaId { + if o == nil { + var ret AreaId + return ret + } + + return o.AreaId +} + +// GetAreaIdOk returns a tuple with the AreaId field value +// and a boolean to check if the value has been set. +func (o *Project) GetAreaIdOk() (*AreaId, bool) { + if o == nil { + return nil, false + } + return &o.AreaId, true +} + +// SetAreaId sets field value +func (o *Project) SetAreaId(v AreaId) { + o.AreaId = v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Project) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Project) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Project) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value +func (o *Project) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Project) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Project) SetId(v string) { + o.Id = v +} + +// GetInternetAccess returns the InternetAccess field value if set, zero value otherwise. +func (o *Project) GetInternetAccess() bool { + if o == nil || IsNil(o.InternetAccess) { + var ret bool + return ret + } + return *o.InternetAccess +} + +// GetInternetAccessOk returns a tuple with the InternetAccess field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetInternetAccessOk() (*bool, bool) { + if o == nil || IsNil(o.InternetAccess) { + return nil, false + } + return o.InternetAccess, true +} + +// HasInternetAccess returns a boolean if a field has been set. +func (o *Project) HasInternetAccess() bool { + if o != nil && !IsNil(o.InternetAccess) { + return true + } + + return false +} + +// SetInternetAccess gets a reference to the given bool and assigns it to the InternetAccess field. +func (o *Project) SetInternetAccess(v bool) { + o.InternetAccess = &v +} + +// GetStatus returns the Status field value +func (o *Project) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Project) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Project) SetStatus(v string) { + o.Status = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Project) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Project) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Project) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Project) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Project) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Project) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["areaId"] = o.AreaId + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["id"] = o.Id + if !IsNil(o.InternetAccess) { + toSerialize["internetAccess"] = o.InternetAccess + } + toSerialize["status"] = o.Status + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Project) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "areaId", + "id", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProject := _Project{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProject) + + if err != nil { + return err + } + + *o = Project(varProject) + + return err +} + +type NullableProject struct { + value *Project + isSet bool +} + +func (v NullableProject) Get() *Project { + return v.value +} + +func (v *NullableProject) Set(val *Project) { + v.value = val + v.isSet = true +} + +func (v NullableProject) IsSet() bool { + return v.isSet +} + +func (v *NullableProject) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProject(val *Project) *NullableProject { + return &NullableProject{value: val, isSet: true} +} + +func (v NullableProject) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProject) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_project_list_response.go b/services/iaas/v2beta1api/model_project_list_response.go new file mode 100644 index 000000000..0558a49dd --- /dev/null +++ b/services/iaas/v2beta1api/model_project_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ProjectListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ProjectListResponse{} + +// ProjectListResponse Project list response. +type ProjectListResponse struct { + // A list of STACKIT projects. + Items []string `json:"items"` +} + +type _ProjectListResponse ProjectListResponse + +// NewProjectListResponse instantiates a new ProjectListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProjectListResponse(items []string) *ProjectListResponse { + this := ProjectListResponse{} + this.Items = items + return &this +} + +// NewProjectListResponseWithDefaults instantiates a new ProjectListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProjectListResponseWithDefaults() *ProjectListResponse { + this := ProjectListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ProjectListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ProjectListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ProjectListResponse) SetItems(v []string) { + o.Items = v +} + +func (o ProjectListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ProjectListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ProjectListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varProjectListResponse := _ProjectListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varProjectListResponse) + + if err != nil { + return err + } + + *o = ProjectListResponse(varProjectListResponse) + + return err +} + +type NullableProjectListResponse struct { + value *ProjectListResponse + isSet bool +} + +func (v NullableProjectListResponse) Get() *ProjectListResponse { + return v.value +} + +func (v *NullableProjectListResponse) Set(val *ProjectListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableProjectListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableProjectListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProjectListResponse(val *ProjectListResponse) *NullableProjectListResponse { + return &NullableProjectListResponse{value: val, isSet: true} +} + +func (v NullableProjectListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProjectListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_protocol.go b/services/iaas/v2beta1api/model_protocol.go new file mode 100644 index 000000000..692973512 --- /dev/null +++ b/services/iaas/v2beta1api/model_protocol.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the Protocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Protocol{} + +// Protocol The schema for a protocol of a security group rule. +type Protocol struct { + // The protocol name which the rule should match. Possible values: `ah`, `dccp`, `egp`, `esp`, `gre`, `icmp`, `igmp`, `ipip`, `ipv6-encap`, `ipv6-frag`, `ipv6-icmp`, `ipv6-nonxt`, `ipv6-opts`, `ipv6-route`, `ospf`, `pgm`, `rsvp`, `sctp`, `tcp`, `udp`, `udplite`, `vrrp`. + Name *string `json:"name,omitempty"` + // The protocol number which the rule should match. + Number *int64 `json:"number,omitempty"` +} + +// NewProtocol instantiates a new Protocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewProtocol() *Protocol { + this := Protocol{} + return &this +} + +// NewProtocolWithDefaults instantiates a new Protocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewProtocolWithDefaults() *Protocol { + this := Protocol{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Protocol) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Protocol) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Protocol) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Protocol) SetName(v string) { + o.Name = &v +} + +// GetNumber returns the Number field value if set, zero value otherwise. +func (o *Protocol) GetNumber() int64 { + if o == nil || IsNil(o.Number) { + var ret int64 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Protocol) GetNumberOk() (*int64, bool) { + if o == nil || IsNil(o.Number) { + return nil, false + } + return o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *Protocol) HasNumber() bool { + if o != nil && !IsNil(o.Number) { + return true + } + + return false +} + +// SetNumber gets a reference to the given int64 and assigns it to the Number field. +func (o *Protocol) SetNumber(v int64) { + o.Number = &v +} + +func (o Protocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Protocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Number) { + toSerialize["number"] = o.Number + } + return toSerialize, nil +} + +type NullableProtocol struct { + value *Protocol + isSet bool +} + +func (v NullableProtocol) Get() *Protocol { + return v.value +} + +func (v *NullableProtocol) Set(val *Protocol) { + v.value = val + v.isSet = true +} + +func (v NullableProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableProtocol(val *Protocol) *NullableProtocol { + return &NullableProtocol{value: val, isSet: true} +} + +func (v NullableProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_public_ip.go b/services/iaas/v2beta1api/model_public_ip.go new file mode 100644 index 000000000..bf9b563b4 --- /dev/null +++ b/services/iaas/v2beta1api/model_public_ip.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the PublicIp type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicIp{} + +// PublicIp Object that represents a public IP. +type PublicIp struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // String that represents an IPv4 address. + Ip *string `json:"ip,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewPublicIp instantiates a new PublicIp object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicIp() *PublicIp { + this := PublicIp{} + return &this +} + +// NewPublicIpWithDefaults instantiates a new PublicIp object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicIpWithDefaults() *PublicIp { + this := PublicIp{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *PublicIp) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *PublicIp) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *PublicIp) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *PublicIp) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *PublicIp) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *PublicIp) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *PublicIp) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PublicIp) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *PublicIp) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *PublicIp) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PublicIp) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PublicIp) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *PublicIp) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *PublicIp) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *PublicIp) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *PublicIp) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o PublicIp) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicIp) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullablePublicIp struct { + value *PublicIp + isSet bool +} + +func (v NullablePublicIp) Get() *PublicIp { + return v.value +} + +func (v *NullablePublicIp) Set(val *PublicIp) { + v.value = val + v.isSet = true +} + +func (v NullablePublicIp) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicIp) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicIp(val *PublicIp) *NullablePublicIp { + return &NullablePublicIp{value: val, isSet: true} +} + +func (v NullablePublicIp) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicIp) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_public_ip_list_response.go b/services/iaas/v2beta1api/model_public_ip_list_response.go new file mode 100644 index 000000000..a1f695955 --- /dev/null +++ b/services/iaas/v2beta1api/model_public_ip_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicIpListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicIpListResponse{} + +// PublicIpListResponse Public IP list response. +type PublicIpListResponse struct { + // A list of public IPs. + Items []PublicIp `json:"items"` +} + +type _PublicIpListResponse PublicIpListResponse + +// NewPublicIpListResponse instantiates a new PublicIpListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicIpListResponse(items []PublicIp) *PublicIpListResponse { + this := PublicIpListResponse{} + this.Items = items + return &this +} + +// NewPublicIpListResponseWithDefaults instantiates a new PublicIpListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicIpListResponseWithDefaults() *PublicIpListResponse { + this := PublicIpListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *PublicIpListResponse) GetItems() []PublicIp { + if o == nil { + var ret []PublicIp + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *PublicIpListResponse) GetItemsOk() ([]PublicIp, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *PublicIpListResponse) SetItems(v []PublicIp) { + o.Items = v +} + +func (o PublicIpListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicIpListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *PublicIpListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicIpListResponse := _PublicIpListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicIpListResponse) + + if err != nil { + return err + } + + *o = PublicIpListResponse(varPublicIpListResponse) + + return err +} + +type NullablePublicIpListResponse struct { + value *PublicIpListResponse + isSet bool +} + +func (v NullablePublicIpListResponse) Get() *PublicIpListResponse { + return v.value +} + +func (v *NullablePublicIpListResponse) Set(val *PublicIpListResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePublicIpListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicIpListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicIpListResponse(val *PublicIpListResponse) *NullablePublicIpListResponse { + return &NullablePublicIpListResponse{value: val, isSet: true} +} + +func (v NullablePublicIpListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicIpListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_public_network.go b/services/iaas/v2beta1api/model_public_network.go new file mode 100644 index 000000000..3d02dfd8c --- /dev/null +++ b/services/iaas/v2beta1api/model_public_network.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicNetwork{} + +// PublicNetwork Public network. +type PublicNetwork struct { + // Classless Inter-Domain Routing (CIDR). + Cidr string `json:"cidr" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + // Name of the region. + Region string `json:"region"` +} + +type _PublicNetwork PublicNetwork + +// NewPublicNetwork instantiates a new PublicNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicNetwork(cidr string, region string) *PublicNetwork { + this := PublicNetwork{} + this.Cidr = cidr + this.Region = region + return &this +} + +// NewPublicNetworkWithDefaults instantiates a new PublicNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicNetworkWithDefaults() *PublicNetwork { + this := PublicNetwork{} + return &this +} + +// GetCidr returns the Cidr field value +func (o *PublicNetwork) GetCidr() string { + if o == nil { + var ret string + return ret + } + + return o.Cidr +} + +// GetCidrOk returns a tuple with the Cidr field value +// and a boolean to check if the value has been set. +func (o *PublicNetwork) GetCidrOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Cidr, true +} + +// SetCidr sets field value +func (o *PublicNetwork) SetCidr(v string) { + o.Cidr = v +} + +// GetRegion returns the Region field value +func (o *PublicNetwork) GetRegion() string { + if o == nil { + var ret string + return ret + } + + return o.Region +} + +// GetRegionOk returns a tuple with the Region field value +// and a boolean to check if the value has been set. +func (o *PublicNetwork) GetRegionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Region, true +} + +// SetRegion sets field value +func (o *PublicNetwork) SetRegion(v string) { + o.Region = v +} + +func (o PublicNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["cidr"] = o.Cidr + toSerialize["region"] = o.Region + return toSerialize, nil +} + +func (o *PublicNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "cidr", + "region", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicNetwork := _PublicNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicNetwork) + + if err != nil { + return err + } + + *o = PublicNetwork(varPublicNetwork) + + return err +} + +type NullablePublicNetwork struct { + value *PublicNetwork + isSet bool +} + +func (v NullablePublicNetwork) Get() *PublicNetwork { + return v.value +} + +func (v *NullablePublicNetwork) Set(val *PublicNetwork) { + v.value = val + v.isSet = true +} + +func (v NullablePublicNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicNetwork(val *PublicNetwork) *NullablePublicNetwork { + return &NullablePublicNetwork{value: val, isSet: true} +} + +func (v NullablePublicNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_public_network_list_response.go b/services/iaas/v2beta1api/model_public_network_list_response.go new file mode 100644 index 000000000..b028392d3 --- /dev/null +++ b/services/iaas/v2beta1api/model_public_network_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PublicNetworkListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PublicNetworkListResponse{} + +// PublicNetworkListResponse Public network list response. +type PublicNetworkListResponse struct { + // A list of public networks. + Items []PublicNetwork `json:"items"` +} + +type _PublicNetworkListResponse PublicNetworkListResponse + +// NewPublicNetworkListResponse instantiates a new PublicNetworkListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPublicNetworkListResponse(items []PublicNetwork) *PublicNetworkListResponse { + this := PublicNetworkListResponse{} + this.Items = items + return &this +} + +// NewPublicNetworkListResponseWithDefaults instantiates a new PublicNetworkListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPublicNetworkListResponseWithDefaults() *PublicNetworkListResponse { + this := PublicNetworkListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *PublicNetworkListResponse) GetItems() []PublicNetwork { + if o == nil { + var ret []PublicNetwork + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *PublicNetworkListResponse) GetItemsOk() ([]PublicNetwork, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *PublicNetworkListResponse) SetItems(v []PublicNetwork) { + o.Items = v +} + +func (o PublicNetworkListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PublicNetworkListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *PublicNetworkListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPublicNetworkListResponse := _PublicNetworkListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPublicNetworkListResponse) + + if err != nil { + return err + } + + *o = PublicNetworkListResponse(varPublicNetworkListResponse) + + return err +} + +type NullablePublicNetworkListResponse struct { + value *PublicNetworkListResponse + isSet bool +} + +func (v NullablePublicNetworkListResponse) Get() *PublicNetworkListResponse { + return v.value +} + +func (v *NullablePublicNetworkListResponse) Set(val *PublicNetworkListResponse) { + v.value = val + v.isSet = true +} + +func (v NullablePublicNetworkListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullablePublicNetworkListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePublicNetworkListResponse(val *PublicNetworkListResponse) *NullablePublicNetworkListResponse { + return &NullablePublicNetworkListResponse{value: val, isSet: true} +} + +func (v NullablePublicNetworkListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePublicNetworkListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_quota.go b/services/iaas/v2beta1api/model_quota.go new file mode 100644 index 000000000..014c18f89 --- /dev/null +++ b/services/iaas/v2beta1api/model_quota.go @@ -0,0 +1,185 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Quota type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Quota{} + +// Quota Object that represents a single resource quota. +type Quota struct { + Limit int64 `json:"limit"` + Usage int64 `json:"usage"` +} + +type _Quota Quota + +// NewQuota instantiates a new Quota object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuota(limit int64, usage int64) *Quota { + this := Quota{} + this.Limit = limit + this.Usage = usage + return &this +} + +// NewQuotaWithDefaults instantiates a new Quota object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaWithDefaults() *Quota { + this := Quota{} + return &this +} + +// GetLimit returns the Limit field value +func (o *Quota) GetLimit() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Limit +} + +// GetLimitOk returns a tuple with the Limit field value +// and a boolean to check if the value has been set. +func (o *Quota) GetLimitOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Limit, true +} + +// SetLimit sets field value +func (o *Quota) SetLimit(v int64) { + o.Limit = v +} + +// GetUsage returns the Usage field value +func (o *Quota) GetUsage() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Usage +} + +// GetUsageOk returns a tuple with the Usage field value +// and a boolean to check if the value has been set. +func (o *Quota) GetUsageOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Usage, true +} + +// SetUsage sets field value +func (o *Quota) SetUsage(v int64) { + o.Usage = v +} + +func (o Quota) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Quota) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["limit"] = o.Limit + toSerialize["usage"] = o.Usage + return toSerialize, nil +} + +func (o *Quota) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "limit", + "usage", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuota := _Quota{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuota) + + if err != nil { + return err + } + + *o = Quota(varQuota) + + return err +} + +type NullableQuota struct { + value *Quota + isSet bool +} + +func (v NullableQuota) Get() *Quota { + return v.value +} + +func (v *NullableQuota) Set(val *Quota) { + v.value = val + v.isSet = true +} + +func (v NullableQuota) IsSet() bool { + return v.isSet +} + +func (v *NullableQuota) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuota(val *Quota) *NullableQuota { + return &NullableQuota{value: val, isSet: true} +} + +func (v NullableQuota) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuota) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_quota_list.go b/services/iaas/v2beta1api/model_quota_list.go new file mode 100644 index 000000000..e4143ece0 --- /dev/null +++ b/services/iaas/v2beta1api/model_quota_list.go @@ -0,0 +1,477 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the QuotaList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaList{} + +// QuotaList Object that represents the quotas for a project. +type QuotaList struct { + // Total size in GiB of backups. + BackupGigabytes Quota `json:"backupGigabytes"` + // Number of backups. + Backups Quota `json:"backups"` + // Total size in GiB of volumes and snapshots. + Gigabytes Quota `json:"gigabytes"` + // Number of networks. + Networks Quota `json:"networks"` + // Number of network interfaces. + Nics Quota `json:"nics"` + // Number of public IP addresses. + PublicIps Quota `json:"publicIps"` + // Amount of server RAM in MiB. + Ram Quota `json:"ram"` + // Number of security group rules. + SecurityGroupRules Quota `json:"securityGroupRules"` + // Number of security groups. + SecurityGroups Quota `json:"securityGroups"` + // Number of snapshots. + Snapshots Quota `json:"snapshots"` + // Number of server cores. + Vcpu Quota `json:"vcpu"` + // Number of volumes. + Volumes Quota `json:"volumes"` +} + +type _QuotaList QuotaList + +// NewQuotaList instantiates a new QuotaList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuotaList(backupGigabytes Quota, backups Quota, gigabytes Quota, networks Quota, nics Quota, publicIps Quota, ram Quota, securityGroupRules Quota, securityGroups Quota, snapshots Quota, vcpu Quota, volumes Quota) *QuotaList { + this := QuotaList{} + this.BackupGigabytes = backupGigabytes + this.Backups = backups + this.Gigabytes = gigabytes + this.Networks = networks + this.Nics = nics + this.PublicIps = publicIps + this.Ram = ram + this.SecurityGroupRules = securityGroupRules + this.SecurityGroups = securityGroups + this.Snapshots = snapshots + this.Vcpu = vcpu + this.Volumes = volumes + return &this +} + +// NewQuotaListWithDefaults instantiates a new QuotaList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaListWithDefaults() *QuotaList { + this := QuotaList{} + return &this +} + +// GetBackupGigabytes returns the BackupGigabytes field value +func (o *QuotaList) GetBackupGigabytes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.BackupGigabytes +} + +// GetBackupGigabytesOk returns a tuple with the BackupGigabytes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetBackupGigabytesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.BackupGigabytes, true +} + +// SetBackupGigabytes sets field value +func (o *QuotaList) SetBackupGigabytes(v Quota) { + o.BackupGigabytes = v +} + +// GetBackups returns the Backups field value +func (o *QuotaList) GetBackups() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Backups +} + +// GetBackupsOk returns a tuple with the Backups field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetBackupsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Backups, true +} + +// SetBackups sets field value +func (o *QuotaList) SetBackups(v Quota) { + o.Backups = v +} + +// GetGigabytes returns the Gigabytes field value +func (o *QuotaList) GetGigabytes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Gigabytes +} + +// GetGigabytesOk returns a tuple with the Gigabytes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetGigabytesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Gigabytes, true +} + +// SetGigabytes sets field value +func (o *QuotaList) SetGigabytes(v Quota) { + o.Gigabytes = v +} + +// GetNetworks returns the Networks field value +func (o *QuotaList) GetNetworks() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Networks +} + +// GetNetworksOk returns a tuple with the Networks field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetNetworksOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Networks, true +} + +// SetNetworks sets field value +func (o *QuotaList) SetNetworks(v Quota) { + o.Networks = v +} + +// GetNics returns the Nics field value +func (o *QuotaList) GetNics() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetNicsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Nics, true +} + +// SetNics sets field value +func (o *QuotaList) SetNics(v Quota) { + o.Nics = v +} + +// GetPublicIps returns the PublicIps field value +func (o *QuotaList) GetPublicIps() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.PublicIps +} + +// GetPublicIpsOk returns a tuple with the PublicIps field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetPublicIpsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.PublicIps, true +} + +// SetPublicIps sets field value +func (o *QuotaList) SetPublicIps(v Quota) { + o.PublicIps = v +} + +// GetRam returns the Ram field value +func (o *QuotaList) GetRam() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Ram +} + +// GetRamOk returns a tuple with the Ram field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetRamOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Ram, true +} + +// SetRam sets field value +func (o *QuotaList) SetRam(v Quota) { + o.Ram = v +} + +// GetSecurityGroupRules returns the SecurityGroupRules field value +func (o *QuotaList) GetSecurityGroupRules() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.SecurityGroupRules +} + +// GetSecurityGroupRulesOk returns a tuple with the SecurityGroupRules field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSecurityGroupRulesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.SecurityGroupRules, true +} + +// SetSecurityGroupRules sets field value +func (o *QuotaList) SetSecurityGroupRules(v Quota) { + o.SecurityGroupRules = v +} + +// GetSecurityGroups returns the SecurityGroups field value +func (o *QuotaList) GetSecurityGroups() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSecurityGroupsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.SecurityGroups, true +} + +// SetSecurityGroups sets field value +func (o *QuotaList) SetSecurityGroups(v Quota) { + o.SecurityGroups = v +} + +// GetSnapshots returns the Snapshots field value +func (o *QuotaList) GetSnapshots() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Snapshots +} + +// GetSnapshotsOk returns a tuple with the Snapshots field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetSnapshotsOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Snapshots, true +} + +// SetSnapshots sets field value +func (o *QuotaList) SetSnapshots(v Quota) { + o.Snapshots = v +} + +// GetVcpu returns the Vcpu field value +func (o *QuotaList) GetVcpu() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Vcpu +} + +// GetVcpuOk returns a tuple with the Vcpu field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetVcpuOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Vcpu, true +} + +// SetVcpu sets field value +func (o *QuotaList) SetVcpu(v Quota) { + o.Vcpu = v +} + +// GetVolumes returns the Volumes field value +func (o *QuotaList) GetVolumes() Quota { + if o == nil { + var ret Quota + return ret + } + + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value +// and a boolean to check if the value has been set. +func (o *QuotaList) GetVolumesOk() (*Quota, bool) { + if o == nil { + return nil, false + } + return &o.Volumes, true +} + +// SetVolumes sets field value +func (o *QuotaList) SetVolumes(v Quota) { + o.Volumes = v +} + +func (o QuotaList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuotaList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["backupGigabytes"] = o.BackupGigabytes + toSerialize["backups"] = o.Backups + toSerialize["gigabytes"] = o.Gigabytes + toSerialize["networks"] = o.Networks + toSerialize["nics"] = o.Nics + toSerialize["publicIps"] = o.PublicIps + toSerialize["ram"] = o.Ram + toSerialize["securityGroupRules"] = o.SecurityGroupRules + toSerialize["securityGroups"] = o.SecurityGroups + toSerialize["snapshots"] = o.Snapshots + toSerialize["vcpu"] = o.Vcpu + toSerialize["volumes"] = o.Volumes + return toSerialize, nil +} + +func (o *QuotaList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "backupGigabytes", + "backups", + "gigabytes", + "networks", + "nics", + "publicIps", + "ram", + "securityGroupRules", + "securityGroups", + "snapshots", + "vcpu", + "volumes", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuotaList := _QuotaList{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuotaList) + + if err != nil { + return err + } + + *o = QuotaList(varQuotaList) + + return err +} + +type NullableQuotaList struct { + value *QuotaList + isSet bool +} + +func (v NullableQuotaList) Get() *QuotaList { + return v.value +} + +func (v *NullableQuotaList) Set(val *QuotaList) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaList) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaList(val *QuotaList) *NullableQuotaList { + return &NullableQuotaList{value: val, isSet: true} +} + +func (v NullableQuotaList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_quota_list_response.go b/services/iaas/v2beta1api/model_quota_list_response.go new file mode 100644 index 000000000..9a03666d2 --- /dev/null +++ b/services/iaas/v2beta1api/model_quota_list_response.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the QuotaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &QuotaListResponse{} + +// QuotaListResponse Quotas list response. +type QuotaListResponse struct { + Quotas QuotaList `json:"quotas"` +} + +type _QuotaListResponse QuotaListResponse + +// NewQuotaListResponse instantiates a new QuotaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewQuotaListResponse(quotas QuotaList) *QuotaListResponse { + this := QuotaListResponse{} + this.Quotas = quotas + return &this +} + +// NewQuotaListResponseWithDefaults instantiates a new QuotaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewQuotaListResponseWithDefaults() *QuotaListResponse { + this := QuotaListResponse{} + return &this +} + +// GetQuotas returns the Quotas field value +func (o *QuotaListResponse) GetQuotas() QuotaList { + if o == nil { + var ret QuotaList + return ret + } + + return o.Quotas +} + +// GetQuotasOk returns a tuple with the Quotas field value +// and a boolean to check if the value has been set. +func (o *QuotaListResponse) GetQuotasOk() (*QuotaList, bool) { + if o == nil { + return nil, false + } + return &o.Quotas, true +} + +// SetQuotas sets field value +func (o *QuotaListResponse) SetQuotas(v QuotaList) { + o.Quotas = v +} + +func (o QuotaListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o QuotaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["quotas"] = o.Quotas + return toSerialize, nil +} + +func (o *QuotaListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "quotas", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varQuotaListResponse := _QuotaListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varQuotaListResponse) + + if err != nil { + return err + } + + *o = QuotaListResponse(varQuotaListResponse) + + return err +} + +type NullableQuotaListResponse struct { + value *QuotaListResponse + isSet bool +} + +func (v NullableQuotaListResponse) Get() *QuotaListResponse { + return v.value +} + +func (v *NullableQuotaListResponse) Set(val *QuotaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableQuotaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableQuotaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableQuotaListResponse(val *QuotaListResponse) *NullableQuotaListResponse { + return &NullableQuotaListResponse{value: val, isSet: true} +} + +func (v NullableQuotaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableQuotaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_regional_area.go b/services/iaas/v2beta1api/model_regional_area.go new file mode 100644 index 000000000..ea51c3d53 --- /dev/null +++ b/services/iaas/v2beta1api/model_regional_area.go @@ -0,0 +1,162 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the RegionalArea type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalArea{} + +// RegionalArea The basic properties of a regional network area. +type RegionalArea struct { + Ipv4 *RegionalAreaIPv4 `json:"ipv4,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status *string `json:"status,omitempty"` +} + +// NewRegionalArea instantiates a new RegionalArea object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalArea() *RegionalArea { + this := RegionalArea{} + return &this +} + +// NewRegionalAreaWithDefaults instantiates a new RegionalArea object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaWithDefaults() *RegionalArea { + this := RegionalArea{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *RegionalArea) GetIpv4() RegionalAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret RegionalAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalArea) GetIpv4Ok() (*RegionalAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *RegionalArea) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given RegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *RegionalArea) SetIpv4(v RegionalAreaIPv4) { + o.Ipv4 = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *RegionalArea) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalArea) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *RegionalArea) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *RegionalArea) SetStatus(v string) { + o.Status = &v +} + +func (o RegionalArea) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegionalArea) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableRegionalArea struct { + value *RegionalArea + isSet bool +} + +func (v NullableRegionalArea) Get() *RegionalArea { + return v.value +} + +func (v *NullableRegionalArea) Set(val *RegionalArea) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalArea) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalArea) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalArea(val *RegionalArea) *NullableRegionalArea { + return &NullableRegionalArea{value: val, isSet: true} +} + +func (v NullableRegionalArea) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalArea) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_regional_area_ipv4.go b/services/iaas/v2beta1api/model_regional_area_ipv4.go new file mode 100644 index 000000000..81dac7b0b --- /dev/null +++ b/services/iaas/v2beta1api/model_regional_area_ipv4.go @@ -0,0 +1,316 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RegionalAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalAreaIPv4{} + +// RegionalAreaIPv4 The regional IPv4 config of a network area. +type RegionalAreaIPv4 struct { + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // The default prefix length for networks in the network area. + DefaultPrefixLen int64 `json:"defaultPrefixLen"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen int64 `json:"maxPrefixLen"` + // The minimal prefix length for networks in the network area. + MinPrefixLen int64 `json:"minPrefixLen"` + // A list of network ranges. + NetworkRanges []NetworkRange `json:"networkRanges"` + // IPv4 Classless Inter-Domain Routing (CIDR). + TransferNetwork string `json:"transferNetwork" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$"` +} + +type _RegionalAreaIPv4 RegionalAreaIPv4 + +// NewRegionalAreaIPv4 instantiates a new RegionalAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalAreaIPv4(defaultPrefixLen int64, maxPrefixLen int64, minPrefixLen int64, networkRanges []NetworkRange, transferNetwork string) *RegionalAreaIPv4 { + this := RegionalAreaIPv4{} + this.DefaultPrefixLen = defaultPrefixLen + this.MaxPrefixLen = maxPrefixLen + this.MinPrefixLen = minPrefixLen + this.NetworkRanges = networkRanges + this.TransferNetwork = transferNetwork + return &this +} + +// NewRegionalAreaIPv4WithDefaults instantiates a new RegionalAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaIPv4WithDefaults() *RegionalAreaIPv4 { + this := RegionalAreaIPv4{} + var defaultPrefixLen int64 = 25 + this.DefaultPrefixLen = defaultPrefixLen + var maxPrefixLen int64 = 29 + this.MaxPrefixLen = maxPrefixLen + var minPrefixLen int64 = 24 + this.MinPrefixLen = minPrefixLen + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *RegionalAreaIPv4) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *RegionalAreaIPv4) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *RegionalAreaIPv4) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value +func (o *RegionalAreaIPv4) GetDefaultPrefixLen() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.DefaultPrefixLen +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.DefaultPrefixLen, true +} + +// SetDefaultPrefixLen sets field value +func (o *RegionalAreaIPv4) SetDefaultPrefixLen(v int64) { + o.DefaultPrefixLen = v +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value +func (o *RegionalAreaIPv4) GetMaxPrefixLen() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MaxPrefixLen +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MaxPrefixLen, true +} + +// SetMaxPrefixLen sets field value +func (o *RegionalAreaIPv4) SetMaxPrefixLen(v int64) { + o.MaxPrefixLen = v +} + +// GetMinPrefixLen returns the MinPrefixLen field value +func (o *RegionalAreaIPv4) GetMinPrefixLen() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.MinPrefixLen +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.MinPrefixLen, true +} + +// SetMinPrefixLen sets field value +func (o *RegionalAreaIPv4) SetMinPrefixLen(v int64) { + o.MinPrefixLen = v +} + +// GetNetworkRanges returns the NetworkRanges field value +func (o *RegionalAreaIPv4) GetNetworkRanges() []NetworkRange { + if o == nil { + var ret []NetworkRange + return ret + } + + return o.NetworkRanges +} + +// GetNetworkRangesOk returns a tuple with the NetworkRanges field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetNetworkRangesOk() ([]NetworkRange, bool) { + if o == nil { + return nil, false + } + return o.NetworkRanges, true +} + +// SetNetworkRanges sets field value +func (o *RegionalAreaIPv4) SetNetworkRanges(v []NetworkRange) { + o.NetworkRanges = v +} + +// GetTransferNetwork returns the TransferNetwork field value +func (o *RegionalAreaIPv4) GetTransferNetwork() string { + if o == nil { + var ret string + return ret + } + + return o.TransferNetwork +} + +// GetTransferNetworkOk returns a tuple with the TransferNetwork field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaIPv4) GetTransferNetworkOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.TransferNetwork, true +} + +// SetTransferNetwork sets field value +func (o *RegionalAreaIPv4) SetTransferNetwork(v string) { + o.TransferNetwork = v +} + +func (o RegionalAreaIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegionalAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + toSerialize["maxPrefixLen"] = o.MaxPrefixLen + toSerialize["minPrefixLen"] = o.MinPrefixLen + toSerialize["networkRanges"] = o.NetworkRanges + toSerialize["transferNetwork"] = o.TransferNetwork + return toSerialize, nil +} + +func (o *RegionalAreaIPv4) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "defaultPrefixLen", + "maxPrefixLen", + "minPrefixLen", + "networkRanges", + "transferNetwork", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRegionalAreaIPv4 := _RegionalAreaIPv4{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRegionalAreaIPv4) + + if err != nil { + return err + } + + *o = RegionalAreaIPv4(varRegionalAreaIPv4) + + return err +} + +type NullableRegionalAreaIPv4 struct { + value *RegionalAreaIPv4 + isSet bool +} + +func (v NullableRegionalAreaIPv4) Get() *RegionalAreaIPv4 { + return v.value +} + +func (v *NullableRegionalAreaIPv4) Set(val *RegionalAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalAreaIPv4(val *RegionalAreaIPv4) *NullableRegionalAreaIPv4 { + return &NullableRegionalAreaIPv4{value: val, isSet: true} +} + +func (v NullableRegionalAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_regional_area_list_response.go b/services/iaas/v2beta1api/model_regional_area_list_response.go new file mode 100644 index 000000000..bcf3347c6 --- /dev/null +++ b/services/iaas/v2beta1api/model_regional_area_list_response.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RegionalAreaListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RegionalAreaListResponse{} + +// RegionalAreaListResponse Regional area list response. +type RegionalAreaListResponse struct { + Regions map[string]RegionalArea `json:"regions"` +} + +type _RegionalAreaListResponse RegionalAreaListResponse + +// NewRegionalAreaListResponse instantiates a new RegionalAreaListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRegionalAreaListResponse(regions map[string]RegionalArea) *RegionalAreaListResponse { + this := RegionalAreaListResponse{} + this.Regions = regions + return &this +} + +// NewRegionalAreaListResponseWithDefaults instantiates a new RegionalAreaListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRegionalAreaListResponseWithDefaults() *RegionalAreaListResponse { + this := RegionalAreaListResponse{} + return &this +} + +// GetRegions returns the Regions field value +func (o *RegionalAreaListResponse) GetRegions() map[string]RegionalArea { + if o == nil { + var ret map[string]RegionalArea + return ret + } + + return o.Regions +} + +// GetRegionsOk returns a tuple with the Regions field value +// and a boolean to check if the value has been set. +func (o *RegionalAreaListResponse) GetRegionsOk() (*map[string]RegionalArea, bool) { + if o == nil { + return nil, false + } + return &o.Regions, true +} + +// SetRegions sets field value +func (o *RegionalAreaListResponse) SetRegions(v map[string]RegionalArea) { + o.Regions = v +} + +func (o RegionalAreaListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RegionalAreaListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["regions"] = o.Regions + return toSerialize, nil +} + +func (o *RegionalAreaListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "regions", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRegionalAreaListResponse := _RegionalAreaListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRegionalAreaListResponse) + + if err != nil { + return err + } + + *o = RegionalAreaListResponse(varRegionalAreaListResponse) + + return err +} + +type NullableRegionalAreaListResponse struct { + value *RegionalAreaListResponse + isSet bool +} + +func (v NullableRegionalAreaListResponse) Get() *RegionalAreaListResponse { + return v.value +} + +func (v *NullableRegionalAreaListResponse) Set(val *RegionalAreaListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRegionalAreaListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRegionalAreaListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRegionalAreaListResponse(val *RegionalAreaListResponse) *NullableRegionalAreaListResponse { + return &NullableRegionalAreaListResponse{value: val, isSet: true} +} + +func (v NullableRegionalAreaListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRegionalAreaListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_request.go b/services/iaas/v2beta1api/model_request.go new file mode 100644 index 000000000..287eb7bc4 --- /dev/null +++ b/services/iaas/v2beta1api/model_request.go @@ -0,0 +1,309 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Request type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Request{} + +// Request Object that represents a request. +type Request struct { + Details *string `json:"details,omitempty"` + // Object that represents a resource action. Possible values: `CREATE`, `DELETE`, `UPDATE`. + RequestAction string `json:"requestAction"` + // Identifier (ID) representing a single API request. + RequestId string `json:"requestId" validate:"regexp=^req-[0-9a-f]{32}$"` + // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. + RequestType string `json:"requestType"` + Resources []RequestResource `json:"resources"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` +} + +type _Request Request + +// NewRequest instantiates a new Request object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequest(requestAction string, requestId string, requestType string, resources []RequestResource, status string) *Request { + this := Request{} + this.RequestAction = requestAction + this.RequestId = requestId + this.RequestType = requestType + this.Resources = resources + this.Status = status + return &this +} + +// NewRequestWithDefaults instantiates a new Request object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestWithDefaults() *Request { + this := Request{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *Request) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Request) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *Request) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *Request) SetDetails(v string) { + o.Details = &v +} + +// GetRequestAction returns the RequestAction field value +func (o *Request) GetRequestAction() string { + if o == nil { + var ret string + return ret + } + + return o.RequestAction +} + +// GetRequestActionOk returns a tuple with the RequestAction field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestActionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestAction, true +} + +// SetRequestAction sets field value +func (o *Request) SetRequestAction(v string) { + o.RequestAction = v +} + +// GetRequestId returns the RequestId field value +func (o *Request) GetRequestId() string { + if o == nil { + var ret string + return ret + } + + return o.RequestId +} + +// GetRequestIdOk returns a tuple with the RequestId field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestId, true +} + +// SetRequestId sets field value +func (o *Request) SetRequestId(v string) { + o.RequestId = v +} + +// GetRequestType returns the RequestType field value +func (o *Request) GetRequestType() string { + if o == nil { + var ret string + return ret + } + + return o.RequestType +} + +// GetRequestTypeOk returns a tuple with the RequestType field value +// and a boolean to check if the value has been set. +func (o *Request) GetRequestTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.RequestType, true +} + +// SetRequestType sets field value +func (o *Request) SetRequestType(v string) { + o.RequestType = v +} + +// GetResources returns the Resources field value +func (o *Request) GetResources() []RequestResource { + if o == nil { + var ret []RequestResource + return ret + } + + return o.Resources +} + +// GetResourcesOk returns a tuple with the Resources field value +// and a boolean to check if the value has been set. +func (o *Request) GetResourcesOk() ([]RequestResource, bool) { + if o == nil { + return nil, false + } + return o.Resources, true +} + +// SetResources sets field value +func (o *Request) SetResources(v []RequestResource) { + o.Resources = v +} + +// GetStatus returns the Status field value +func (o *Request) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Request) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Request) SetStatus(v string) { + o.Status = v +} + +func (o Request) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Request) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["requestAction"] = o.RequestAction + toSerialize["requestId"] = o.RequestId + toSerialize["requestType"] = o.RequestType + toSerialize["resources"] = o.Resources + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *Request) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "requestAction", + "requestId", + "requestType", + "resources", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequest := _Request{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequest) + + if err != nil { + return err + } + + *o = Request(varRequest) + + return err +} + +type NullableRequest struct { + value *Request + isSet bool +} + +func (v NullableRequest) Get() *Request { + return v.value +} + +func (v *NullableRequest) Set(val *Request) { + v.value = val + v.isSet = true +} + +func (v NullableRequest) IsSet() bool { + return v.isSet +} + +func (v *NullableRequest) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequest(val *Request) *NullableRequest { + return &NullableRequest{value: val, isSet: true} +} + +func (v NullableRequest) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequest) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_request_resource.go b/services/iaas/v2beta1api/model_request_resource.go new file mode 100644 index 000000000..ed6b6b996 --- /dev/null +++ b/services/iaas/v2beta1api/model_request_resource.go @@ -0,0 +1,216 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RequestResource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RequestResource{} + +// RequestResource Object that represents a resource as part of a request. +type RequestResource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status string `json:"status"` + // Object that represents a resource type. Possible values: `BACKUP`, `IMAGE`, `NETWORK`, `NETWORKAREA`, `NIC`, `PROJECT`, `ROUTE`, `SERVER`, `SERVICEACCOUNT`, `SNAPSHOT`, `VIRTUALIP`, `VOLUME`. + Type string `json:"type"` +} + +type _RequestResource RequestResource + +// NewRequestResource instantiates a new RequestResource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRequestResource(id string, status string, types string) *RequestResource { + this := RequestResource{} + this.Id = id + this.Status = status + this.Type = types + return &this +} + +// NewRequestResourceWithDefaults instantiates a new RequestResource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRequestResourceWithDefaults() *RequestResource { + this := RequestResource{} + return &this +} + +// GetId returns the Id field value +func (o *RequestResource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RequestResource) SetId(v string) { + o.Id = v +} + +// GetStatus returns the Status field value +func (o *RequestResource) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *RequestResource) SetStatus(v string) { + o.Status = v +} + +// GetType returns the Type field value +func (o *RequestResource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *RequestResource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *RequestResource) SetType(v string) { + o.Type = v +} + +func (o RequestResource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RequestResource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["status"] = o.Status + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *RequestResource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "status", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRequestResource := _RequestResource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRequestResource) + + if err != nil { + return err + } + + *o = RequestResource(varRequestResource) + + return err +} + +type NullableRequestResource struct { + value *RequestResource + isSet bool +} + +func (v NullableRequestResource) Get() *RequestResource { + return v.value +} + +func (v *NullableRequestResource) Set(val *RequestResource) { + v.value = val + v.isSet = true +} + +func (v NullableRequestResource) IsSet() bool { + return v.isSet +} + +func (v *NullableRequestResource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRequestResource(val *RequestResource) *NullableRequestResource { + return &NullableRequestResource{value: val, isSet: true} +} + +func (v NullableRequestResource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRequestResource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_rescue_server_payload.go b/services/iaas/v2beta1api/model_rescue_server_payload.go new file mode 100644 index 000000000..c93d266b5 --- /dev/null +++ b/services/iaas/v2beta1api/model_rescue_server_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RescueServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RescueServerPayload{} + +// RescueServerPayload struct for RescueServerPayload +type RescueServerPayload struct { + // Universally Unique Identifier (UUID). + Image string `json:"image" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _RescueServerPayload RescueServerPayload + +// NewRescueServerPayload instantiates a new RescueServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRescueServerPayload(image string) *RescueServerPayload { + this := RescueServerPayload{} + this.Image = image + return &this +} + +// NewRescueServerPayloadWithDefaults instantiates a new RescueServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRescueServerPayloadWithDefaults() *RescueServerPayload { + this := RescueServerPayload{} + return &this +} + +// GetImage returns the Image field value +func (o *RescueServerPayload) GetImage() string { + if o == nil { + var ret string + return ret + } + + return o.Image +} + +// GetImageOk returns a tuple with the Image field value +// and a boolean to check if the value has been set. +func (o *RescueServerPayload) GetImageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Image, true +} + +// SetImage sets field value +func (o *RescueServerPayload) SetImage(v string) { + o.Image = v +} + +func (o RescueServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RescueServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["image"] = o.Image + return toSerialize, nil +} + +func (o *RescueServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "image", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRescueServerPayload := _RescueServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRescueServerPayload) + + if err != nil { + return err + } + + *o = RescueServerPayload(varRescueServerPayload) + + return err +} + +type NullableRescueServerPayload struct { + value *RescueServerPayload + isSet bool +} + +func (v NullableRescueServerPayload) Get() *RescueServerPayload { + return v.value +} + +func (v *NullableRescueServerPayload) Set(val *RescueServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableRescueServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableRescueServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRescueServerPayload(val *RescueServerPayload) *NullableRescueServerPayload { + return &NullableRescueServerPayload{value: val, isSet: true} +} + +func (v NullableRescueServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRescueServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_resize_server_payload.go b/services/iaas/v2beta1api/model_resize_server_payload.go new file mode 100644 index 000000000..f3a8bafaa --- /dev/null +++ b/services/iaas/v2beta1api/model_resize_server_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ResizeServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResizeServerPayload{} + +// ResizeServerPayload struct for ResizeServerPayload +type ResizeServerPayload struct { + // The name for a General Object. Matches Names and also UUIDs. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +type _ResizeServerPayload ResizeServerPayload + +// NewResizeServerPayload instantiates a new ResizeServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResizeServerPayload(machineType string) *ResizeServerPayload { + this := ResizeServerPayload{} + this.MachineType = machineType + return &this +} + +// NewResizeServerPayloadWithDefaults instantiates a new ResizeServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResizeServerPayloadWithDefaults() *ResizeServerPayload { + this := ResizeServerPayload{} + return &this +} + +// GetMachineType returns the MachineType field value +func (o *ResizeServerPayload) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *ResizeServerPayload) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *ResizeServerPayload) SetMachineType(v string) { + o.MachineType = v +} + +func (o ResizeServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResizeServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["machineType"] = o.MachineType + return toSerialize, nil +} + +func (o *ResizeServerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResizeServerPayload := _ResizeServerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResizeServerPayload) + + if err != nil { + return err + } + + *o = ResizeServerPayload(varResizeServerPayload) + + return err +} + +type NullableResizeServerPayload struct { + value *ResizeServerPayload + isSet bool +} + +func (v NullableResizeServerPayload) Get() *ResizeServerPayload { + return v.value +} + +func (v *NullableResizeServerPayload) Set(val *ResizeServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableResizeServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableResizeServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResizeServerPayload(val *ResizeServerPayload) *NullableResizeServerPayload { + return &NullableResizeServerPayload{value: val, isSet: true} +} + +func (v NullableResizeServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResizeServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_resize_volume_payload.go b/services/iaas/v2beta1api/model_resize_volume_payload.go new file mode 100644 index 000000000..5784fd7d6 --- /dev/null +++ b/services/iaas/v2beta1api/model_resize_volume_payload.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ResizeVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResizeVolumePayload{} + +// ResizeVolumePayload struct for ResizeVolumePayload +type ResizeVolumePayload struct { + // Size in Gigabyte. + Size int64 `json:"size"` +} + +type _ResizeVolumePayload ResizeVolumePayload + +// NewResizeVolumePayload instantiates a new ResizeVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewResizeVolumePayload(size int64) *ResizeVolumePayload { + this := ResizeVolumePayload{} + this.Size = size + return &this +} + +// NewResizeVolumePayloadWithDefaults instantiates a new ResizeVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewResizeVolumePayloadWithDefaults() *ResizeVolumePayload { + this := ResizeVolumePayload{} + return &this +} + +// GetSize returns the Size field value +func (o *ResizeVolumePayload) GetSize() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.Size +} + +// GetSizeOk returns a tuple with the Size field value +// and a boolean to check if the value has been set. +func (o *ResizeVolumePayload) GetSizeOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.Size, true +} + +// SetSize sets field value +func (o *ResizeVolumePayload) SetSize(v int64) { + o.Size = v +} + +func (o ResizeVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResizeVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["size"] = o.Size + return toSerialize, nil +} + +func (o *ResizeVolumePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "size", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varResizeVolumePayload := _ResizeVolumePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varResizeVolumePayload) + + if err != nil { + return err + } + + *o = ResizeVolumePayload(varResizeVolumePayload) + + return err +} + +type NullableResizeVolumePayload struct { + value *ResizeVolumePayload + isSet bool +} + +func (v NullableResizeVolumePayload) Get() *ResizeVolumePayload { + return v.value +} + +func (v *NullableResizeVolumePayload) Set(val *ResizeVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableResizeVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableResizeVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResizeVolumePayload(val *ResizeVolumePayload) *NullableResizeVolumePayload { + return &NullableResizeVolumePayload{value: val, isSet: true} +} + +func (v NullableResizeVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResizeVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_route.go b/services/iaas/v2beta1api/model_route.go new file mode 100644 index 000000000..7bbf8e76b --- /dev/null +++ b/services/iaas/v2beta1api/model_route.go @@ -0,0 +1,334 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Route type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Route{} + +// Route Object represents a network route. +type Route struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + Destination RouteDestination `json:"destination"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + Nexthop RouteNexthop `json:"nexthop"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Route Route + +// NewRoute instantiates a new Route object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoute(destination RouteDestination, nexthop RouteNexthop) *Route { + this := Route{} + this.Destination = destination + this.Nexthop = nexthop + return &this +} + +// NewRouteWithDefaults instantiates a new Route object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteWithDefaults() *Route { + this := Route{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Route) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Route) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Route) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDestination returns the Destination field value +func (o *Route) GetDestination() RouteDestination { + if o == nil { + var ret RouteDestination + return ret + } + + return o.Destination +} + +// GetDestinationOk returns a tuple with the Destination field value +// and a boolean to check if the value has been set. +func (o *Route) GetDestinationOk() (*RouteDestination, bool) { + if o == nil { + return nil, false + } + return &o.Destination, true +} + +// SetDestination sets field value +func (o *Route) SetDestination(v RouteDestination) { + o.Destination = v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Route) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Route) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Route) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Route) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Route) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Route) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNexthop returns the Nexthop field value +func (o *Route) GetNexthop() RouteNexthop { + if o == nil { + var ret RouteNexthop + return ret + } + + return o.Nexthop +} + +// GetNexthopOk returns a tuple with the Nexthop field value +// and a boolean to check if the value has been set. +func (o *Route) GetNexthopOk() (*RouteNexthop, bool) { + if o == nil { + return nil, false + } + return &o.Nexthop, true +} + +// SetNexthop sets field value +func (o *Route) SetNexthop(v RouteNexthop) { + o.Nexthop = v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Route) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Route) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Route) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Route) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Route) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Route) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + toSerialize["destination"] = o.Destination + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["nexthop"] = o.Nexthop + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Route) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "destination", + "nexthop", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoute := _Route{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoute) + + if err != nil { + return err + } + + *o = Route(varRoute) + + return err +} + +type NullableRoute struct { + value *Route + isSet bool +} + +func (v NullableRoute) Get() *Route { + return v.value +} + +func (v *NullableRoute) Set(val *Route) { + v.value = val + v.isSet = true +} + +func (v NullableRoute) IsSet() bool { + return v.isSet +} + +func (v *NullableRoute) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoute(val *Route) *NullableRoute { + return &NullableRoute{value: val, isSet: true} +} + +func (v NullableRoute) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoute) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_route_destination.go b/services/iaas/v2beta1api/model_route_destination.go new file mode 100644 index 000000000..70f770633 --- /dev/null +++ b/services/iaas/v2beta1api/model_route_destination.go @@ -0,0 +1,154 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// RouteDestination - struct for RouteDestination +type RouteDestination struct { + DestinationCIDRv4 *DestinationCIDRv4 + DestinationCIDRv6 *DestinationCIDRv6 +} + +// DestinationCIDRv4AsRouteDestination is a convenience function that returns DestinationCIDRv4 wrapped in RouteDestination +func DestinationCIDRv4AsRouteDestination(v *DestinationCIDRv4) RouteDestination { + return RouteDestination{ + DestinationCIDRv4: v, + } +} + +// DestinationCIDRv6AsRouteDestination is a convenience function that returns DestinationCIDRv6 wrapped in RouteDestination +func DestinationCIDRv6AsRouteDestination(v *DestinationCIDRv6) RouteDestination { + return RouteDestination{ + DestinationCIDRv6: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RouteDestination) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'cidrv4' + if jsonDict["type"] == "cidrv4" { + // try to unmarshal JSON data into DestinationCIDRv4 + err = json.Unmarshal(data, &dst.DestinationCIDRv4) + if err == nil { + return nil // data stored in dst.DestinationCIDRv4, return on the first match + } else { + dst.DestinationCIDRv4 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'cidrv6' + if jsonDict["type"] == "cidrv6" { + // try to unmarshal JSON data into DestinationCIDRv6 + err = json.Unmarshal(data, &dst.DestinationCIDRv6) + if err == nil { + return nil // data stored in dst.DestinationCIDRv6, return on the first match + } else { + dst.DestinationCIDRv6 = nil + return fmt.Errorf("failed to unmarshal RouteDestination as DestinationCIDRv6: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RouteDestination) MarshalJSON() ([]byte, error) { + if src.DestinationCIDRv4 != nil { + return json.Marshal(&src.DestinationCIDRv4) + } + + if src.DestinationCIDRv6 != nil { + return json.Marshal(&src.DestinationCIDRv6) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RouteDestination) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.DestinationCIDRv4 != nil { + return obj.DestinationCIDRv4 + } + + if obj.DestinationCIDRv6 != nil { + return obj.DestinationCIDRv6 + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj RouteDestination) GetActualInstanceValue() interface{} { + if obj.DestinationCIDRv4 != nil { + return *obj.DestinationCIDRv4 + } + + if obj.DestinationCIDRv6 != nil { + return *obj.DestinationCIDRv6 + } + + // all schemas are nil + return nil +} + +type NullableRouteDestination struct { + value *RouteDestination + isSet bool +} + +func (v NullableRouteDestination) Get() *RouteDestination { + return v.value +} + +func (v *NullableRouteDestination) Set(val *RouteDestination) { + v.value = val + v.isSet = true +} + +func (v NullableRouteDestination) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteDestination) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteDestination(val *RouteDestination) *NullableRouteDestination { + return &NullableRouteDestination{value: val, isSet: true} +} + +func (v NullableRouteDestination) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteDestination) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_route_list_response.go b/services/iaas/v2beta1api/model_route_list_response.go new file mode 100644 index 000000000..a831034dd --- /dev/null +++ b/services/iaas/v2beta1api/model_route_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RouteListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RouteListResponse{} + +// RouteListResponse Route list response. +type RouteListResponse struct { + // A list of routes. + Items []Route `json:"items"` +} + +type _RouteListResponse RouteListResponse + +// NewRouteListResponse instantiates a new RouteListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRouteListResponse(items []Route) *RouteListResponse { + this := RouteListResponse{} + this.Items = items + return &this +} + +// NewRouteListResponseWithDefaults instantiates a new RouteListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRouteListResponseWithDefaults() *RouteListResponse { + this := RouteListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RouteListResponse) GetItems() []Route { + if o == nil { + var ret []Route + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RouteListResponse) GetItemsOk() ([]Route, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RouteListResponse) SetItems(v []Route) { + o.Items = v +} + +func (o RouteListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RouteListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RouteListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRouteListResponse := _RouteListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRouteListResponse) + + if err != nil { + return err + } + + *o = RouteListResponse(varRouteListResponse) + + return err +} + +type NullableRouteListResponse struct { + value *RouteListResponse + isSet bool +} + +func (v NullableRouteListResponse) Get() *RouteListResponse { + return v.value +} + +func (v *NullableRouteListResponse) Set(val *RouteListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRouteListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteListResponse(val *RouteListResponse) *NullableRouteListResponse { + return &NullableRouteListResponse{value: val, isSet: true} +} + +func (v NullableRouteListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_route_nexthop.go b/services/iaas/v2beta1api/model_route_nexthop.go new file mode 100644 index 000000000..7f0160626 --- /dev/null +++ b/services/iaas/v2beta1api/model_route_nexthop.go @@ -0,0 +1,218 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// RouteNexthop - struct for RouteNexthop +type RouteNexthop struct { + NexthopBlackhole *NexthopBlackhole + NexthopIPv4 *NexthopIPv4 + NexthopIPv6 *NexthopIPv6 + NexthopInternet *NexthopInternet +} + +// NexthopBlackholeAsRouteNexthop is a convenience function that returns NexthopBlackhole wrapped in RouteNexthop +func NexthopBlackholeAsRouteNexthop(v *NexthopBlackhole) RouteNexthop { + return RouteNexthop{ + NexthopBlackhole: v, + } +} + +// NexthopIPv4AsRouteNexthop is a convenience function that returns NexthopIPv4 wrapped in RouteNexthop +func NexthopIPv4AsRouteNexthop(v *NexthopIPv4) RouteNexthop { + return RouteNexthop{ + NexthopIPv4: v, + } +} + +// NexthopIPv6AsRouteNexthop is a convenience function that returns NexthopIPv6 wrapped in RouteNexthop +func NexthopIPv6AsRouteNexthop(v *NexthopIPv6) RouteNexthop { + return RouteNexthop{ + NexthopIPv6: v, + } +} + +// NexthopInternetAsRouteNexthop is a convenience function that returns NexthopInternet wrapped in RouteNexthop +func NexthopInternetAsRouteNexthop(v *NexthopInternet) RouteNexthop { + return RouteNexthop{ + NexthopInternet: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *RouteNexthop) UnmarshalJSON(data []byte) error { + var err error + // use discriminator value to speed up the lookup + var jsonDict map[string]interface{} + err = newStrictDecoder(data).Decode(&jsonDict) + if err != nil { + return fmt.Errorf("failed to unmarshal JSON into map for the discriminator lookup") + } + + // check if the discriminator value is 'blackhole' + if jsonDict["type"] == "blackhole" { + // try to unmarshal JSON data into NexthopBlackhole + err = json.Unmarshal(data, &dst.NexthopBlackhole) + if err == nil { + return nil // data stored in dst.NexthopBlackhole, return on the first match + } else { + dst.NexthopBlackhole = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopBlackhole: %s", err.Error()) + } + } + + // check if the discriminator value is 'internet' + if jsonDict["type"] == "internet" { + // try to unmarshal JSON data into NexthopInternet + err = json.Unmarshal(data, &dst.NexthopInternet) + if err == nil { + return nil // data stored in dst.NexthopInternet, return on the first match + } else { + dst.NexthopInternet = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopInternet: %s", err.Error()) + } + } + + // check if the discriminator value is 'ipv4' + if jsonDict["type"] == "ipv4" { + // try to unmarshal JSON data into NexthopIPv4 + err = json.Unmarshal(data, &dst.NexthopIPv4) + if err == nil { + return nil // data stored in dst.NexthopIPv4, return on the first match + } else { + dst.NexthopIPv4 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv4: %s", err.Error()) + } + } + + // check if the discriminator value is 'ipv6' + if jsonDict["type"] == "ipv6" { + // try to unmarshal JSON data into NexthopIPv6 + err = json.Unmarshal(data, &dst.NexthopIPv6) + if err == nil { + return nil // data stored in dst.NexthopIPv6, return on the first match + } else { + dst.NexthopIPv6 = nil + return fmt.Errorf("failed to unmarshal RouteNexthop as NexthopIPv6: %s", err.Error()) + } + } + + return nil +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src RouteNexthop) MarshalJSON() ([]byte, error) { + if src.NexthopBlackhole != nil { + return json.Marshal(&src.NexthopBlackhole) + } + + if src.NexthopIPv4 != nil { + return json.Marshal(&src.NexthopIPv4) + } + + if src.NexthopIPv6 != nil { + return json.Marshal(&src.NexthopIPv6) + } + + if src.NexthopInternet != nil { + return json.Marshal(&src.NexthopInternet) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *RouteNexthop) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.NexthopBlackhole != nil { + return obj.NexthopBlackhole + } + + if obj.NexthopIPv4 != nil { + return obj.NexthopIPv4 + } + + if obj.NexthopIPv6 != nil { + return obj.NexthopIPv6 + } + + if obj.NexthopInternet != nil { + return obj.NexthopInternet + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj RouteNexthop) GetActualInstanceValue() interface{} { + if obj.NexthopBlackhole != nil { + return *obj.NexthopBlackhole + } + + if obj.NexthopIPv4 != nil { + return *obj.NexthopIPv4 + } + + if obj.NexthopIPv6 != nil { + return *obj.NexthopIPv6 + } + + if obj.NexthopInternet != nil { + return *obj.NexthopInternet + } + + // all schemas are nil + return nil +} + +type NullableRouteNexthop struct { + value *RouteNexthop + isSet bool +} + +func (v NullableRouteNexthop) Get() *RouteNexthop { + return v.value +} + +func (v *NullableRouteNexthop) Set(val *RouteNexthop) { + v.value = val + v.isSet = true +} + +func (v NullableRouteNexthop) IsSet() bool { + return v.isSet +} + +func (v *NullableRouteNexthop) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRouteNexthop(val *RouteNexthop) *NullableRouteNexthop { + return &NullableRouteNexthop{value: val, isSet: true} +} + +func (v NullableRouteNexthop) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRouteNexthop) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_routing_table.go b/services/iaas/v2beta1api/model_routing_table.go new file mode 100644 index 000000000..ab3c70f45 --- /dev/null +++ b/services/iaas/v2beta1api/model_routing_table.go @@ -0,0 +1,463 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the RoutingTable type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoutingTable{} + +// RoutingTable An object representing a routing table. +type RoutingTable struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // This is the default routing table. It can't be deleted and is used if the user does not specify it otherwise. + Default *bool `json:"default,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // A config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _RoutingTable RoutingTable + +// NewRoutingTable instantiates a new RoutingTable object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoutingTable(name string) *RoutingTable { + this := RoutingTable{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + this.Name = name + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// NewRoutingTableWithDefaults instantiates a new RoutingTable object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoutingTableWithDefaults() *RoutingTable { + this := RoutingTable{} + var dynamicRoutes bool = true + this.DynamicRoutes = &dynamicRoutes + var systemRoutes bool = true + this.SystemRoutes = &systemRoutes + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *RoutingTable) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *RoutingTable) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *RoutingTable) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *RoutingTable) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *RoutingTable) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *RoutingTable) SetDefault(v bool) { + o.Default = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *RoutingTable) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *RoutingTable) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *RoutingTable) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *RoutingTable) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *RoutingTable) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *RoutingTable) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *RoutingTable) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *RoutingTable) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *RoutingTable) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *RoutingTable) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *RoutingTable) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *RoutingTable) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *RoutingTable) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *RoutingTable) SetName(v string) { + o.Name = v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *RoutingTable) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *RoutingTable) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *RoutingTable) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *RoutingTable) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RoutingTable) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *RoutingTable) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *RoutingTable) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o RoutingTable) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoutingTable) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *RoutingTable) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoutingTable := _RoutingTable{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoutingTable) + + if err != nil { + return err + } + + *o = RoutingTable(varRoutingTable) + + return err +} + +type NullableRoutingTable struct { + value *RoutingTable + isSet bool +} + +func (v NullableRoutingTable) Get() *RoutingTable { + return v.value +} + +func (v *NullableRoutingTable) Set(val *RoutingTable) { + v.value = val + v.isSet = true +} + +func (v NullableRoutingTable) IsSet() bool { + return v.isSet +} + +func (v *NullableRoutingTable) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoutingTable(val *RoutingTable) *NullableRoutingTable { + return &NullableRoutingTable{value: val, isSet: true} +} + +func (v NullableRoutingTable) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoutingTable) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_routing_table_list_response.go b/services/iaas/v2beta1api/model_routing_table_list_response.go new file mode 100644 index 000000000..766b03748 --- /dev/null +++ b/services/iaas/v2beta1api/model_routing_table_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RoutingTableListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RoutingTableListResponse{} + +// RoutingTableListResponse Routing table response. +type RoutingTableListResponse struct { + // A list of routing tables. + Items []RoutingTable `json:"items"` +} + +type _RoutingTableListResponse RoutingTableListResponse + +// NewRoutingTableListResponse instantiates a new RoutingTableListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRoutingTableListResponse(items []RoutingTable) *RoutingTableListResponse { + this := RoutingTableListResponse{} + this.Items = items + return &this +} + +// NewRoutingTableListResponseWithDefaults instantiates a new RoutingTableListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRoutingTableListResponseWithDefaults() *RoutingTableListResponse { + this := RoutingTableListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *RoutingTableListResponse) GetItems() []RoutingTable { + if o == nil { + var ret []RoutingTable + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RoutingTableListResponse) GetItemsOk() ([]RoutingTable, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RoutingTableListResponse) SetItems(v []RoutingTable) { + o.Items = v +} + +func (o RoutingTableListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RoutingTableListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RoutingTableListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRoutingTableListResponse := _RoutingTableListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRoutingTableListResponse) + + if err != nil { + return err + } + + *o = RoutingTableListResponse(varRoutingTableListResponse) + + return err +} + +type NullableRoutingTableListResponse struct { + value *RoutingTableListResponse + isSet bool +} + +func (v NullableRoutingTableListResponse) Get() *RoutingTableListResponse { + return v.value +} + +func (v *NullableRoutingTableListResponse) Set(val *RoutingTableListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableRoutingTableListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableRoutingTableListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRoutingTableListResponse(val *RoutingTableListResponse) *NullableRoutingTableListResponse { + return &NullableRoutingTableListResponse{value: val, isSet: true} +} + +func (v NullableRoutingTableListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRoutingTableListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_security_group.go b/services/iaas/v2beta1api/model_security_group.go new file mode 100644 index 000000000..9c0159099 --- /dev/null +++ b/services/iaas/v2beta1api/model_security_group.go @@ -0,0 +1,422 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the SecurityGroup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroup{} + +// SecurityGroup Object that represents a security group. +type SecurityGroup struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // A list containing security group rule objects. + Rules []SecurityGroupRule `json:"rules,omitempty"` + // Shows if a security group is stateful or stateless. You can only have one type of security groups per network interface/server. + Stateful *bool `json:"stateful,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _SecurityGroup SecurityGroup + +// NewSecurityGroup instantiates a new SecurityGroup object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroup(name string) *SecurityGroup { + this := SecurityGroup{} + this.Name = name + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// NewSecurityGroupWithDefaults instantiates a new SecurityGroup object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupWithDefaults() *SecurityGroup { + this := SecurityGroup{} + var stateful bool = true + this.Stateful = &stateful + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SecurityGroup) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SecurityGroup) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SecurityGroup) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SecurityGroup) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SecurityGroup) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SecurityGroup) SetDescription(v string) { + o.Description = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SecurityGroup) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SecurityGroup) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SecurityGroup) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *SecurityGroup) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *SecurityGroup) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *SecurityGroup) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *SecurityGroup) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *SecurityGroup) SetName(v string) { + o.Name = v +} + +// GetRules returns the Rules field value if set, zero value otherwise. +func (o *SecurityGroup) GetRules() []SecurityGroupRule { + if o == nil || IsNil(o.Rules) { + var ret []SecurityGroupRule + return ret + } + return o.Rules +} + +// GetRulesOk returns a tuple with the Rules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetRulesOk() ([]SecurityGroupRule, bool) { + if o == nil || IsNil(o.Rules) { + return nil, false + } + return o.Rules, true +} + +// HasRules returns a boolean if a field has been set. +func (o *SecurityGroup) HasRules() bool { + if o != nil && !IsNil(o.Rules) { + return true + } + + return false +} + +// SetRules gets a reference to the given []SecurityGroupRule and assigns it to the Rules field. +func (o *SecurityGroup) SetRules(v []SecurityGroupRule) { + o.Rules = v +} + +// GetStateful returns the Stateful field value if set, zero value otherwise. +func (o *SecurityGroup) GetStateful() bool { + if o == nil || IsNil(o.Stateful) { + var ret bool + return ret + } + return *o.Stateful +} + +// GetStatefulOk returns a tuple with the Stateful field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetStatefulOk() (*bool, bool) { + if o == nil || IsNil(o.Stateful) { + return nil, false + } + return o.Stateful, true +} + +// HasStateful returns a boolean if a field has been set. +func (o *SecurityGroup) HasStateful() bool { + if o != nil && !IsNil(o.Stateful) { + return true + } + + return false +} + +// SetStateful gets a reference to the given bool and assigns it to the Stateful field. +func (o *SecurityGroup) SetStateful(v bool) { + o.Stateful = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *SecurityGroup) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroup) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *SecurityGroup) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *SecurityGroup) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o SecurityGroup) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Rules) { + toSerialize["rules"] = o.Rules + } + if !IsNil(o.Stateful) { + toSerialize["stateful"] = o.Stateful + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *SecurityGroup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroup := _SecurityGroup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroup) + + if err != nil { + return err + } + + *o = SecurityGroup(varSecurityGroup) + + return err +} + +type NullableSecurityGroup struct { + value *SecurityGroup + isSet bool +} + +func (v NullableSecurityGroup) Get() *SecurityGroup { + return v.value +} + +func (v *NullableSecurityGroup) Set(val *SecurityGroup) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroup) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroup(val *SecurityGroup) *NullableSecurityGroup { + return &NullableSecurityGroup{value: val, isSet: true} +} + +func (v NullableSecurityGroup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_security_group_list_response.go b/services/iaas/v2beta1api/model_security_group_list_response.go new file mode 100644 index 000000000..2d1093c7a --- /dev/null +++ b/services/iaas/v2beta1api/model_security_group_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SecurityGroupListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupListResponse{} + +// SecurityGroupListResponse Security group list response. +type SecurityGroupListResponse struct { + // A list containing security group objects. + Items []SecurityGroup `json:"items"` +} + +type _SecurityGroupListResponse SecurityGroupListResponse + +// NewSecurityGroupListResponse instantiates a new SecurityGroupListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupListResponse(items []SecurityGroup) *SecurityGroupListResponse { + this := SecurityGroupListResponse{} + this.Items = items + return &this +} + +// NewSecurityGroupListResponseWithDefaults instantiates a new SecurityGroupListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupListResponseWithDefaults() *SecurityGroupListResponse { + this := SecurityGroupListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SecurityGroupListResponse) GetItems() []SecurityGroup { + if o == nil { + var ret []SecurityGroup + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupListResponse) GetItemsOk() ([]SecurityGroup, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SecurityGroupListResponse) SetItems(v []SecurityGroup) { + o.Items = v +} + +func (o SecurityGroupListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SecurityGroupListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupListResponse := _SecurityGroupListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupListResponse) + + if err != nil { + return err + } + + *o = SecurityGroupListResponse(varSecurityGroupListResponse) + + return err +} + +type NullableSecurityGroupListResponse struct { + value *SecurityGroupListResponse + isSet bool +} + +func (v NullableSecurityGroupListResponse) Get() *SecurityGroupListResponse { + return v.value +} + +func (v *NullableSecurityGroupListResponse) Set(val *SecurityGroupListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupListResponse(val *SecurityGroupListResponse) *NullableSecurityGroupListResponse { + return &NullableSecurityGroupListResponse{value: val, isSet: true} +} + +func (v NullableSecurityGroupListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_security_group_rule.go b/services/iaas/v2beta1api/model_security_group_rule.go new file mode 100644 index 000000000..5c9ba14cf --- /dev/null +++ b/services/iaas/v2beta1api/model_security_group_rule.go @@ -0,0 +1,567 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the SecurityGroupRule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRule{} + +// SecurityGroupRule Object that represents a security group rule. +type SecurityGroupRule struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The direction of the traffic which the rule should match. Possible values: `ingress`, `egress`. + Direction string `json:"direction"` + // The ethertype which the rule should match. Possible values: `IPv4`, `IPv6`. + Ethertype *string `json:"ethertype,omitempty"` + IcmpParameters *ICMPParameters `json:"icmpParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The remote IP range which the rule should match. + IpRange *string `json:"ipRange,omitempty" validate:"regexp=^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\\/(3[0-2]|2[0-9]|1[0-9]|[0-9]))$|^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))(\\/((1(1[0-9]|2[0-8]))|([0-9][0-9])|([0-9])))?$"` + PortRange *PortRange `json:"portRange,omitempty"` + // The remote security group which the rule should match. + RemoteSecurityGroupId *string `json:"remoteSecurityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + SecurityGroupId *string `json:"securityGroupId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + Protocol *Protocol `json:"protocol,omitempty"` +} + +type _SecurityGroupRule SecurityGroupRule + +// NewSecurityGroupRule instantiates a new SecurityGroupRule object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRule(direction string) *SecurityGroupRule { + this := SecurityGroupRule{} + this.Direction = direction + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// NewSecurityGroupRuleWithDefaults instantiates a new SecurityGroupRule object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleWithDefaults() *SecurityGroupRule { + this := SecurityGroupRule{} + var ethertype string = "IPv4" + this.Ethertype = ðertype + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SecurityGroupRule) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *SecurityGroupRule) SetDescription(v string) { + o.Description = &v +} + +// GetDirection returns the Direction field value +func (o *SecurityGroupRule) GetDirection() string { + if o == nil { + var ret string + return ret + } + + return o.Direction +} + +// GetDirectionOk returns a tuple with the Direction field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetDirectionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Direction, true +} + +// SetDirection sets field value +func (o *SecurityGroupRule) SetDirection(v string) { + o.Direction = v +} + +// GetEthertype returns the Ethertype field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetEthertype() string { + if o == nil || IsNil(o.Ethertype) { + var ret string + return ret + } + return *o.Ethertype +} + +// GetEthertypeOk returns a tuple with the Ethertype field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetEthertypeOk() (*string, bool) { + if o == nil || IsNil(o.Ethertype) { + return nil, false + } + return o.Ethertype, true +} + +// HasEthertype returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasEthertype() bool { + if o != nil && !IsNil(o.Ethertype) { + return true + } + + return false +} + +// SetEthertype gets a reference to the given string and assigns it to the Ethertype field. +func (o *SecurityGroupRule) SetEthertype(v string) { + o.Ethertype = &v +} + +// GetIcmpParameters returns the IcmpParameters field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetIcmpParameters() ICMPParameters { + if o == nil || IsNil(o.IcmpParameters) { + var ret ICMPParameters + return ret + } + return *o.IcmpParameters +} + +// GetIcmpParametersOk returns a tuple with the IcmpParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIcmpParametersOk() (*ICMPParameters, bool) { + if o == nil || IsNil(o.IcmpParameters) { + return nil, false + } + return o.IcmpParameters, true +} + +// HasIcmpParameters returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasIcmpParameters() bool { + if o != nil && !IsNil(o.IcmpParameters) { + return true + } + + return false +} + +// SetIcmpParameters gets a reference to the given ICMPParameters and assigns it to the IcmpParameters field. +func (o *SecurityGroupRule) SetIcmpParameters(v ICMPParameters) { + o.IcmpParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *SecurityGroupRule) SetId(v string) { + o.Id = &v +} + +// GetIpRange returns the IpRange field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetIpRange() string { + if o == nil || IsNil(o.IpRange) { + var ret string + return ret + } + return *o.IpRange +} + +// GetIpRangeOk returns a tuple with the IpRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetIpRangeOk() (*string, bool) { + if o == nil || IsNil(o.IpRange) { + return nil, false + } + return o.IpRange, true +} + +// HasIpRange returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasIpRange() bool { + if o != nil && !IsNil(o.IpRange) { + return true + } + + return false +} + +// SetIpRange gets a reference to the given string and assigns it to the IpRange field. +func (o *SecurityGroupRule) SetIpRange(v string) { + o.IpRange = &v +} + +// GetPortRange returns the PortRange field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetPortRange() PortRange { + if o == nil || IsNil(o.PortRange) { + var ret PortRange + return ret + } + return *o.PortRange +} + +// GetPortRangeOk returns a tuple with the PortRange field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetPortRangeOk() (*PortRange, bool) { + if o == nil || IsNil(o.PortRange) { + return nil, false + } + return o.PortRange, true +} + +// HasPortRange returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasPortRange() bool { + if o != nil && !IsNil(o.PortRange) { + return true + } + + return false +} + +// SetPortRange gets a reference to the given PortRange and assigns it to the PortRange field. +func (o *SecurityGroupRule) SetPortRange(v PortRange) { + o.PortRange = &v +} + +// GetRemoteSecurityGroupId returns the RemoteSecurityGroupId field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetRemoteSecurityGroupId() string { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + var ret string + return ret + } + return *o.RemoteSecurityGroupId +} + +// GetRemoteSecurityGroupIdOk returns a tuple with the RemoteSecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetRemoteSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.RemoteSecurityGroupId) { + return nil, false + } + return o.RemoteSecurityGroupId, true +} + +// HasRemoteSecurityGroupId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasRemoteSecurityGroupId() bool { + if o != nil && !IsNil(o.RemoteSecurityGroupId) { + return true + } + + return false +} + +// SetRemoteSecurityGroupId gets a reference to the given string and assigns it to the RemoteSecurityGroupId field. +func (o *SecurityGroupRule) SetRemoteSecurityGroupId(v string) { + o.RemoteSecurityGroupId = &v +} + +// GetSecurityGroupId returns the SecurityGroupId field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetSecurityGroupId() string { + if o == nil || IsNil(o.SecurityGroupId) { + var ret string + return ret + } + return *o.SecurityGroupId +} + +// GetSecurityGroupIdOk returns a tuple with the SecurityGroupId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetSecurityGroupIdOk() (*string, bool) { + if o == nil || IsNil(o.SecurityGroupId) { + return nil, false + } + return o.SecurityGroupId, true +} + +// HasSecurityGroupId returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasSecurityGroupId() bool { + if o != nil && !IsNil(o.SecurityGroupId) { + return true + } + + return false +} + +// SetSecurityGroupId gets a reference to the given string and assigns it to the SecurityGroupId field. +func (o *SecurityGroupRule) SetSecurityGroupId(v string) { + o.SecurityGroupId = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *SecurityGroupRule) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SecurityGroupRule) GetProtocol() Protocol { + if o == nil || IsNil(o.Protocol) { + var ret Protocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRule) GetProtocolOk() (*Protocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SecurityGroupRule) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +func (o *SecurityGroupRule) SetProtocol(v Protocol) { + o.Protocol = &v +} + +func (o SecurityGroupRule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + toSerialize["direction"] = o.Direction + if !IsNil(o.Ethertype) { + toSerialize["ethertype"] = o.Ethertype + } + if !IsNil(o.IcmpParameters) { + toSerialize["icmpParameters"] = o.IcmpParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.IpRange) { + toSerialize["ipRange"] = o.IpRange + } + if !IsNil(o.PortRange) { + toSerialize["portRange"] = o.PortRange + } + if !IsNil(o.RemoteSecurityGroupId) { + toSerialize["remoteSecurityGroupId"] = o.RemoteSecurityGroupId + } + if !IsNil(o.SecurityGroupId) { + toSerialize["securityGroupId"] = o.SecurityGroupId + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +func (o *SecurityGroupRule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "direction", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupRule := _SecurityGroupRule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupRule) + + if err != nil { + return err + } + + *o = SecurityGroupRule(varSecurityGroupRule) + + return err +} + +type NullableSecurityGroupRule struct { + value *SecurityGroupRule + isSet bool +} + +func (v NullableSecurityGroupRule) Get() *SecurityGroupRule { + return v.value +} + +func (v *NullableSecurityGroupRule) Set(val *SecurityGroupRule) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRule) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRule(val *SecurityGroupRule) *NullableSecurityGroupRule { + return &NullableSecurityGroupRule{value: val, isSet: true} +} + +func (v NullableSecurityGroupRule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_security_group_rule_list_response.go b/services/iaas/v2beta1api/model_security_group_rule_list_response.go new file mode 100644 index 000000000..085b38f44 --- /dev/null +++ b/services/iaas/v2beta1api/model_security_group_rule_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SecurityGroupRuleListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRuleListResponse{} + +// SecurityGroupRuleListResponse Security group rule list response. +type SecurityGroupRuleListResponse struct { + // A list containing security group rule objects. + Items []SecurityGroupRule `json:"items"` +} + +type _SecurityGroupRuleListResponse SecurityGroupRuleListResponse + +// NewSecurityGroupRuleListResponse instantiates a new SecurityGroupRuleListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRuleListResponse(items []SecurityGroupRule) *SecurityGroupRuleListResponse { + this := SecurityGroupRuleListResponse{} + this.Items = items + return &this +} + +// NewSecurityGroupRuleListResponseWithDefaults instantiates a new SecurityGroupRuleListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleListResponseWithDefaults() *SecurityGroupRuleListResponse { + this := SecurityGroupRuleListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SecurityGroupRuleListResponse) GetItems() []SecurityGroupRule { + if o == nil { + var ret []SecurityGroupRule + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SecurityGroupRuleListResponse) GetItemsOk() ([]SecurityGroupRule, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SecurityGroupRuleListResponse) SetItems(v []SecurityGroupRule) { + o.Items = v +} + +func (o SecurityGroupRuleListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRuleListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SecurityGroupRuleListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSecurityGroupRuleListResponse := _SecurityGroupRuleListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSecurityGroupRuleListResponse) + + if err != nil { + return err + } + + *o = SecurityGroupRuleListResponse(varSecurityGroupRuleListResponse) + + return err +} + +type NullableSecurityGroupRuleListResponse struct { + value *SecurityGroupRuleListResponse + isSet bool +} + +func (v NullableSecurityGroupRuleListResponse) Get() *SecurityGroupRuleListResponse { + return v.value +} + +func (v *NullableSecurityGroupRuleListResponse) Set(val *SecurityGroupRuleListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRuleListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRuleListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRuleListResponse(val *SecurityGroupRuleListResponse) *NullableSecurityGroupRuleListResponse { + return &NullableSecurityGroupRuleListResponse{value: val, isSet: true} +} + +func (v NullableSecurityGroupRuleListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRuleListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_security_group_rule_protocol.go b/services/iaas/v2beta1api/model_security_group_rule_protocol.go new file mode 100644 index 000000000..2e170c041 --- /dev/null +++ b/services/iaas/v2beta1api/model_security_group_rule_protocol.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the SecurityGroupRuleProtocol type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SecurityGroupRuleProtocol{} + +// SecurityGroupRuleProtocol The internet protocol which the rule matches. +type SecurityGroupRuleProtocol struct { + Protocol *Protocol `json:"protocol,omitempty"` +} + +// NewSecurityGroupRuleProtocol instantiates a new SecurityGroupRuleProtocol object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSecurityGroupRuleProtocol() *SecurityGroupRuleProtocol { + this := SecurityGroupRuleProtocol{} + return &this +} + +// NewSecurityGroupRuleProtocolWithDefaults instantiates a new SecurityGroupRuleProtocol object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSecurityGroupRuleProtocolWithDefaults() *SecurityGroupRuleProtocol { + this := SecurityGroupRuleProtocol{} + return &this +} + +// GetProtocol returns the Protocol field value if set, zero value otherwise. +func (o *SecurityGroupRuleProtocol) GetProtocol() Protocol { + if o == nil || IsNil(o.Protocol) { + var ret Protocol + return ret + } + return *o.Protocol +} + +// GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SecurityGroupRuleProtocol) GetProtocolOk() (*Protocol, bool) { + if o == nil || IsNil(o.Protocol) { + return nil, false + } + return o.Protocol, true +} + +// HasProtocol returns a boolean if a field has been set. +func (o *SecurityGroupRuleProtocol) HasProtocol() bool { + if o != nil && !IsNil(o.Protocol) { + return true + } + + return false +} + +// SetProtocol gets a reference to the given Protocol and assigns it to the Protocol field. +func (o *SecurityGroupRuleProtocol) SetProtocol(v Protocol) { + o.Protocol = &v +} + +func (o SecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SecurityGroupRuleProtocol) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Protocol) { + toSerialize["protocol"] = o.Protocol + } + return toSerialize, nil +} + +type NullableSecurityGroupRuleProtocol struct { + value *SecurityGroupRuleProtocol + isSet bool +} + +func (v NullableSecurityGroupRuleProtocol) Get() *SecurityGroupRuleProtocol { + return v.value +} + +func (v *NullableSecurityGroupRuleProtocol) Set(val *SecurityGroupRuleProtocol) { + v.value = val + v.isSet = true +} + +func (v NullableSecurityGroupRuleProtocol) IsSet() bool { + return v.isSet +} + +func (v *NullableSecurityGroupRuleProtocol) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSecurityGroupRuleProtocol(val *SecurityGroupRuleProtocol) *NullableSecurityGroupRuleProtocol { + return &NullableSecurityGroupRuleProtocol{value: val, isSet: true} +} + +func (v NullableSecurityGroupRuleProtocol) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSecurityGroupRuleProtocol) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_server.go b/services/iaas/v2beta1api/model_server.go new file mode 100644 index 000000000..e1dfd0436 --- /dev/null +++ b/services/iaas/v2beta1api/model_server.go @@ -0,0 +1,998 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Server type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Server{} + +// Server Representation of a single server object. +type Server struct { + // The affinity group the server is assigned to. + AffinityGroup *string `json:"affinityGroup,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + Agent *ServerAgent `json:"agent,omitempty"` + // This is the availability zone requested during server creation. If none is provided during the creation request and an existing volume will be used as boot volume it will be set to the same availability zone as the volume. For requests with no volumes involved it will be set to the metro availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + BootVolume *BootVolume `json:"bootVolume,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // An error message. + ErrorMessage *string `json:"errorMessage,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + ImageId *string `json:"imageId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The SSH keypair used during the server creation. + KeypairName *string `json:"keypairName,omitempty" validate:"regexp=^[A-Za-z0-9@._-]*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Date-time when resource was launched. + LaunchedAt *time.Time `json:"launchedAt,omitempty"` + // Name of the machine type the server shall belong to. + MachineType string `json:"machineType" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + MaintenanceWindow *ServerMaintenance `json:"maintenanceWindow,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name string `json:"name" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` + Networking *ServerNetworking `json:"networking,omitempty"` + // The list of network interfaces (NICs) attached to the server. Only shown when detailed information is requested. + Nics []ServerNetwork `json:"nics,omitempty"` + // The power status of a server. Possible values: `CRASHED`, `ERROR`, `RUNNING`, `STOPPED`. + PowerStatus *string `json:"powerStatus,omitempty"` + // The initial security groups for the server creation. + SecurityGroups []string `json:"securityGroups,omitempty"` + // A list of service account mails. Only shown when detailed information is requested. + ServiceAccountMails []string `json:"serviceAccountMails,omitempty"` + // The status of a server object. Possible values: `ACTIVE`, `BACKING-UP`, `CREATING`, `DEALLOCATED`, `DEALLOCATING`, `DELETED`, `DELETING`, `ERROR`, `INACTIVE`, `MIGRATING`, `PAUSED`, `REBOOT`, `REBOOTING`, `REBUILD`, `REBUILDING`, `RESCUE`, `RESCUING`, `RESIZING`, `RESTORING`, `SNAPSHOTTING`, `STARTING`, `STOPPING`, `UNRESCUING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // User Data that is provided to the server. Must be base64 encoded and is passed via cloud-init to the server. Only shown when detailed information is requested. + UserData *string `json:"userData,omitempty"` + // The list of volumes attached to the server. + Volumes []string `json:"volumes,omitempty"` +} + +type _Server Server + +// NewServer instantiates a new Server object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServer(machineType string, name string) *Server { + this := Server{} + this.MachineType = machineType + this.Name = name + return &this +} + +// NewServerWithDefaults instantiates a new Server object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerWithDefaults() *Server { + this := Server{} + return &this +} + +// GetAffinityGroup returns the AffinityGroup field value if set, zero value otherwise. +func (o *Server) GetAffinityGroup() string { + if o == nil || IsNil(o.AffinityGroup) { + var ret string + return ret + } + return *o.AffinityGroup +} + +// GetAffinityGroupOk returns a tuple with the AffinityGroup field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAffinityGroupOk() (*string, bool) { + if o == nil || IsNil(o.AffinityGroup) { + return nil, false + } + return o.AffinityGroup, true +} + +// HasAffinityGroup returns a boolean if a field has been set. +func (o *Server) HasAffinityGroup() bool { + if o != nil && !IsNil(o.AffinityGroup) { + return true + } + + return false +} + +// SetAffinityGroup gets a reference to the given string and assigns it to the AffinityGroup field. +func (o *Server) SetAffinityGroup(v string) { + o.AffinityGroup = &v +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *Server) GetAgent() ServerAgent { + if o == nil || IsNil(o.Agent) { + var ret ServerAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAgentOk() (*ServerAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *Server) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ServerAgent and assigns it to the Agent field. +func (o *Server) SetAgent(v ServerAgent) { + o.Agent = &v +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *Server) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *Server) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *Server) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetBootVolume returns the BootVolume field value if set, zero value otherwise. +func (o *Server) GetBootVolume() BootVolume { + if o == nil || IsNil(o.BootVolume) { + var ret BootVolume + return ret + } + return *o.BootVolume +} + +// GetBootVolumeOk returns a tuple with the BootVolume field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetBootVolumeOk() (*BootVolume, bool) { + if o == nil || IsNil(o.BootVolume) { + return nil, false + } + return o.BootVolume, true +} + +// HasBootVolume returns a boolean if a field has been set. +func (o *Server) HasBootVolume() bool { + if o != nil && !IsNil(o.BootVolume) { + return true + } + + return false +} + +// SetBootVolume gets a reference to the given BootVolume and assigns it to the BootVolume field. +func (o *Server) SetBootVolume(v BootVolume) { + o.BootVolume = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Server) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Server) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Server) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetErrorMessage returns the ErrorMessage field value if set, zero value otherwise. +func (o *Server) GetErrorMessage() string { + if o == nil || IsNil(o.ErrorMessage) { + var ret string + return ret + } + return *o.ErrorMessage +} + +// GetErrorMessageOk returns a tuple with the ErrorMessage field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetErrorMessageOk() (*string, bool) { + if o == nil || IsNil(o.ErrorMessage) { + return nil, false + } + return o.ErrorMessage, true +} + +// HasErrorMessage returns a boolean if a field has been set. +func (o *Server) HasErrorMessage() bool { + if o != nil && !IsNil(o.ErrorMessage) { + return true + } + + return false +} + +// SetErrorMessage gets a reference to the given string and assigns it to the ErrorMessage field. +func (o *Server) SetErrorMessage(v string) { + o.ErrorMessage = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Server) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Server) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Server) SetId(v string) { + o.Id = &v +} + +// GetImageId returns the ImageId field value if set, zero value otherwise. +func (o *Server) GetImageId() string { + if o == nil || IsNil(o.ImageId) { + var ret string + return ret + } + return *o.ImageId +} + +// GetImageIdOk returns a tuple with the ImageId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetImageIdOk() (*string, bool) { + if o == nil || IsNil(o.ImageId) { + return nil, false + } + return o.ImageId, true +} + +// HasImageId returns a boolean if a field has been set. +func (o *Server) HasImageId() bool { + if o != nil && !IsNil(o.ImageId) { + return true + } + + return false +} + +// SetImageId gets a reference to the given string and assigns it to the ImageId field. +func (o *Server) SetImageId(v string) { + o.ImageId = &v +} + +// GetKeypairName returns the KeypairName field value if set, zero value otherwise. +func (o *Server) GetKeypairName() string { + if o == nil || IsNil(o.KeypairName) { + var ret string + return ret + } + return *o.KeypairName +} + +// GetKeypairNameOk returns a tuple with the KeypairName field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetKeypairNameOk() (*string, bool) { + if o == nil || IsNil(o.KeypairName) { + return nil, false + } + return o.KeypairName, true +} + +// HasKeypairName returns a boolean if a field has been set. +func (o *Server) HasKeypairName() bool { + if o != nil && !IsNil(o.KeypairName) { + return true + } + + return false +} + +// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field. +func (o *Server) SetKeypairName(v string) { + o.KeypairName = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Server) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Server) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Server) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetLaunchedAt returns the LaunchedAt field value if set, zero value otherwise. +func (o *Server) GetLaunchedAt() time.Time { + if o == nil || IsNil(o.LaunchedAt) { + var ret time.Time + return ret + } + return *o.LaunchedAt +} + +// GetLaunchedAtOk returns a tuple with the LaunchedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetLaunchedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.LaunchedAt) { + return nil, false + } + return o.LaunchedAt, true +} + +// HasLaunchedAt returns a boolean if a field has been set. +func (o *Server) HasLaunchedAt() bool { + if o != nil && !IsNil(o.LaunchedAt) { + return true + } + + return false +} + +// SetLaunchedAt gets a reference to the given time.Time and assigns it to the LaunchedAt field. +func (o *Server) SetLaunchedAt(v time.Time) { + o.LaunchedAt = &v +} + +// GetMachineType returns the MachineType field value +func (o *Server) GetMachineType() string { + if o == nil { + var ret string + return ret + } + + return o.MachineType +} + +// GetMachineTypeOk returns a tuple with the MachineType field value +// and a boolean to check if the value has been set. +func (o *Server) GetMachineTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.MachineType, true +} + +// SetMachineType sets field value +func (o *Server) SetMachineType(v string) { + o.MachineType = v +} + +// GetMaintenanceWindow returns the MaintenanceWindow field value if set, zero value otherwise. +func (o *Server) GetMaintenanceWindow() ServerMaintenance { + if o == nil || IsNil(o.MaintenanceWindow) { + var ret ServerMaintenance + return ret + } + return *o.MaintenanceWindow +} + +// GetMaintenanceWindowOk returns a tuple with the MaintenanceWindow field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetMaintenanceWindowOk() (*ServerMaintenance, bool) { + if o == nil || IsNil(o.MaintenanceWindow) { + return nil, false + } + return o.MaintenanceWindow, true +} + +// HasMaintenanceWindow returns a boolean if a field has been set. +func (o *Server) HasMaintenanceWindow() bool { + if o != nil && !IsNil(o.MaintenanceWindow) { + return true + } + + return false +} + +// SetMaintenanceWindow gets a reference to the given ServerMaintenance and assigns it to the MaintenanceWindow field. +func (o *Server) SetMaintenanceWindow(v ServerMaintenance) { + o.MaintenanceWindow = &v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *Server) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *Server) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *Server) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value +func (o *Server) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Server) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Server) SetName(v string) { + o.Name = v +} + +// GetNetworking returns the Networking field value if set, zero value otherwise. +func (o *Server) GetNetworking() ServerNetworking { + if o == nil || IsNil(o.Networking) { + var ret ServerNetworking + return ret + } + return *o.Networking +} + +// GetNetworkingOk returns a tuple with the Networking field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetNetworkingOk() (*ServerNetworking, bool) { + if o == nil || IsNil(o.Networking) { + return nil, false + } + return o.Networking, true +} + +// HasNetworking returns a boolean if a field has been set. +func (o *Server) HasNetworking() bool { + if o != nil && !IsNil(o.Networking) { + return true + } + + return false +} + +// SetNetworking gets a reference to the given ServerNetworking and assigns it to the Networking field. +func (o *Server) SetNetworking(v ServerNetworking) { + o.Networking = &v +} + +// GetNics returns the Nics field value if set, zero value otherwise. +func (o *Server) GetNics() []ServerNetwork { + if o == nil || IsNil(o.Nics) { + var ret []ServerNetwork + return ret + } + return o.Nics +} + +// GetNicsOk returns a tuple with the Nics field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetNicsOk() ([]ServerNetwork, bool) { + if o == nil || IsNil(o.Nics) { + return nil, false + } + return o.Nics, true +} + +// HasNics returns a boolean if a field has been set. +func (o *Server) HasNics() bool { + if o != nil && !IsNil(o.Nics) { + return true + } + + return false +} + +// SetNics gets a reference to the given []ServerNetwork and assigns it to the Nics field. +func (o *Server) SetNics(v []ServerNetwork) { + o.Nics = v +} + +// GetPowerStatus returns the PowerStatus field value if set, zero value otherwise. +func (o *Server) GetPowerStatus() string { + if o == nil || IsNil(o.PowerStatus) { + var ret string + return ret + } + return *o.PowerStatus +} + +// GetPowerStatusOk returns a tuple with the PowerStatus field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetPowerStatusOk() (*string, bool) { + if o == nil || IsNil(o.PowerStatus) { + return nil, false + } + return o.PowerStatus, true +} + +// HasPowerStatus returns a boolean if a field has been set. +func (o *Server) HasPowerStatus() bool { + if o != nil && !IsNil(o.PowerStatus) { + return true + } + + return false +} + +// SetPowerStatus gets a reference to the given string and assigns it to the PowerStatus field. +func (o *Server) SetPowerStatus(v string) { + o.PowerStatus = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *Server) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *Server) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *Server) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +// GetServiceAccountMails returns the ServiceAccountMails field value if set, zero value otherwise. +func (o *Server) GetServiceAccountMails() []string { + if o == nil || IsNil(o.ServiceAccountMails) { + var ret []string + return ret + } + return o.ServiceAccountMails +} + +// GetServiceAccountMailsOk returns a tuple with the ServiceAccountMails field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetServiceAccountMailsOk() ([]string, bool) { + if o == nil || IsNil(o.ServiceAccountMails) { + return nil, false + } + return o.ServiceAccountMails, true +} + +// HasServiceAccountMails returns a boolean if a field has been set. +func (o *Server) HasServiceAccountMails() bool { + if o != nil && !IsNil(o.ServiceAccountMails) { + return true + } + + return false +} + +// SetServiceAccountMails gets a reference to the given []string and assigns it to the ServiceAccountMails field. +func (o *Server) SetServiceAccountMails(v []string) { + o.ServiceAccountMails = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Server) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Server) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Server) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Server) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Server) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Server) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetUserData returns the UserData field value if set, zero value otherwise. +func (o *Server) GetUserData() string { + if o == nil || IsNil(o.UserData) { + var ret string + return ret + } + return *o.UserData +} + +// GetUserDataOk returns a tuple with the UserData field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetUserDataOk() (*string, bool) { + if o == nil || IsNil(o.UserData) { + return nil, false + } + return o.UserData, true +} + +// HasUserData returns a boolean if a field has been set. +func (o *Server) HasUserData() bool { + if o != nil && !IsNil(o.UserData) { + return true + } + + return false +} + +// SetUserData gets a reference to the given string and assigns it to the UserData field. +func (o *Server) SetUserData(v string) { + o.UserData = &v +} + +// GetVolumes returns the Volumes field value if set, zero value otherwise. +func (o *Server) GetVolumes() []string { + if o == nil || IsNil(o.Volumes) { + var ret []string + return ret + } + return o.Volumes +} + +// GetVolumesOk returns a tuple with the Volumes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Server) GetVolumesOk() ([]string, bool) { + if o == nil || IsNil(o.Volumes) { + return nil, false + } + return o.Volumes, true +} + +// HasVolumes returns a boolean if a field has been set. +func (o *Server) HasVolumes() bool { + if o != nil && !IsNil(o.Volumes) { + return true + } + + return false +} + +// SetVolumes gets a reference to the given []string and assigns it to the Volumes field. +func (o *Server) SetVolumes(v []string) { + o.Volumes = v +} + +func (o Server) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Server) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AffinityGroup) { + toSerialize["affinityGroup"] = o.AffinityGroup + } + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.BootVolume) { + toSerialize["bootVolume"] = o.BootVolume + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.ErrorMessage) { + toSerialize["errorMessage"] = o.ErrorMessage + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageId) { + toSerialize["imageId"] = o.ImageId + } + if !IsNil(o.KeypairName) { + toSerialize["keypairName"] = o.KeypairName + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.LaunchedAt) { + toSerialize["launchedAt"] = o.LaunchedAt + } + toSerialize["machineType"] = o.MachineType + if !IsNil(o.MaintenanceWindow) { + toSerialize["maintenanceWindow"] = o.MaintenanceWindow + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + toSerialize["name"] = o.Name + if !IsNil(o.Networking) { + toSerialize["networking"] = o.Networking + } + if !IsNil(o.Nics) { + toSerialize["nics"] = o.Nics + } + if !IsNil(o.PowerStatus) { + toSerialize["powerStatus"] = o.PowerStatus + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + if !IsNil(o.ServiceAccountMails) { + toSerialize["serviceAccountMails"] = o.ServiceAccountMails + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.UserData) { + toSerialize["userData"] = o.UserData + } + if !IsNil(o.Volumes) { + toSerialize["volumes"] = o.Volumes + } + return toSerialize, nil +} + +func (o *Server) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "machineType", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServer := _Server{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServer) + + if err != nil { + return err + } + + *o = Server(varServer) + + return err +} + +type NullableServer struct { + value *Server + isSet bool +} + +func (v NullableServer) Get() *Server { + return v.value +} + +func (v *NullableServer) Set(val *Server) { + v.value = val + v.isSet = true +} + +func (v NullableServer) IsSet() bool { + return v.isSet +} + +func (v *NullableServer) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServer(val *Server) *NullableServer { + return &NullableServer{value: val, isSet: true} +} + +func (v NullableServer) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServer) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_server_agent.go b/services/iaas/v2beta1api/model_server_agent.go new file mode 100644 index 000000000..a83dabbe3 --- /dev/null +++ b/services/iaas/v2beta1api/model_server_agent.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the ServerAgent type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerAgent{} + +// ServerAgent STACKIT server agent options for a server. +type ServerAgent struct { + // Configure the STACKIT server agent provisioning during the first boot of the server. Only works when booting from an images that supports the STACKIT server agent. When `false` the agent IS NOT installed. When `true` the agent IS installed. When its not set the result depend on the used image and its default provisioning setting. + Provisioned *bool `json:"provisioned,omitempty"` +} + +// NewServerAgent instantiates a new ServerAgent object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerAgent() *ServerAgent { + this := ServerAgent{} + return &this +} + +// NewServerAgentWithDefaults instantiates a new ServerAgent object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerAgentWithDefaults() *ServerAgent { + this := ServerAgent{} + return &this +} + +// GetProvisioned returns the Provisioned field value if set, zero value otherwise. +func (o *ServerAgent) GetProvisioned() bool { + if o == nil || IsNil(o.Provisioned) { + var ret bool + return ret + } + return *o.Provisioned +} + +// GetProvisionedOk returns a tuple with the Provisioned field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerAgent) GetProvisionedOk() (*bool, bool) { + if o == nil || IsNil(o.Provisioned) { + return nil, false + } + return o.Provisioned, true +} + +// HasProvisioned returns a boolean if a field has been set. +func (o *ServerAgent) HasProvisioned() bool { + if o != nil && !IsNil(o.Provisioned) { + return true + } + + return false +} + +// SetProvisioned gets a reference to the given bool and assigns it to the Provisioned field. +func (o *ServerAgent) SetProvisioned(v bool) { + o.Provisioned = &v +} + +func (o ServerAgent) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerAgent) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Provisioned) { + toSerialize["provisioned"] = o.Provisioned + } + return toSerialize, nil +} + +type NullableServerAgent struct { + value *ServerAgent + isSet bool +} + +func (v NullableServerAgent) Get() *ServerAgent { + return v.value +} + +func (v *NullableServerAgent) Set(val *ServerAgent) { + v.value = val + v.isSet = true +} + +func (v NullableServerAgent) IsSet() bool { + return v.isSet +} + +func (v *NullableServerAgent) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerAgent(val *ServerAgent) *NullableServerAgent { + return &NullableServerAgent{value: val, isSet: true} +} + +func (v NullableServerAgent) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerAgent) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_server_console_url.go b/services/iaas/v2beta1api/model_server_console_url.go new file mode 100644 index 000000000..00ad71d78 --- /dev/null +++ b/services/iaas/v2beta1api/model_server_console_url.go @@ -0,0 +1,157 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerConsoleUrl type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerConsoleUrl{} + +// ServerConsoleUrl Object that represents a server console URL. +type ServerConsoleUrl struct { + Url string `json:"url"` +} + +type _ServerConsoleUrl ServerConsoleUrl + +// NewServerConsoleUrl instantiates a new ServerConsoleUrl object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerConsoleUrl(url string) *ServerConsoleUrl { + this := ServerConsoleUrl{} + this.Url = url + return &this +} + +// NewServerConsoleUrlWithDefaults instantiates a new ServerConsoleUrl object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerConsoleUrlWithDefaults() *ServerConsoleUrl { + this := ServerConsoleUrl{} + return &this +} + +// GetUrl returns the Url field value +func (o *ServerConsoleUrl) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *ServerConsoleUrl) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *ServerConsoleUrl) SetUrl(v string) { + o.Url = v +} + +func (o ServerConsoleUrl) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerConsoleUrl) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["url"] = o.Url + return toSerialize, nil +} + +func (o *ServerConsoleUrl) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "url", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerConsoleUrl := _ServerConsoleUrl{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerConsoleUrl) + + if err != nil { + return err + } + + *o = ServerConsoleUrl(varServerConsoleUrl) + + return err +} + +type NullableServerConsoleUrl struct { + value *ServerConsoleUrl + isSet bool +} + +func (v NullableServerConsoleUrl) Get() *ServerConsoleUrl { + return v.value +} + +func (v *NullableServerConsoleUrl) Set(val *ServerConsoleUrl) { + v.value = val + v.isSet = true +} + +func (v NullableServerConsoleUrl) IsSet() bool { + return v.isSet +} + +func (v *NullableServerConsoleUrl) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerConsoleUrl(val *ServerConsoleUrl) *NullableServerConsoleUrl { + return &NullableServerConsoleUrl{value: val, isSet: true} +} + +func (v NullableServerConsoleUrl) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerConsoleUrl) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_server_list_response.go b/services/iaas/v2beta1api/model_server_list_response.go new file mode 100644 index 000000000..f1e5b087e --- /dev/null +++ b/services/iaas/v2beta1api/model_server_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerListResponse{} + +// ServerListResponse Response object for server list request. +type ServerListResponse struct { + // A list of servers. + Items []Server `json:"items"` +} + +type _ServerListResponse ServerListResponse + +// NewServerListResponse instantiates a new ServerListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerListResponse(items []Server) *ServerListResponse { + this := ServerListResponse{} + this.Items = items + return &this +} + +// NewServerListResponseWithDefaults instantiates a new ServerListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerListResponseWithDefaults() *ServerListResponse { + this := ServerListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ServerListResponse) GetItems() []Server { + if o == nil { + var ret []Server + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ServerListResponse) GetItemsOk() ([]Server, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ServerListResponse) SetItems(v []Server) { + o.Items = v +} + +func (o ServerListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ServerListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerListResponse := _ServerListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerListResponse) + + if err != nil { + return err + } + + *o = ServerListResponse(varServerListResponse) + + return err +} + +type NullableServerListResponse struct { + value *ServerListResponse + isSet bool +} + +func (v NullableServerListResponse) Get() *ServerListResponse { + return v.value +} + +func (v *NullableServerListResponse) Set(val *ServerListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableServerListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableServerListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerListResponse(val *ServerListResponse) *NullableServerListResponse { + return &NullableServerListResponse{value: val, isSet: true} +} + +func (v NullableServerListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_server_maintenance.go b/services/iaas/v2beta1api/model_server_maintenance.go new file mode 100644 index 000000000..fef66fb4c --- /dev/null +++ b/services/iaas/v2beta1api/model_server_maintenance.go @@ -0,0 +1,253 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the ServerMaintenance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerMaintenance{} + +// ServerMaintenance Object that represents the information about the next planned server maintenance window. +type ServerMaintenance struct { + Details *string `json:"details,omitempty"` + // End of the maintenance window. + EndsAt time.Time `json:"endsAt"` + // Start of the maintenance window. + StartsAt time.Time `json:"startsAt"` + // Possible values: `PLANNED`, `ONGOING`. + Status string `json:"status"` +} + +type _ServerMaintenance ServerMaintenance + +// NewServerMaintenance instantiates a new ServerMaintenance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerMaintenance(endsAt time.Time, startsAt time.Time, status string) *ServerMaintenance { + this := ServerMaintenance{} + this.EndsAt = endsAt + this.StartsAt = startsAt + this.Status = status + return &this +} + +// NewServerMaintenanceWithDefaults instantiates a new ServerMaintenance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerMaintenanceWithDefaults() *ServerMaintenance { + this := ServerMaintenance{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *ServerMaintenance) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *ServerMaintenance) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *ServerMaintenance) SetDetails(v string) { + o.Details = &v +} + +// GetEndsAt returns the EndsAt field value +func (o *ServerMaintenance) GetEndsAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.EndsAt +} + +// GetEndsAtOk returns a tuple with the EndsAt field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetEndsAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.EndsAt, true +} + +// SetEndsAt sets field value +func (o *ServerMaintenance) SetEndsAt(v time.Time) { + o.EndsAt = v +} + +// GetStartsAt returns the StartsAt field value +func (o *ServerMaintenance) GetStartsAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.StartsAt +} + +// GetStartsAtOk returns a tuple with the StartsAt field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetStartsAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.StartsAt, true +} + +// SetStartsAt sets field value +func (o *ServerMaintenance) SetStartsAt(v time.Time) { + o.StartsAt = v +} + +// GetStatus returns the Status field value +func (o *ServerMaintenance) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ServerMaintenance) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *ServerMaintenance) SetStatus(v string) { + o.Status = v +} + +func (o ServerMaintenance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerMaintenance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["endsAt"] = o.EndsAt + toSerialize["startsAt"] = o.StartsAt + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *ServerMaintenance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "endsAt", + "startsAt", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerMaintenance := _ServerMaintenance{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerMaintenance) + + if err != nil { + return err + } + + *o = ServerMaintenance(varServerMaintenance) + + return err +} + +type NullableServerMaintenance struct { + value *ServerMaintenance + isSet bool +} + +func (v NullableServerMaintenance) Get() *ServerMaintenance { + return v.value +} + +func (v *NullableServerMaintenance) Set(val *ServerMaintenance) { + v.value = val + v.isSet = true +} + +func (v NullableServerMaintenance) IsSet() bool { + return v.isSet +} + +func (v *NullableServerMaintenance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerMaintenance(val *ServerMaintenance) *NullableServerMaintenance { + return &NullableServerMaintenance{value: val, isSet: true} +} + +func (v NullableServerMaintenance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerMaintenance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_server_network.go b/services/iaas/v2beta1api/model_server_network.go new file mode 100644 index 000000000..ab6bb2231 --- /dev/null +++ b/services/iaas/v2beta1api/model_server_network.go @@ -0,0 +1,459 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServerNetwork type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServerNetwork{} + +// ServerNetwork Describes the object that matches servers to its networks. +type ServerNetwork struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Object that represents an IP address. + Ipv4 *string `json:"ipv4,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // String that represents an IPv6 address. + Ipv6 *string `json:"ipv6,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // Object that represents an MAC address. + Mac string `json:"mac" validate:"regexp=^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"` + // Universally Unique Identifier (UUID). + NetworkId string `json:"networkId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The name for a General Object. Matches Names and also UUIDs. + NetworkName string `json:"networkName" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + NicId string `json:"nicId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // If this is set to false, then no security groups will apply to this server network interface. + NicSecurity bool `json:"nicSecurity"` + // Object that represents an IP address. + PublicIp *string `json:"publicIp,omitempty" validate:"regexp=((^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$)|(^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$))"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` +} + +type _ServerNetwork ServerNetwork + +// NewServerNetwork instantiates a new ServerNetwork object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServerNetwork(mac string, networkId string, networkName string, nicId string, nicSecurity bool) *ServerNetwork { + this := ServerNetwork{} + this.Mac = mac + this.NetworkId = networkId + this.NetworkName = networkName + this.NicId = nicId + this.NicSecurity = nicSecurity + return &this +} + +// NewServerNetworkWithDefaults instantiates a new ServerNetwork object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServerNetworkWithDefaults() *ServerNetwork { + this := ServerNetwork{} + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *ServerNetwork) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *ServerNetwork) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *ServerNetwork) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *ServerNetwork) GetIpv4() string { + if o == nil || IsNil(o.Ipv4) { + var ret string + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetIpv4Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *ServerNetwork) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given string and assigns it to the Ipv4 field. +func (o *ServerNetwork) SetIpv4(v string) { + o.Ipv4 = &v +} + +// GetIpv6 returns the Ipv6 field value if set, zero value otherwise. +func (o *ServerNetwork) GetIpv6() string { + if o == nil || IsNil(o.Ipv6) { + var ret string + return ret + } + return *o.Ipv6 +} + +// GetIpv6Ok returns a tuple with the Ipv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetIpv6Ok() (*string, bool) { + if o == nil || IsNil(o.Ipv6) { + return nil, false + } + return o.Ipv6, true +} + +// HasIpv6 returns a boolean if a field has been set. +func (o *ServerNetwork) HasIpv6() bool { + if o != nil && !IsNil(o.Ipv6) { + return true + } + + return false +} + +// SetIpv6 gets a reference to the given string and assigns it to the Ipv6 field. +func (o *ServerNetwork) SetIpv6(v string) { + o.Ipv6 = &v +} + +// GetMac returns the Mac field value +func (o *ServerNetwork) GetMac() string { + if o == nil { + var ret string + return ret + } + + return o.Mac +} + +// GetMacOk returns a tuple with the Mac field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetMacOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Mac, true +} + +// SetMac sets field value +func (o *ServerNetwork) SetMac(v string) { + o.Mac = v +} + +// GetNetworkId returns the NetworkId field value +func (o *ServerNetwork) GetNetworkId() string { + if o == nil { + var ret string + return ret + } + + return o.NetworkId +} + +// GetNetworkIdOk returns a tuple with the NetworkId field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNetworkIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NetworkId, true +} + +// SetNetworkId sets field value +func (o *ServerNetwork) SetNetworkId(v string) { + o.NetworkId = v +} + +// GetNetworkName returns the NetworkName field value +func (o *ServerNetwork) GetNetworkName() string { + if o == nil { + var ret string + return ret + } + + return o.NetworkName +} + +// GetNetworkNameOk returns a tuple with the NetworkName field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNetworkNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NetworkName, true +} + +// SetNetworkName sets field value +func (o *ServerNetwork) SetNetworkName(v string) { + o.NetworkName = v +} + +// GetNicId returns the NicId field value +func (o *ServerNetwork) GetNicId() string { + if o == nil { + var ret string + return ret + } + + return o.NicId +} + +// GetNicIdOk returns a tuple with the NicId field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNicIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.NicId, true +} + +// SetNicId sets field value +func (o *ServerNetwork) SetNicId(v string) { + o.NicId = v +} + +// GetNicSecurity returns the NicSecurity field value +func (o *ServerNetwork) GetNicSecurity() bool { + if o == nil { + var ret bool + return ret + } + + return o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetNicSecurityOk() (*bool, bool) { + if o == nil { + return nil, false + } + return &o.NicSecurity, true +} + +// SetNicSecurity sets field value +func (o *ServerNetwork) SetNicSecurity(v bool) { + o.NicSecurity = v +} + +// GetPublicIp returns the PublicIp field value if set, zero value otherwise. +func (o *ServerNetwork) GetPublicIp() string { + if o == nil || IsNil(o.PublicIp) { + var ret string + return ret + } + return *o.PublicIp +} + +// GetPublicIpOk returns a tuple with the PublicIp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetPublicIpOk() (*string, bool) { + if o == nil || IsNil(o.PublicIp) { + return nil, false + } + return o.PublicIp, true +} + +// HasPublicIp returns a boolean if a field has been set. +func (o *ServerNetwork) HasPublicIp() bool { + if o != nil && !IsNil(o.PublicIp) { + return true + } + + return false +} + +// SetPublicIp gets a reference to the given string and assigns it to the PublicIp field. +func (o *ServerNetwork) SetPublicIp(v string) { + o.PublicIp = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *ServerNetwork) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ServerNetwork) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *ServerNetwork) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *ServerNetwork) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +func (o ServerNetwork) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServerNetwork) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Ipv6) { + toSerialize["ipv6"] = o.Ipv6 + } + toSerialize["mac"] = o.Mac + toSerialize["networkId"] = o.NetworkId + toSerialize["networkName"] = o.NetworkName + toSerialize["nicId"] = o.NicId + toSerialize["nicSecurity"] = o.NicSecurity + if !IsNil(o.PublicIp) { + toSerialize["publicIp"] = o.PublicIp + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + return toSerialize, nil +} + +func (o *ServerNetwork) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "mac", + "networkId", + "networkName", + "nicId", + "nicSecurity", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServerNetwork := _ServerNetwork{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServerNetwork) + + if err != nil { + return err + } + + *o = ServerNetwork(varServerNetwork) + + return err +} + +type NullableServerNetwork struct { + value *ServerNetwork + isSet bool +} + +func (v NullableServerNetwork) Get() *ServerNetwork { + return v.value +} + +func (v *NullableServerNetwork) Set(val *ServerNetwork) { + v.value = val + v.isSet = true +} + +func (v NullableServerNetwork) IsSet() bool { + return v.isSet +} + +func (v *NullableServerNetwork) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerNetwork(val *ServerNetwork) *NullableServerNetwork { + return &NullableServerNetwork{value: val, isSet: true} +} + +func (v NullableServerNetwork) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerNetwork) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_server_networking.go b/services/iaas/v2beta1api/model_server_networking.go new file mode 100644 index 000000000..07b253cc7 --- /dev/null +++ b/services/iaas/v2beta1api/model_server_networking.go @@ -0,0 +1,160 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// ServerNetworking - The initial networking setup for the server creation. A network, a nic or nothing can be given. +type ServerNetworking struct { + CreateServerNetworking *CreateServerNetworking + CreateServerNetworkingWithNics *CreateServerNetworkingWithNics +} + +// CreateServerNetworkingAsServerNetworking is a convenience function that returns CreateServerNetworking wrapped in ServerNetworking +func CreateServerNetworkingAsServerNetworking(v *CreateServerNetworking) ServerNetworking { + return ServerNetworking{ + CreateServerNetworking: v, + } +} + +// CreateServerNetworkingWithNicsAsServerNetworking is a convenience function that returns CreateServerNetworkingWithNics wrapped in ServerNetworking +func CreateServerNetworkingWithNicsAsServerNetworking(v *CreateServerNetworkingWithNics) ServerNetworking { + return ServerNetworking{ + CreateServerNetworkingWithNics: v, + } +} + +// Unmarshal JSON data into one of the pointers in the struct +func (dst *ServerNetworking) UnmarshalJSON(data []byte) error { + var err error + match := 0 + // try to unmarshal data into CreateServerNetworking + err = json.Unmarshal(data, &dst.CreateServerNetworking) + if err == nil { + jsonCreateServerNetworking, _ := json.Marshal(dst.CreateServerNetworking) + if string(jsonCreateServerNetworking) == "{}" { // empty struct + dst.CreateServerNetworking = nil + } else { + match++ + } + } else { + dst.CreateServerNetworking = nil + } + + // try to unmarshal data into CreateServerNetworkingWithNics + err = json.Unmarshal(data, &dst.CreateServerNetworkingWithNics) + if err == nil { + jsonCreateServerNetworkingWithNics, _ := json.Marshal(dst.CreateServerNetworkingWithNics) + if string(jsonCreateServerNetworkingWithNics) == "{}" { // empty struct + dst.CreateServerNetworkingWithNics = nil + } else { + match++ + } + } else { + dst.CreateServerNetworkingWithNics = nil + } + + if match > 1 { // more than 1 match + // reset to nil + dst.CreateServerNetworking = nil + dst.CreateServerNetworkingWithNics = nil + + return fmt.Errorf("data matches more than one schema in oneOf(ServerNetworking)") + } else if match == 1 { + return nil // exactly one match + } else { // no match + return fmt.Errorf("data failed to match schemas in oneOf(ServerNetworking)") + } +} + +// Marshal data from the first non-nil pointers in the struct to JSON +func (src ServerNetworking) MarshalJSON() ([]byte, error) { + if src.CreateServerNetworking != nil { + return json.Marshal(&src.CreateServerNetworking) + } + + if src.CreateServerNetworkingWithNics != nil { + return json.Marshal(&src.CreateServerNetworkingWithNics) + } + + return nil, nil // no data in oneOf schemas +} + +// Get the actual instance +func (obj *ServerNetworking) GetActualInstance() interface{} { + if obj == nil { + return nil + } + if obj.CreateServerNetworking != nil { + return obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +// Get the actual instance value +func (obj ServerNetworking) GetActualInstanceValue() interface{} { + if obj.CreateServerNetworking != nil { + return *obj.CreateServerNetworking + } + + if obj.CreateServerNetworkingWithNics != nil { + return *obj.CreateServerNetworkingWithNics + } + + // all schemas are nil + return nil +} + +type NullableServerNetworking struct { + value *ServerNetworking + isSet bool +} + +func (v NullableServerNetworking) Get() *ServerNetworking { + return v.value +} + +func (v *NullableServerNetworking) Set(val *ServerNetworking) { + v.value = val + v.isSet = true +} + +func (v NullableServerNetworking) IsSet() bool { + return v.isSet +} + +func (v *NullableServerNetworking) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServerNetworking(val *ServerNetworking) *NullableServerNetworking { + return &NullableServerNetworking{value: val, isSet: true} +} + +func (v NullableServerNetworking) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServerNetworking) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_service_account_mail_list_response.go b/services/iaas/v2beta1api/model_service_account_mail_list_response.go new file mode 100644 index 000000000..ab0208390 --- /dev/null +++ b/services/iaas/v2beta1api/model_service_account_mail_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ServiceAccountMailListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ServiceAccountMailListResponse{} + +// ServiceAccountMailListResponse Service account mail list response. +type ServiceAccountMailListResponse struct { + // A list of service account mails. + Items []string `json:"items"` +} + +type _ServiceAccountMailListResponse ServiceAccountMailListResponse + +// NewServiceAccountMailListResponse instantiates a new ServiceAccountMailListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewServiceAccountMailListResponse(items []string) *ServiceAccountMailListResponse { + this := ServiceAccountMailListResponse{} + this.Items = items + return &this +} + +// NewServiceAccountMailListResponseWithDefaults instantiates a new ServiceAccountMailListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewServiceAccountMailListResponseWithDefaults() *ServiceAccountMailListResponse { + this := ServiceAccountMailListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *ServiceAccountMailListResponse) GetItems() []string { + if o == nil { + var ret []string + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *ServiceAccountMailListResponse) GetItemsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *ServiceAccountMailListResponse) SetItems(v []string) { + o.Items = v +} + +func (o ServiceAccountMailListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ServiceAccountMailListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *ServiceAccountMailListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varServiceAccountMailListResponse := _ServiceAccountMailListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varServiceAccountMailListResponse) + + if err != nil { + return err + } + + *o = ServiceAccountMailListResponse(varServiceAccountMailListResponse) + + return err +} + +type NullableServiceAccountMailListResponse struct { + value *ServiceAccountMailListResponse + isSet bool +} + +func (v NullableServiceAccountMailListResponse) Get() *ServiceAccountMailListResponse { + return v.value +} + +func (v *NullableServiceAccountMailListResponse) Set(val *ServiceAccountMailListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableServiceAccountMailListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableServiceAccountMailListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableServiceAccountMailListResponse(val *ServiceAccountMailListResponse) *NullableServiceAccountMailListResponse { + return &NullableServiceAccountMailListResponse{value: val, isSet: true} +} + +func (v NullableServiceAccountMailListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableServiceAccountMailListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_set_image_share_payload.go b/services/iaas/v2beta1api/model_set_image_share_payload.go new file mode 100644 index 000000000..76b7f425e --- /dev/null +++ b/services/iaas/v2beta1api/model_set_image_share_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the SetImageSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SetImageSharePayload{} + +// SetImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type SetImageSharePayload struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewSetImageSharePayload instantiates a new SetImageSharePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSetImageSharePayload() *SetImageSharePayload { + this := SetImageSharePayload{} + return &this +} + +// NewSetImageSharePayloadWithDefaults instantiates a new SetImageSharePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSetImageSharePayloadWithDefaults() *SetImageSharePayload { + this := SetImageSharePayload{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *SetImageSharePayload) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetImageSharePayload) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *SetImageSharePayload) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *SetImageSharePayload) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *SetImageSharePayload) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SetImageSharePayload) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *SetImageSharePayload) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *SetImageSharePayload) SetProjects(v []string) { + o.Projects = v +} + +func (o SetImageSharePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SetImageSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableSetImageSharePayload struct { + value *SetImageSharePayload + isSet bool +} + +func (v NullableSetImageSharePayload) Get() *SetImageSharePayload { + return v.value +} + +func (v *NullableSetImageSharePayload) Set(val *SetImageSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableSetImageSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableSetImageSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSetImageSharePayload(val *SetImageSharePayload) *NullableSetImageSharePayload { + return &NullableSetImageSharePayload{value: val, isSet: true} +} + +func (v NullableSetImageSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSetImageSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_snapshot.go b/services/iaas/v2beta1api/model_snapshot.go new file mode 100644 index 000000000..75b4a9728 --- /dev/null +++ b/services/iaas/v2beta1api/model_snapshot.go @@ -0,0 +1,418 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Snapshot type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Snapshot{} + +// Snapshot Object that represents a snapshot. +type Snapshot struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId string `json:"volumeId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _Snapshot Snapshot + +// NewSnapshot instantiates a new Snapshot object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshot(volumeId string) *Snapshot { + this := Snapshot{} + this.VolumeId = volumeId + return &this +} + +// NewSnapshotWithDefaults instantiates a new Snapshot object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotWithDefaults() *Snapshot { + this := Snapshot{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Snapshot) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Snapshot) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Snapshot) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Snapshot) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Snapshot) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Snapshot) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Snapshot) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Snapshot) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Snapshot) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Snapshot) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Snapshot) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Snapshot) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Snapshot) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Snapshot) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Snapshot) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Snapshot) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Snapshot) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Snapshot) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Snapshot) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Snapshot) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Snapshot) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Snapshot) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value +func (o *Snapshot) GetVolumeId() string { + if o == nil { + var ret string + return ret + } + + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value +// and a boolean to check if the value has been set. +func (o *Snapshot) GetVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VolumeId, true +} + +// SetVolumeId sets field value +func (o *Snapshot) SetVolumeId(v string) { + o.VolumeId = v +} + +func (o Snapshot) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Snapshot) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + toSerialize["volumeId"] = o.VolumeId + return toSerialize, nil +} + +func (o *Snapshot) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "volumeId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSnapshot := _Snapshot{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSnapshot) + + if err != nil { + return err + } + + *o = Snapshot(varSnapshot) + + return err +} + +type NullableSnapshot struct { + value *Snapshot + isSet bool +} + +func (v NullableSnapshot) Get() *Snapshot { + return v.value +} + +func (v *NullableSnapshot) Set(val *Snapshot) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshot) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshot) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshot(val *Snapshot) *NullableSnapshot { + return &NullableSnapshot{value: val, isSet: true} +} + +func (v NullableSnapshot) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshot) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_snapshot_list_response.go b/services/iaas/v2beta1api/model_snapshot_list_response.go new file mode 100644 index 000000000..7142b9452 --- /dev/null +++ b/services/iaas/v2beta1api/model_snapshot_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the SnapshotListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotListResponse{} + +// SnapshotListResponse Snapshot list response. +type SnapshotListResponse struct { + // A list containing snapshot objects. + Items []Snapshot `json:"items"` +} + +type _SnapshotListResponse SnapshotListResponse + +// NewSnapshotListResponse instantiates a new SnapshotListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewSnapshotListResponse(items []Snapshot) *SnapshotListResponse { + this := SnapshotListResponse{} + this.Items = items + return &this +} + +// NewSnapshotListResponseWithDefaults instantiates a new SnapshotListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewSnapshotListResponseWithDefaults() *SnapshotListResponse { + this := SnapshotListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *SnapshotListResponse) GetItems() []Snapshot { + if o == nil { + var ret []Snapshot + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *SnapshotListResponse) GetItemsOk() ([]Snapshot, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *SnapshotListResponse) SetItems(v []Snapshot) { + o.Items = v +} + +func (o SnapshotListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SnapshotListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *SnapshotListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSnapshotListResponse := _SnapshotListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varSnapshotListResponse) + + if err != nil { + return err + } + + *o = SnapshotListResponse(varSnapshotListResponse) + + return err +} + +type NullableSnapshotListResponse struct { + value *SnapshotListResponse + isSet bool +} + +func (v NullableSnapshotListResponse) Get() *SnapshotListResponse { + return v.value +} + +func (v *NullableSnapshotListResponse) Set(val *SnapshotListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotListResponse(val *SnapshotListResponse) *NullableSnapshotListResponse { + return &NullableSnapshotListResponse{value: val, isSet: true} +} + +func (v NullableSnapshotListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_static_area_id.go b/services/iaas/v2beta1api/model_static_area_id.go new file mode 100644 index 000000000..ddeb70d82 --- /dev/null +++ b/services/iaas/v2beta1api/model_static_area_id.go @@ -0,0 +1,111 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "fmt" +) + +// StaticAreaID The identifier (ID) of a static area. +type StaticAreaID string + +// List of StaticAreaID +const ( + STATICAREAID_PUBLIC StaticAreaID = "PUBLIC" + STATICAREAID_SCHWARZ StaticAreaID = "SCHWARZ" +) + +// All allowed values of StaticAreaID enum +var AllowedStaticAreaIDEnumValues = []StaticAreaID{ + "PUBLIC", + "SCHWARZ", +} + +func (v *StaticAreaID) UnmarshalJSON(src []byte) error { + var value string + err := json.Unmarshal(src, &value) + if err != nil { + return err + } + enumTypeValue := StaticAreaID(value) + for _, existing := range AllowedStaticAreaIDEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid StaticAreaID", value) +} + +// NewStaticAreaIDFromValue returns a pointer to a valid StaticAreaID +// for the value passed as argument, or an error if the value passed is not allowed by the enum +func NewStaticAreaIDFromValue(v string) (*StaticAreaID, error) { + ev := StaticAreaID(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for StaticAreaID: valid values are %v", v, AllowedStaticAreaIDEnumValues) + } +} + +// IsValid return true if the value is valid for the enum, false otherwise +func (v StaticAreaID) IsValid() bool { + for _, existing := range AllowedStaticAreaIDEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to StaticAreaID value +func (v StaticAreaID) Ptr() *StaticAreaID { + return &v +} + +type NullableStaticAreaID struct { + value *StaticAreaID + isSet bool +} + +func (v NullableStaticAreaID) Get() *StaticAreaID { + return v.value +} + +func (v *NullableStaticAreaID) Set(val *StaticAreaID) { + v.value = val + v.isSet = true +} + +func (v NullableStaticAreaID) IsSet() bool { + return v.isSet +} + +func (v *NullableStaticAreaID) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableStaticAreaID(val *StaticAreaID) *NullableStaticAreaID { + return &NullableStaticAreaID{value: val, isSet: true} +} + +func (v NullableStaticAreaID) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableStaticAreaID) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_attached_volume_payload.go b/services/iaas/v2beta1api/model_update_attached_volume_payload.go new file mode 100644 index 000000000..060cdd68e --- /dev/null +++ b/services/iaas/v2beta1api/model_update_attached_volume_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateAttachedVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateAttachedVolumePayload{} + +// UpdateAttachedVolumePayload Object that represents a Volume attachment to a server. +type UpdateAttachedVolumePayload struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewUpdateAttachedVolumePayload instantiates a new UpdateAttachedVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateAttachedVolumePayload() *UpdateAttachedVolumePayload { + this := UpdateAttachedVolumePayload{} + return &this +} + +// NewUpdateAttachedVolumePayloadWithDefaults instantiates a new UpdateAttachedVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateAttachedVolumePayloadWithDefaults() *UpdateAttachedVolumePayload { + this := UpdateAttachedVolumePayload{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *UpdateAttachedVolumePayload) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *UpdateAttachedVolumePayload) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *UpdateAttachedVolumePayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateAttachedVolumePayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *UpdateAttachedVolumePayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *UpdateAttachedVolumePayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o UpdateAttachedVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateAttachedVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableUpdateAttachedVolumePayload struct { + value *UpdateAttachedVolumePayload + isSet bool +} + +func (v NullableUpdateAttachedVolumePayload) Get() *UpdateAttachedVolumePayload { + return v.value +} + +func (v *NullableUpdateAttachedVolumePayload) Set(val *UpdateAttachedVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateAttachedVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateAttachedVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateAttachedVolumePayload(val *UpdateAttachedVolumePayload) *NullableUpdateAttachedVolumePayload { + return &NullableUpdateAttachedVolumePayload{value: val, isSet: true} +} + +func (v NullableUpdateAttachedVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateAttachedVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_image_payload.go b/services/iaas/v2beta1api/model_update_image_payload.go new file mode 100644 index 000000000..126e7d05d --- /dev/null +++ b/services/iaas/v2beta1api/model_update_image_payload.go @@ -0,0 +1,383 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateImagePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateImagePayload{} + +// UpdateImagePayload Object that represents an update request body of an Image. +type UpdateImagePayload struct { + Agent *ImageAgent `json:"agent,omitempty"` + Config *ImageConfig `json:"config,omitempty"` + // Object that represents a disk format. Possible values: `raw`, `qcow2`, `iso`. + DiskFormat *string `json:"diskFormat,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Size in Gigabyte. + MinDiskSize *int64 `json:"minDiskSize,omitempty"` + // Size in Megabyte. + MinRam *int64 `json:"minRam,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // When true the image is prevented from being deleted. + Protected *bool `json:"protected,omitempty"` +} + +// NewUpdateImagePayload instantiates a new UpdateImagePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateImagePayload() *UpdateImagePayload { + this := UpdateImagePayload{} + return &this +} + +// NewUpdateImagePayloadWithDefaults instantiates a new UpdateImagePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateImagePayloadWithDefaults() *UpdateImagePayload { + this := UpdateImagePayload{} + return &this +} + +// GetAgent returns the Agent field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetAgent() ImageAgent { + if o == nil || IsNil(o.Agent) { + var ret ImageAgent + return ret + } + return *o.Agent +} + +// GetAgentOk returns a tuple with the Agent field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetAgentOk() (*ImageAgent, bool) { + if o == nil || IsNil(o.Agent) { + return nil, false + } + return o.Agent, true +} + +// HasAgent returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasAgent() bool { + if o != nil && !IsNil(o.Agent) { + return true + } + + return false +} + +// SetAgent gets a reference to the given ImageAgent and assigns it to the Agent field. +func (o *UpdateImagePayload) SetAgent(v ImageAgent) { + o.Agent = &v +} + +// GetConfig returns the Config field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetConfig() ImageConfig { + if o == nil || IsNil(o.Config) { + var ret ImageConfig + return ret + } + return *o.Config +} + +// GetConfigOk returns a tuple with the Config field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.Config) { + return nil, false + } + return o.Config, true +} + +// HasConfig returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasConfig() bool { + if o != nil && !IsNil(o.Config) { + return true + } + + return false +} + +// SetConfig gets a reference to the given ImageConfig and assigns it to the Config field. +func (o *UpdateImagePayload) SetConfig(v ImageConfig) { + o.Config = &v +} + +// GetDiskFormat returns the DiskFormat field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetDiskFormat() string { + if o == nil || IsNil(o.DiskFormat) { + var ret string + return ret + } + return *o.DiskFormat +} + +// GetDiskFormatOk returns a tuple with the DiskFormat field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetDiskFormatOk() (*string, bool) { + if o == nil || IsNil(o.DiskFormat) { + return nil, false + } + return o.DiskFormat, true +} + +// HasDiskFormat returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasDiskFormat() bool { + if o != nil && !IsNil(o.DiskFormat) { + return true + } + + return false +} + +// SetDiskFormat gets a reference to the given string and assigns it to the DiskFormat field. +func (o *UpdateImagePayload) SetDiskFormat(v string) { + o.DiskFormat = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateImagePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMinDiskSize returns the MinDiskSize field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetMinDiskSize() int64 { + if o == nil || IsNil(o.MinDiskSize) { + var ret int64 + return ret + } + return *o.MinDiskSize +} + +// GetMinDiskSizeOk returns a tuple with the MinDiskSize field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetMinDiskSizeOk() (*int64, bool) { + if o == nil || IsNil(o.MinDiskSize) { + return nil, false + } + return o.MinDiskSize, true +} + +// HasMinDiskSize returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasMinDiskSize() bool { + if o != nil && !IsNil(o.MinDiskSize) { + return true + } + + return false +} + +// SetMinDiskSize gets a reference to the given int64 and assigns it to the MinDiskSize field. +func (o *UpdateImagePayload) SetMinDiskSize(v int64) { + o.MinDiskSize = &v +} + +// GetMinRam returns the MinRam field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetMinRam() int64 { + if o == nil || IsNil(o.MinRam) { + var ret int64 + return ret + } + return *o.MinRam +} + +// GetMinRamOk returns a tuple with the MinRam field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetMinRamOk() (*int64, bool) { + if o == nil || IsNil(o.MinRam) { + return nil, false + } + return o.MinRam, true +} + +// HasMinRam returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasMinRam() bool { + if o != nil && !IsNil(o.MinRam) { + return true + } + + return false +} + +// SetMinRam gets a reference to the given int64 and assigns it to the MinRam field. +func (o *UpdateImagePayload) SetMinRam(v int64) { + o.MinRam = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateImagePayload) SetName(v string) { + o.Name = &v +} + +// GetProtected returns the Protected field value if set, zero value otherwise. +func (o *UpdateImagePayload) GetProtected() bool { + if o == nil || IsNil(o.Protected) { + var ret bool + return ret + } + return *o.Protected +} + +// GetProtectedOk returns a tuple with the Protected field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImagePayload) GetProtectedOk() (*bool, bool) { + if o == nil || IsNil(o.Protected) { + return nil, false + } + return o.Protected, true +} + +// HasProtected returns a boolean if a field has been set. +func (o *UpdateImagePayload) HasProtected() bool { + if o != nil && !IsNil(o.Protected) { + return true + } + + return false +} + +// SetProtected gets a reference to the given bool and assigns it to the Protected field. +func (o *UpdateImagePayload) SetProtected(v bool) { + o.Protected = &v +} + +func (o UpdateImagePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateImagePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Agent) { + toSerialize["agent"] = o.Agent + } + if !IsNil(o.Config) { + toSerialize["config"] = o.Config + } + if !IsNil(o.DiskFormat) { + toSerialize["diskFormat"] = o.DiskFormat + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.MinDiskSize) { + toSerialize["minDiskSize"] = o.MinDiskSize + } + if !IsNil(o.MinRam) { + toSerialize["minRam"] = o.MinRam + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Protected) { + toSerialize["protected"] = o.Protected + } + return toSerialize, nil +} + +type NullableUpdateImagePayload struct { + value *UpdateImagePayload + isSet bool +} + +func (v NullableUpdateImagePayload) Get() *UpdateImagePayload { + return v.value +} + +func (v *NullableUpdateImagePayload) Set(val *UpdateImagePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateImagePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateImagePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateImagePayload(val *UpdateImagePayload) *NullableUpdateImagePayload { + return &NullableUpdateImagePayload{value: val, isSet: true} +} + +func (v NullableUpdateImagePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateImagePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_image_share_payload.go b/services/iaas/v2beta1api/model_update_image_share_payload.go new file mode 100644 index 000000000..2a457634f --- /dev/null +++ b/services/iaas/v2beta1api/model_update_image_share_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateImageSharePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateImageSharePayload{} + +// UpdateImageSharePayload Share details of an Image. For requests ParentOrganization and Projects are mutually exclusive. +type UpdateImageSharePayload struct { + // Image is shared with all projects inside the image owners organization. + ParentOrganization *bool `json:"parentOrganization,omitempty"` + // List of all projects the Image is shared with. + Projects []string `json:"projects,omitempty"` +} + +// NewUpdateImageSharePayload instantiates a new UpdateImageSharePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateImageSharePayload() *UpdateImageSharePayload { + this := UpdateImageSharePayload{} + return &this +} + +// NewUpdateImageSharePayloadWithDefaults instantiates a new UpdateImageSharePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateImageSharePayloadWithDefaults() *UpdateImageSharePayload { + this := UpdateImageSharePayload{} + return &this +} + +// GetParentOrganization returns the ParentOrganization field value if set, zero value otherwise. +func (o *UpdateImageSharePayload) GetParentOrganization() bool { + if o == nil || IsNil(o.ParentOrganization) { + var ret bool + return ret + } + return *o.ParentOrganization +} + +// GetParentOrganizationOk returns a tuple with the ParentOrganization field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImageSharePayload) GetParentOrganizationOk() (*bool, bool) { + if o == nil || IsNil(o.ParentOrganization) { + return nil, false + } + return o.ParentOrganization, true +} + +// HasParentOrganization returns a boolean if a field has been set. +func (o *UpdateImageSharePayload) HasParentOrganization() bool { + if o != nil && !IsNil(o.ParentOrganization) { + return true + } + + return false +} + +// SetParentOrganization gets a reference to the given bool and assigns it to the ParentOrganization field. +func (o *UpdateImageSharePayload) SetParentOrganization(v bool) { + o.ParentOrganization = &v +} + +// GetProjects returns the Projects field value if set, zero value otherwise. +func (o *UpdateImageSharePayload) GetProjects() []string { + if o == nil || IsNil(o.Projects) { + var ret []string + return ret + } + return o.Projects +} + +// GetProjectsOk returns a tuple with the Projects field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateImageSharePayload) GetProjectsOk() ([]string, bool) { + if o == nil || IsNil(o.Projects) { + return nil, false + } + return o.Projects, true +} + +// HasProjects returns a boolean if a field has been set. +func (o *UpdateImageSharePayload) HasProjects() bool { + if o != nil && !IsNil(o.Projects) { + return true + } + + return false +} + +// SetProjects gets a reference to the given []string and assigns it to the Projects field. +func (o *UpdateImageSharePayload) SetProjects(v []string) { + o.Projects = v +} + +func (o UpdateImageSharePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateImageSharePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.ParentOrganization) { + toSerialize["parentOrganization"] = o.ParentOrganization + } + if !IsNil(o.Projects) { + toSerialize["projects"] = o.Projects + } + return toSerialize, nil +} + +type NullableUpdateImageSharePayload struct { + value *UpdateImageSharePayload + isSet bool +} + +func (v NullableUpdateImageSharePayload) Get() *UpdateImageSharePayload { + return v.value +} + +func (v *NullableUpdateImageSharePayload) Set(val *UpdateImageSharePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateImageSharePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateImageSharePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateImageSharePayload(val *UpdateImageSharePayload) *NullableUpdateImageSharePayload { + return &NullableUpdateImageSharePayload{value: val, isSet: true} +} + +func (v NullableUpdateImageSharePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateImageSharePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_key_pair_payload.go b/services/iaas/v2beta1api/model_update_key_pair_payload.go new file mode 100644 index 000000000..61f968041 --- /dev/null +++ b/services/iaas/v2beta1api/model_update_key_pair_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateKeyPairPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateKeyPairPayload{} + +// UpdateKeyPairPayload Object that represents an update request body of a public key of an SSH keypair. +type UpdateKeyPairPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewUpdateKeyPairPayload instantiates a new UpdateKeyPairPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateKeyPairPayload() *UpdateKeyPairPayload { + this := UpdateKeyPairPayload{} + return &this +} + +// NewUpdateKeyPairPayloadWithDefaults instantiates a new UpdateKeyPairPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateKeyPairPayloadWithDefaults() *UpdateKeyPairPayload { + this := UpdateKeyPairPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateKeyPairPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateKeyPairPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateKeyPairPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateKeyPairPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o UpdateKeyPairPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateKeyPairPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableUpdateKeyPairPayload struct { + value *UpdateKeyPairPayload + isSet bool +} + +func (v NullableUpdateKeyPairPayload) Get() *UpdateKeyPairPayload { + return v.value +} + +func (v *NullableUpdateKeyPairPayload) Set(val *UpdateKeyPairPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateKeyPairPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateKeyPairPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateKeyPairPayload(val *UpdateKeyPairPayload) *NullableUpdateKeyPairPayload { + return &NullableUpdateKeyPairPayload{value: val, isSet: true} +} + +func (v NullableUpdateKeyPairPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateKeyPairPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_network_ipv4_body.go b/services/iaas/v2beta1api/model_update_network_ipv4_body.go new file mode 100644 index 000000000..871631d00 --- /dev/null +++ b/services/iaas/v2beta1api/model_update_network_ipv4_body.go @@ -0,0 +1,174 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkIPv4Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv4Body{} + +// UpdateNetworkIPv4Body The config object for a IPv4 network update. +type UpdateNetworkIPv4Body struct { + // The IPv4 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv4. + Nameservers []string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv4Body instantiates a new UpdateNetworkIPv4Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkIPv4Body() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// NewUpdateNetworkIPv4BodyWithDefaults instantiates a new UpdateNetworkIPv4Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkIPv4BodyWithDefaults() *UpdateNetworkIPv4Body { + this := UpdateNetworkIPv4Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv4Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv4Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *UpdateNetworkIPv4Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *UpdateNetworkIPv4Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *UpdateNetworkIPv4Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv4Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv4Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv4Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv4Body) SetNameservers(v []string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkIPv4Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv4Body struct { + value *UpdateNetworkIPv4Body + isSet bool +} + +func (v NullableUpdateNetworkIPv4Body) Get() *UpdateNetworkIPv4Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv4Body) Set(val *UpdateNetworkIPv4Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv4Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv4Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv4Body(val *UpdateNetworkIPv4Body) *NullableUpdateNetworkIPv4Body { + return &NullableUpdateNetworkIPv4Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv4Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv4Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_network_ipv6_body.go b/services/iaas/v2beta1api/model_update_network_ipv6_body.go new file mode 100644 index 000000000..abc1498bf --- /dev/null +++ b/services/iaas/v2beta1api/model_update_network_ipv6_body.go @@ -0,0 +1,174 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateNetworkIPv6Body type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNetworkIPv6Body{} + +// UpdateNetworkIPv6Body The config object for a IPv6 network update. +type UpdateNetworkIPv6Body struct { + // The IPv6 gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. + Gateway NullableString `json:"gateway,omitempty" validate:"regexp=^\\\\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)(\\\\.(25[0-5]|2[0-4]\\\\d|1\\\\d\\\\d|[1-9]?\\\\d)){3}))|:)))(%.+)?\\\\s*$"` + // A list containing DNS Servers/Nameservers for IPv6. + Nameservers []string `json:"nameservers,omitempty"` +} + +// NewUpdateNetworkIPv6Body instantiates a new UpdateNetworkIPv6Body object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNetworkIPv6Body() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// NewUpdateNetworkIPv6BodyWithDefaults instantiates a new UpdateNetworkIPv6Body object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNetworkIPv6BodyWithDefaults() *UpdateNetworkIPv6Body { + this := UpdateNetworkIPv6Body{} + return &this +} + +// GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdateNetworkIPv6Body) GetGateway() string { + if o == nil || IsNil(o.Gateway.Get()) { + var ret string + return ret + } + return *o.Gateway.Get() +} + +// GetGatewayOk returns a tuple with the Gateway field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdateNetworkIPv6Body) GetGatewayOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Gateway.Get(), o.Gateway.IsSet() +} + +// HasGateway returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasGateway() bool { + if o != nil && o.Gateway.IsSet() { + return true + } + + return false +} + +// SetGateway gets a reference to the given NullableString and assigns it to the Gateway field. +func (o *UpdateNetworkIPv6Body) SetGateway(v string) { + o.Gateway.Set(&v) +} + +// SetGatewayNil sets the value for Gateway to be an explicit nil +func (o *UpdateNetworkIPv6Body) SetGatewayNil() { + o.Gateway.Set(nil) +} + +// UnsetGateway ensures that no value is present for Gateway, not even an explicit nil +func (o *UpdateNetworkIPv6Body) UnsetGateway() { + o.Gateway.Unset() +} + +// GetNameservers returns the Nameservers field value if set, zero value otherwise. +func (o *UpdateNetworkIPv6Body) GetNameservers() []string { + if o == nil || IsNil(o.Nameservers) { + var ret []string + return ret + } + return o.Nameservers +} + +// GetNameserversOk returns a tuple with the Nameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNetworkIPv6Body) GetNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.Nameservers) { + return nil, false + } + return o.Nameservers, true +} + +// HasNameservers returns a boolean if a field has been set. +func (o *UpdateNetworkIPv6Body) HasNameservers() bool { + if o != nil && !IsNil(o.Nameservers) { + return true + } + + return false +} + +// SetNameservers gets a reference to the given []string and assigns it to the Nameservers field. +func (o *UpdateNetworkIPv6Body) SetNameservers(v []string) { + o.Nameservers = v +} + +func (o UpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNetworkIPv6Body) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Gateway.IsSet() { + toSerialize["gateway"] = o.Gateway.Get() + } + if !IsNil(o.Nameservers) { + toSerialize["nameservers"] = o.Nameservers + } + return toSerialize, nil +} + +type NullableUpdateNetworkIPv6Body struct { + value *UpdateNetworkIPv6Body + isSet bool +} + +func (v NullableUpdateNetworkIPv6Body) Get() *UpdateNetworkIPv6Body { + return v.value +} + +func (v *NullableUpdateNetworkIPv6Body) Set(val *UpdateNetworkIPv6Body) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNetworkIPv6Body) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNetworkIPv6Body) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNetworkIPv6Body(val *UpdateNetworkIPv6Body) *NullableUpdateNetworkIPv6Body { + return &NullableUpdateNetworkIPv6Body{value: val, isSet: true} +} + +func (v NullableUpdateNetworkIPv6Body) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNetworkIPv6Body) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_nic_payload.go b/services/iaas/v2beta1api/model_update_nic_payload.go new file mode 100644 index 000000000..305810f79 --- /dev/null +++ b/services/iaas/v2beta1api/model_update_nic_payload.go @@ -0,0 +1,311 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateNicPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateNicPayload{} + +// UpdateNicPayload Object that represents a network interface update. +type UpdateNicPayload struct { + // A list of IPs or CIDR notations. + AllowedAddresses []AllowedAddressesInner `json:"allowedAddresses,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // If this is set to false, then no security groups will apply to this network interface. + NicSecurity *bool `json:"nicSecurity,omitempty"` + // A list of UUIDs. + SecurityGroups []string `json:"securityGroups,omitempty"` +} + +// NewUpdateNicPayload instantiates a new UpdateNicPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateNicPayload() *UpdateNicPayload { + this := UpdateNicPayload{} + return &this +} + +// NewUpdateNicPayloadWithDefaults instantiates a new UpdateNicPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateNicPayloadWithDefaults() *UpdateNicPayload { + this := UpdateNicPayload{} + return &this +} + +// GetAllowedAddresses returns the AllowedAddresses field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetAllowedAddresses() []AllowedAddressesInner { + if o == nil || IsNil(o.AllowedAddresses) { + var ret []AllowedAddressesInner + return ret + } + return o.AllowedAddresses +} + +// GetAllowedAddressesOk returns a tuple with the AllowedAddresses field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetAllowedAddressesOk() ([]AllowedAddressesInner, bool) { + if o == nil || IsNil(o.AllowedAddresses) { + return nil, false + } + return o.AllowedAddresses, true +} + +// HasAllowedAddresses returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasAllowedAddresses() bool { + if o != nil && !IsNil(o.AllowedAddresses) { + return true + } + + return false +} + +// SetAllowedAddresses gets a reference to the given []AllowedAddressesInner and assigns it to the AllowedAddresses field. +func (o *UpdateNicPayload) SetAllowedAddresses(v []AllowedAddressesInner) { + o.AllowedAddresses = v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateNicPayload) SetDescription(v string) { + o.Description = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateNicPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateNicPayload) SetName(v string) { + o.Name = &v +} + +// GetNicSecurity returns the NicSecurity field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetNicSecurity() bool { + if o == nil || IsNil(o.NicSecurity) { + var ret bool + return ret + } + return *o.NicSecurity +} + +// GetNicSecurityOk returns a tuple with the NicSecurity field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetNicSecurityOk() (*bool, bool) { + if o == nil || IsNil(o.NicSecurity) { + return nil, false + } + return o.NicSecurity, true +} + +// HasNicSecurity returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasNicSecurity() bool { + if o != nil && !IsNil(o.NicSecurity) { + return true + } + + return false +} + +// SetNicSecurity gets a reference to the given bool and assigns it to the NicSecurity field. +func (o *UpdateNicPayload) SetNicSecurity(v bool) { + o.NicSecurity = &v +} + +// GetSecurityGroups returns the SecurityGroups field value if set, zero value otherwise. +func (o *UpdateNicPayload) GetSecurityGroups() []string { + if o == nil || IsNil(o.SecurityGroups) { + var ret []string + return ret + } + return o.SecurityGroups +} + +// GetSecurityGroupsOk returns a tuple with the SecurityGroups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateNicPayload) GetSecurityGroupsOk() ([]string, bool) { + if o == nil || IsNil(o.SecurityGroups) { + return nil, false + } + return o.SecurityGroups, true +} + +// HasSecurityGroups returns a boolean if a field has been set. +func (o *UpdateNicPayload) HasSecurityGroups() bool { + if o != nil && !IsNil(o.SecurityGroups) { + return true + } + + return false +} + +// SetSecurityGroups gets a reference to the given []string and assigns it to the SecurityGroups field. +func (o *UpdateNicPayload) SetSecurityGroups(v []string) { + o.SecurityGroups = v +} + +func (o UpdateNicPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateNicPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AllowedAddresses) { + toSerialize["allowedAddresses"] = o.AllowedAddresses + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.NicSecurity) { + toSerialize["nicSecurity"] = o.NicSecurity + } + if !IsNil(o.SecurityGroups) { + toSerialize["securityGroups"] = o.SecurityGroups + } + return toSerialize, nil +} + +type NullableUpdateNicPayload struct { + value *UpdateNicPayload + isSet bool +} + +func (v NullableUpdateNicPayload) Get() *UpdateNicPayload { + return v.value +} + +func (v *NullableUpdateNicPayload) Set(val *UpdateNicPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateNicPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateNicPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateNicPayload(val *UpdateNicPayload) *NullableUpdateNicPayload { + return &NullableUpdateNicPayload{value: val, isSet: true} +} + +func (v NullableUpdateNicPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateNicPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_public_ip_payload.go b/services/iaas/v2beta1api/model_update_public_ip_payload.go new file mode 100644 index 000000000..df4ab6f48 --- /dev/null +++ b/services/iaas/v2beta1api/model_update_public_ip_payload.go @@ -0,0 +1,248 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdatePublicIPPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdatePublicIPPayload{} + +// UpdatePublicIPPayload Object that represents a public IP. +type UpdatePublicIPPayload struct { + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // String that represents an IPv4 address. + Ip *string `json:"ip,omitempty" validate:"regexp=^\\\\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\\\\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\\\\s*$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Associate the public IP with a network interface (ID). + NetworkInterface NullableString `json:"networkInterface,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewUpdatePublicIPPayload instantiates a new UpdatePublicIPPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdatePublicIPPayload() *UpdatePublicIPPayload { + this := UpdatePublicIPPayload{} + return &this +} + +// NewUpdatePublicIPPayloadWithDefaults instantiates a new UpdatePublicIPPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdatePublicIPPayloadWithDefaults() *UpdatePublicIPPayload { + this := UpdatePublicIPPayload{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *UpdatePublicIPPayload) SetId(v string) { + o.Id = &v +} + +// GetIp returns the Ip field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetIp() string { + if o == nil || IsNil(o.Ip) { + var ret string + return ret + } + return *o.Ip +} + +// GetIpOk returns a tuple with the Ip field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetIpOk() (*string, bool) { + if o == nil || IsNil(o.Ip) { + return nil, false + } + return o.Ip, true +} + +// HasIp returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasIp() bool { + if o != nil && !IsNil(o.Ip) { + return true + } + + return false +} + +// SetIp gets a reference to the given string and assigns it to the Ip field. +func (o *UpdatePublicIPPayload) SetIp(v string) { + o.Ip = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdatePublicIPPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdatePublicIPPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdatePublicIPPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetNetworkInterface returns the NetworkInterface field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *UpdatePublicIPPayload) GetNetworkInterface() string { + if o == nil || IsNil(o.NetworkInterface.Get()) { + var ret string + return ret + } + return *o.NetworkInterface.Get() +} + +// GetNetworkInterfaceOk returns a tuple with the NetworkInterface field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *UpdatePublicIPPayload) GetNetworkInterfaceOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.NetworkInterface.Get(), o.NetworkInterface.IsSet() +} + +// HasNetworkInterface returns a boolean if a field has been set. +func (o *UpdatePublicIPPayload) HasNetworkInterface() bool { + if o != nil && o.NetworkInterface.IsSet() { + return true + } + + return false +} + +// SetNetworkInterface gets a reference to the given NullableString and assigns it to the NetworkInterface field. +func (o *UpdatePublicIPPayload) SetNetworkInterface(v string) { + o.NetworkInterface.Set(&v) +} + +// SetNetworkInterfaceNil sets the value for NetworkInterface to be an explicit nil +func (o *UpdatePublicIPPayload) SetNetworkInterfaceNil() { + o.NetworkInterface.Set(nil) +} + +// UnsetNetworkInterface ensures that no value is present for NetworkInterface, not even an explicit nil +func (o *UpdatePublicIPPayload) UnsetNetworkInterface() { + o.NetworkInterface.Unset() +} + +func (o UpdatePublicIPPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdatePublicIPPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Ip) { + toSerialize["ip"] = o.Ip + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if o.NetworkInterface.IsSet() { + toSerialize["networkInterface"] = o.NetworkInterface.Get() + } + return toSerialize, nil +} + +type NullableUpdatePublicIPPayload struct { + value *UpdatePublicIPPayload + isSet bool +} + +func (v NullableUpdatePublicIPPayload) Get() *UpdatePublicIPPayload { + return v.value +} + +func (v *NullableUpdatePublicIPPayload) Set(val *UpdatePublicIPPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdatePublicIPPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdatePublicIPPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdatePublicIPPayload(val *UpdatePublicIPPayload) *NullableUpdatePublicIPPayload { + return &NullableUpdatePublicIPPayload{value: val, isSet: true} +} + +func (v NullableUpdatePublicIPPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdatePublicIPPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_regional_area_ipv4.go b/services/iaas/v2beta1api/model_update_regional_area_ipv4.go new file mode 100644 index 000000000..bf99b91f8 --- /dev/null +++ b/services/iaas/v2beta1api/model_update_regional_area_ipv4.go @@ -0,0 +1,236 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateRegionalAreaIPv4 type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRegionalAreaIPv4{} + +// UpdateRegionalAreaIPv4 Object that represents the request body for a regional network area IPv4 configuration update. +type UpdateRegionalAreaIPv4 struct { + DefaultNameservers []string `json:"defaultNameservers,omitempty"` + // The default prefix length for networks in the network area. + DefaultPrefixLen *int64 `json:"defaultPrefixLen,omitempty"` + // The maximal prefix length for networks in the network area. + MaxPrefixLen *int64 `json:"maxPrefixLen,omitempty"` + // The minimal prefix length for networks in the network area. + MinPrefixLen *int64 `json:"minPrefixLen,omitempty"` +} + +// NewUpdateRegionalAreaIPv4 instantiates a new UpdateRegionalAreaIPv4 object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRegionalAreaIPv4() *UpdateRegionalAreaIPv4 { + this := UpdateRegionalAreaIPv4{} + return &this +} + +// NewUpdateRegionalAreaIPv4WithDefaults instantiates a new UpdateRegionalAreaIPv4 object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRegionalAreaIPv4WithDefaults() *UpdateRegionalAreaIPv4 { + this := UpdateRegionalAreaIPv4{} + return &this +} + +// GetDefaultNameservers returns the DefaultNameservers field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetDefaultNameservers() []string { + if o == nil || IsNil(o.DefaultNameservers) { + var ret []string + return ret + } + return o.DefaultNameservers +} + +// GetDefaultNameserversOk returns a tuple with the DefaultNameservers field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetDefaultNameserversOk() ([]string, bool) { + if o == nil || IsNil(o.DefaultNameservers) { + return nil, false + } + return o.DefaultNameservers, true +} + +// HasDefaultNameservers returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasDefaultNameservers() bool { + if o != nil && !IsNil(o.DefaultNameservers) { + return true + } + + return false +} + +// SetDefaultNameservers gets a reference to the given []string and assigns it to the DefaultNameservers field. +func (o *UpdateRegionalAreaIPv4) SetDefaultNameservers(v []string) { + o.DefaultNameservers = v +} + +// GetDefaultPrefixLen returns the DefaultPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLen() int64 { + if o == nil || IsNil(o.DefaultPrefixLen) { + var ret int64 + return ret + } + return *o.DefaultPrefixLen +} + +// GetDefaultPrefixLenOk returns a tuple with the DefaultPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetDefaultPrefixLenOk() (*int64, bool) { + if o == nil || IsNil(o.DefaultPrefixLen) { + return nil, false + } + return o.DefaultPrefixLen, true +} + +// HasDefaultPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasDefaultPrefixLen() bool { + if o != nil && !IsNil(o.DefaultPrefixLen) { + return true + } + + return false +} + +// SetDefaultPrefixLen gets a reference to the given int64 and assigns it to the DefaultPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetDefaultPrefixLen(v int64) { + o.DefaultPrefixLen = &v +} + +// GetMaxPrefixLen returns the MaxPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLen() int64 { + if o == nil || IsNil(o.MaxPrefixLen) { + var ret int64 + return ret + } + return *o.MaxPrefixLen +} + +// GetMaxPrefixLenOk returns a tuple with the MaxPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetMaxPrefixLenOk() (*int64, bool) { + if o == nil || IsNil(o.MaxPrefixLen) { + return nil, false + } + return o.MaxPrefixLen, true +} + +// HasMaxPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasMaxPrefixLen() bool { + if o != nil && !IsNil(o.MaxPrefixLen) { + return true + } + + return false +} + +// SetMaxPrefixLen gets a reference to the given int64 and assigns it to the MaxPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetMaxPrefixLen(v int64) { + o.MaxPrefixLen = &v +} + +// GetMinPrefixLen returns the MinPrefixLen field value if set, zero value otherwise. +func (o *UpdateRegionalAreaIPv4) GetMinPrefixLen() int64 { + if o == nil || IsNil(o.MinPrefixLen) { + var ret int64 + return ret + } + return *o.MinPrefixLen +} + +// GetMinPrefixLenOk returns a tuple with the MinPrefixLen field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRegionalAreaIPv4) GetMinPrefixLenOk() (*int64, bool) { + if o == nil || IsNil(o.MinPrefixLen) { + return nil, false + } + return o.MinPrefixLen, true +} + +// HasMinPrefixLen returns a boolean if a field has been set. +func (o *UpdateRegionalAreaIPv4) HasMinPrefixLen() bool { + if o != nil && !IsNil(o.MinPrefixLen) { + return true + } + + return false +} + +// SetMinPrefixLen gets a reference to the given int64 and assigns it to the MinPrefixLen field. +func (o *UpdateRegionalAreaIPv4) SetMinPrefixLen(v int64) { + o.MinPrefixLen = &v +} + +func (o UpdateRegionalAreaIPv4) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRegionalAreaIPv4) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DefaultNameservers) { + toSerialize["defaultNameservers"] = o.DefaultNameservers + } + if !IsNil(o.DefaultPrefixLen) { + toSerialize["defaultPrefixLen"] = o.DefaultPrefixLen + } + if !IsNil(o.MaxPrefixLen) { + toSerialize["maxPrefixLen"] = o.MaxPrefixLen + } + if !IsNil(o.MinPrefixLen) { + toSerialize["minPrefixLen"] = o.MinPrefixLen + } + return toSerialize, nil +} + +type NullableUpdateRegionalAreaIPv4 struct { + value *UpdateRegionalAreaIPv4 + isSet bool +} + +func (v NullableUpdateRegionalAreaIPv4) Get() *UpdateRegionalAreaIPv4 { + return v.value +} + +func (v *NullableUpdateRegionalAreaIPv4) Set(val *UpdateRegionalAreaIPv4) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRegionalAreaIPv4) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRegionalAreaIPv4) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRegionalAreaIPv4(val *UpdateRegionalAreaIPv4) *NullableUpdateRegionalAreaIPv4 { + return &NullableUpdateRegionalAreaIPv4{value: val, isSet: true} +} + +func (v NullableUpdateRegionalAreaIPv4) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRegionalAreaIPv4) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_route_of_routing_table_payload.go b/services/iaas/v2beta1api/model_update_route_of_routing_table_payload.go new file mode 100644 index 000000000..3d502eeab --- /dev/null +++ b/services/iaas/v2beta1api/model_update_route_of_routing_table_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateRouteOfRoutingTablePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRouteOfRoutingTablePayload{} + +// UpdateRouteOfRoutingTablePayload Object that represents the request body for a route update. +type UpdateRouteOfRoutingTablePayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewUpdateRouteOfRoutingTablePayload instantiates a new UpdateRouteOfRoutingTablePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRouteOfRoutingTablePayload() *UpdateRouteOfRoutingTablePayload { + this := UpdateRouteOfRoutingTablePayload{} + return &this +} + +// NewUpdateRouteOfRoutingTablePayloadWithDefaults instantiates a new UpdateRouteOfRoutingTablePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRouteOfRoutingTablePayloadWithDefaults() *UpdateRouteOfRoutingTablePayload { + this := UpdateRouteOfRoutingTablePayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateRouteOfRoutingTablePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRouteOfRoutingTablePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateRouteOfRoutingTablePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateRouteOfRoutingTablePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o UpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRouteOfRoutingTablePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableUpdateRouteOfRoutingTablePayload struct { + value *UpdateRouteOfRoutingTablePayload + isSet bool +} + +func (v NullableUpdateRouteOfRoutingTablePayload) Get() *UpdateRouteOfRoutingTablePayload { + return v.value +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) Set(val *UpdateRouteOfRoutingTablePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRouteOfRoutingTablePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRouteOfRoutingTablePayload(val *UpdateRouteOfRoutingTablePayload) *NullableUpdateRouteOfRoutingTablePayload { + return &NullableUpdateRouteOfRoutingTablePayload{value: val, isSet: true} +} + +func (v NullableUpdateRouteOfRoutingTablePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRouteOfRoutingTablePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_routing_table_of_area_payload.go b/services/iaas/v2beta1api/model_update_routing_table_of_area_payload.go new file mode 100644 index 000000000..67d940c37 --- /dev/null +++ b/services/iaas/v2beta1api/model_update_routing_table_of_area_payload.go @@ -0,0 +1,274 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateRoutingTableOfAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateRoutingTableOfAreaPayload{} + +// UpdateRoutingTableOfAreaPayload Object that represents the request body for a routing table update. +type UpdateRoutingTableOfAreaPayload struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // The update config setting for a routing table which allows propagation of dynamic routes to this routing table. + DynamicRoutes *bool `json:"dynamicRoutes,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The update config setting for a routing table which allows installation of automatic system routes for connectivity between projects in the same SNA. + SystemRoutes *bool `json:"systemRoutes,omitempty"` +} + +// NewUpdateRoutingTableOfAreaPayload instantiates a new UpdateRoutingTableOfAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateRoutingTableOfAreaPayload() *UpdateRoutingTableOfAreaPayload { + this := UpdateRoutingTableOfAreaPayload{} + return &this +} + +// NewUpdateRoutingTableOfAreaPayloadWithDefaults instantiates a new UpdateRoutingTableOfAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateRoutingTableOfAreaPayloadWithDefaults() *UpdateRoutingTableOfAreaPayload { + this := UpdateRoutingTableOfAreaPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateRoutingTableOfAreaPayload) SetDescription(v string) { + o.Description = &v +} + +// GetDynamicRoutes returns the DynamicRoutes field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutes() bool { + if o == nil || IsNil(o.DynamicRoutes) { + var ret bool + return ret + } + return *o.DynamicRoutes +} + +// GetDynamicRoutesOk returns a tuple with the DynamicRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetDynamicRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.DynamicRoutes) { + return nil, false + } + return o.DynamicRoutes, true +} + +// HasDynamicRoutes returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasDynamicRoutes() bool { + if o != nil && !IsNil(o.DynamicRoutes) { + return true + } + + return false +} + +// SetDynamicRoutes gets a reference to the given bool and assigns it to the DynamicRoutes field. +func (o *UpdateRoutingTableOfAreaPayload) SetDynamicRoutes(v bool) { + o.DynamicRoutes = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateRoutingTableOfAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateRoutingTableOfAreaPayload) SetName(v string) { + o.Name = &v +} + +// GetSystemRoutes returns the SystemRoutes field value if set, zero value otherwise. +func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutes() bool { + if o == nil || IsNil(o.SystemRoutes) { + var ret bool + return ret + } + return *o.SystemRoutes +} + +// GetSystemRoutesOk returns a tuple with the SystemRoutes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateRoutingTableOfAreaPayload) GetSystemRoutesOk() (*bool, bool) { + if o == nil || IsNil(o.SystemRoutes) { + return nil, false + } + return o.SystemRoutes, true +} + +// HasSystemRoutes returns a boolean if a field has been set. +func (o *UpdateRoutingTableOfAreaPayload) HasSystemRoutes() bool { + if o != nil && !IsNil(o.SystemRoutes) { + return true + } + + return false +} + +// SetSystemRoutes gets a reference to the given bool and assigns it to the SystemRoutes field. +func (o *UpdateRoutingTableOfAreaPayload) SetSystemRoutes(v bool) { + o.SystemRoutes = &v +} + +func (o UpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateRoutingTableOfAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.DynamicRoutes) { + toSerialize["dynamicRoutes"] = o.DynamicRoutes + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.SystemRoutes) { + toSerialize["systemRoutes"] = o.SystemRoutes + } + return toSerialize, nil +} + +type NullableUpdateRoutingTableOfAreaPayload struct { + value *UpdateRoutingTableOfAreaPayload + isSet bool +} + +func (v NullableUpdateRoutingTableOfAreaPayload) Get() *UpdateRoutingTableOfAreaPayload { + return v.value +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) Set(val *UpdateRoutingTableOfAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateRoutingTableOfAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateRoutingTableOfAreaPayload(val *UpdateRoutingTableOfAreaPayload) *NullableUpdateRoutingTableOfAreaPayload { + return &NullableUpdateRoutingTableOfAreaPayload{value: val, isSet: true} +} + +func (v NullableUpdateRoutingTableOfAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateRoutingTableOfAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_server_payload.go b/services/iaas/v2beta1api/model_update_server_payload.go new file mode 100644 index 000000000..965851894 --- /dev/null +++ b/services/iaas/v2beta1api/model_update_server_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateServerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateServerPayload{} + +// UpdateServerPayload Object that represents an update request body of a server. +type UpdateServerPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // Object that represents the metadata of an object. Regex for keys: `^[a-zA-Z0-9-_:. ]{1,255}$`. Regex for values: `^.{0,255}$`. Providing a `null` value for a key will remove that key. + Metadata map[string]interface{} `json:"metadata,omitempty"` + // The name for a Server. + Name *string `json:"name,omitempty" validate:"regexp=^(([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])\\\\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$"` +} + +// NewUpdateServerPayload instantiates a new UpdateServerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateServerPayload() *UpdateServerPayload { + this := UpdateServerPayload{} + return &this +} + +// NewUpdateServerPayloadWithDefaults instantiates a new UpdateServerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateServerPayloadWithDefaults() *UpdateServerPayload { + this := UpdateServerPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateServerPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetMetadata returns the Metadata field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetMetadata() map[string]interface{} { + if o == nil || IsNil(o.Metadata) { + var ret map[string]interface{} + return ret + } + return o.Metadata +} + +// GetMetadataOk returns a tuple with the Metadata field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetMetadataOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Metadata) { + return map[string]interface{}{}, false + } + return o.Metadata, true +} + +// HasMetadata returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasMetadata() bool { + if o != nil && !IsNil(o.Metadata) { + return true + } + + return false +} + +// SetMetadata gets a reference to the given map[string]interface{} and assigns it to the Metadata field. +func (o *UpdateServerPayload) SetMetadata(v map[string]interface{}) { + o.Metadata = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateServerPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateServerPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateServerPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateServerPayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateServerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateServerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Metadata) { + toSerialize["metadata"] = o.Metadata + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateServerPayload struct { + value *UpdateServerPayload + isSet bool +} + +func (v NullableUpdateServerPayload) Get() *UpdateServerPayload { + return v.value +} + +func (v *NullableUpdateServerPayload) Set(val *UpdateServerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateServerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateServerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateServerPayload(val *UpdateServerPayload) *NullableUpdateServerPayload { + return &NullableUpdateServerPayload{value: val, isSet: true} +} + +func (v NullableUpdateServerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateServerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_update_volume_payload.go b/services/iaas/v2beta1api/model_update_volume_payload.go new file mode 100644 index 000000000..5c6cef9e7 --- /dev/null +++ b/services/iaas/v2beta1api/model_update_volume_payload.go @@ -0,0 +1,273 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the UpdateVolumePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateVolumePayload{} + +// UpdateVolumePayload Object that represents an update request body of a volume. +type UpdateVolumePayload struct { + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewUpdateVolumePayload instantiates a new UpdateVolumePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUpdateVolumePayload() *UpdateVolumePayload { + this := UpdateVolumePayload{} + return &this +} + +// NewUpdateVolumePayloadWithDefaults instantiates a new UpdateVolumePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUpdateVolumePayloadWithDefaults() *UpdateVolumePayload { + this := UpdateVolumePayload{} + return &this +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *UpdateVolumePayload) SetBootable(v bool) { + o.Bootable = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *UpdateVolumePayload) SetDescription(v string) { + o.Description = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *UpdateVolumePayload) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *UpdateVolumePayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *UpdateVolumePayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateVolumePayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *UpdateVolumePayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *UpdateVolumePayload) SetName(v string) { + o.Name = &v +} + +func (o UpdateVolumePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UpdateVolumePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableUpdateVolumePayload struct { + value *UpdateVolumePayload + isSet bool +} + +func (v NullableUpdateVolumePayload) Get() *UpdateVolumePayload { + return v.value +} + +func (v *NullableUpdateVolumePayload) Set(val *UpdateVolumePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateVolumePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateVolumePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateVolumePayload(val *UpdateVolumePayload) *NullableUpdateVolumePayload { + return &NullableUpdateVolumePayload{value: val, isSet: true} +} + +func (v NullableUpdateVolumePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateVolumePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_v2beta1_configure_network_area_region_payload.go b/services/iaas/v2beta1api/model_v2beta1_configure_network_area_region_payload.go new file mode 100644 index 000000000..bc3a78a8e --- /dev/null +++ b/services/iaas/v2beta1api/model_v2beta1_configure_network_area_region_payload.go @@ -0,0 +1,162 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the V2beta1ConfigureNetworkAreaRegionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &V2beta1ConfigureNetworkAreaRegionPayload{} + +// V2beta1ConfigureNetworkAreaRegionPayload The basic properties of a regional network area. +type V2beta1ConfigureNetworkAreaRegionPayload struct { + Ipv4 *RegionalAreaIPv4 `json:"ipv4,omitempty"` + // The state of a resource object. Possible values: `CREATING`, `CREATED`, `DELETING`, `DELETED`, `FAILED`, `UPDATED`, `UPDATING`. + Status *string `json:"status,omitempty"` +} + +// NewV2beta1ConfigureNetworkAreaRegionPayload instantiates a new V2beta1ConfigureNetworkAreaRegionPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewV2beta1ConfigureNetworkAreaRegionPayload() *V2beta1ConfigureNetworkAreaRegionPayload { + this := V2beta1ConfigureNetworkAreaRegionPayload{} + return &this +} + +// NewV2beta1ConfigureNetworkAreaRegionPayloadWithDefaults instantiates a new V2beta1ConfigureNetworkAreaRegionPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewV2beta1ConfigureNetworkAreaRegionPayloadWithDefaults() *V2beta1ConfigureNetworkAreaRegionPayload { + this := V2beta1ConfigureNetworkAreaRegionPayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *V2beta1ConfigureNetworkAreaRegionPayload) GetIpv4() RegionalAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret RegionalAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1ConfigureNetworkAreaRegionPayload) GetIpv4Ok() (*RegionalAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *V2beta1ConfigureNetworkAreaRegionPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given RegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *V2beta1ConfigureNetworkAreaRegionPayload) SetIpv4(v RegionalAreaIPv4) { + o.Ipv4 = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *V2beta1ConfigureNetworkAreaRegionPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1ConfigureNetworkAreaRegionPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *V2beta1ConfigureNetworkAreaRegionPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *V2beta1ConfigureNetworkAreaRegionPayload) SetStatus(v string) { + o.Status = &v +} + +func (o V2beta1ConfigureNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o V2beta1ConfigureNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + return toSerialize, nil +} + +type NullableV2beta1ConfigureNetworkAreaRegionPayload struct { + value *V2beta1ConfigureNetworkAreaRegionPayload + isSet bool +} + +func (v NullableV2beta1ConfigureNetworkAreaRegionPayload) Get() *V2beta1ConfigureNetworkAreaRegionPayload { + return v.value +} + +func (v *NullableV2beta1ConfigureNetworkAreaRegionPayload) Set(val *V2beta1ConfigureNetworkAreaRegionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableV2beta1ConfigureNetworkAreaRegionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableV2beta1ConfigureNetworkAreaRegionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV2beta1ConfigureNetworkAreaRegionPayload(val *V2beta1ConfigureNetworkAreaRegionPayload) *NullableV2beta1ConfigureNetworkAreaRegionPayload { + return &NullableV2beta1ConfigureNetworkAreaRegionPayload{value: val, isSet: true} +} + +func (v NullableV2beta1ConfigureNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV2beta1ConfigureNetworkAreaRegionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_v2beta1_create_snapshot_payload.go b/services/iaas/v2beta1api/model_v2beta1_create_snapshot_payload.go new file mode 100644 index 000000000..23ed846e4 --- /dev/null +++ b/services/iaas/v2beta1api/model_v2beta1_create_snapshot_payload.go @@ -0,0 +1,418 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the V2beta1CreateSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &V2beta1CreateSnapshotPayload{} + +// V2beta1CreateSnapshotPayload Object that represents a snapshot. +type V2beta1CreateSnapshotPayload struct { + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId string `json:"volumeId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +type _V2beta1CreateSnapshotPayload V2beta1CreateSnapshotPayload + +// NewV2beta1CreateSnapshotPayload instantiates a new V2beta1CreateSnapshotPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewV2beta1CreateSnapshotPayload(volumeId string) *V2beta1CreateSnapshotPayload { + this := V2beta1CreateSnapshotPayload{} + this.VolumeId = volumeId + return &this +} + +// NewV2beta1CreateSnapshotPayloadWithDefaults instantiates a new V2beta1CreateSnapshotPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewV2beta1CreateSnapshotPayloadWithDefaults() *V2beta1CreateSnapshotPayload { + this := V2beta1CreateSnapshotPayload{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V2beta1CreateSnapshotPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1CreateSnapshotPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V2beta1CreateSnapshotPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V2beta1CreateSnapshotPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V2beta1CreateSnapshotPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1CreateSnapshotPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V2beta1CreateSnapshotPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V2beta1CreateSnapshotPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *V2beta1CreateSnapshotPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1CreateSnapshotPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *V2beta1CreateSnapshotPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *V2beta1CreateSnapshotPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V2beta1CreateSnapshotPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1CreateSnapshotPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V2beta1CreateSnapshotPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V2beta1CreateSnapshotPayload) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V2beta1CreateSnapshotPayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1CreateSnapshotPayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V2beta1CreateSnapshotPayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *V2beta1CreateSnapshotPayload) SetSize(v int64) { + o.Size = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *V2beta1CreateSnapshotPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1CreateSnapshotPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *V2beta1CreateSnapshotPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *V2beta1CreateSnapshotPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *V2beta1CreateSnapshotPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1CreateSnapshotPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *V2beta1CreateSnapshotPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *V2beta1CreateSnapshotPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value +func (o *V2beta1CreateSnapshotPayload) GetVolumeId() string { + if o == nil { + var ret string + return ret + } + + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value +// and a boolean to check if the value has been set. +func (o *V2beta1CreateSnapshotPayload) GetVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.VolumeId, true +} + +// SetVolumeId sets field value +func (o *V2beta1CreateSnapshotPayload) SetVolumeId(v string) { + o.VolumeId = v +} + +func (o V2beta1CreateSnapshotPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o V2beta1CreateSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + toSerialize["volumeId"] = o.VolumeId + return toSerialize, nil +} + +func (o *V2beta1CreateSnapshotPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "volumeId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varV2beta1CreateSnapshotPayload := _V2beta1CreateSnapshotPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varV2beta1CreateSnapshotPayload) + + if err != nil { + return err + } + + *o = V2beta1CreateSnapshotPayload(varV2beta1CreateSnapshotPayload) + + return err +} + +type NullableV2beta1CreateSnapshotPayload struct { + value *V2beta1CreateSnapshotPayload + isSet bool +} + +func (v NullableV2beta1CreateSnapshotPayload) Get() *V2beta1CreateSnapshotPayload { + return v.value +} + +func (v *NullableV2beta1CreateSnapshotPayload) Set(val *V2beta1CreateSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableV2beta1CreateSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableV2beta1CreateSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV2beta1CreateSnapshotPayload(val *V2beta1CreateSnapshotPayload) *NullableV2beta1CreateSnapshotPayload { + return &NullableV2beta1CreateSnapshotPayload{value: val, isSet: true} +} + +func (v NullableV2beta1CreateSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV2beta1CreateSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_v2beta1_update_backup_payload.go b/services/iaas/v2beta1api/model_v2beta1_update_backup_payload.go new file mode 100644 index 000000000..a30a3b9d5 --- /dev/null +++ b/services/iaas/v2beta1api/model_v2beta1_update_backup_payload.go @@ -0,0 +1,497 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" + "time" +) + +// checks if the V2beta1UpdateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &V2beta1UpdateBackupPayload{} + +// V2beta1UpdateBackupPayload Object that represents a backup. +type V2beta1UpdateBackupPayload struct { + // Object that represents an availability zone. + AvailabilityZone *string `json:"availabilityZone,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + // Universally Unique Identifier (UUID). + SnapshotId *string `json:"snapshotId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The status of a backup object. Possible values: `AVAILABLE`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewV2beta1UpdateBackupPayload instantiates a new V2beta1UpdateBackupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewV2beta1UpdateBackupPayload() *V2beta1UpdateBackupPayload { + this := V2beta1UpdateBackupPayload{} + return &this +} + +// NewV2beta1UpdateBackupPayloadWithDefaults instantiates a new V2beta1UpdateBackupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewV2beta1UpdateBackupPayloadWithDefaults() *V2beta1UpdateBackupPayload { + this := V2beta1UpdateBackupPayload{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetAvailabilityZone() string { + if o == nil || IsNil(o.AvailabilityZone) { + var ret string + return ret + } + return *o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetAvailabilityZoneOk() (*string, bool) { + if o == nil || IsNil(o.AvailabilityZone) { + return nil, false + } + return o.AvailabilityZone, true +} + +// HasAvailabilityZone returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasAvailabilityZone() bool { + if o != nil && !IsNil(o.AvailabilityZone) { + return true + } + + return false +} + +// SetAvailabilityZone gets a reference to the given string and assigns it to the AvailabilityZone field. +func (o *V2beta1UpdateBackupPayload) SetAvailabilityZone(v string) { + o.AvailabilityZone = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *V2beta1UpdateBackupPayload) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *V2beta1UpdateBackupPayload) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *V2beta1UpdateBackupPayload) SetId(v string) { + o.Id = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *V2beta1UpdateBackupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V2beta1UpdateBackupPayload) SetName(v string) { + o.Name = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *V2beta1UpdateBackupPayload) SetSize(v int64) { + o.Size = &v +} + +// GetSnapshotId returns the SnapshotId field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetSnapshotId() string { + if o == nil || IsNil(o.SnapshotId) { + var ret string + return ret + } + return *o.SnapshotId +} + +// GetSnapshotIdOk returns a tuple with the SnapshotId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetSnapshotIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotId) { + return nil, false + } + return o.SnapshotId, true +} + +// HasSnapshotId returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasSnapshotId() bool { + if o != nil && !IsNil(o.SnapshotId) { + return true + } + + return false +} + +// SetSnapshotId gets a reference to the given string and assigns it to the SnapshotId field. +func (o *V2beta1UpdateBackupPayload) SetSnapshotId(v string) { + o.SnapshotId = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *V2beta1UpdateBackupPayload) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *V2beta1UpdateBackupPayload) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *V2beta1UpdateBackupPayload) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateBackupPayload) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *V2beta1UpdateBackupPayload) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *V2beta1UpdateBackupPayload) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o V2beta1UpdateBackupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o V2beta1UpdateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AvailabilityZone) { + toSerialize["availabilityZone"] = o.AvailabilityZone + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.SnapshotId) { + toSerialize["snapshotId"] = o.SnapshotId + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableV2beta1UpdateBackupPayload struct { + value *V2beta1UpdateBackupPayload + isSet bool +} + +func (v NullableV2beta1UpdateBackupPayload) Get() *V2beta1UpdateBackupPayload { + return v.value +} + +func (v *NullableV2beta1UpdateBackupPayload) Set(val *V2beta1UpdateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableV2beta1UpdateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableV2beta1UpdateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV2beta1UpdateBackupPayload(val *V2beta1UpdateBackupPayload) *NullableV2beta1UpdateBackupPayload { + return &NullableV2beta1UpdateBackupPayload{value: val, isSet: true} +} + +func (v NullableV2beta1UpdateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV2beta1UpdateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_v2beta1_update_network_area_region_payload.go b/services/iaas/v2beta1api/model_v2beta1_update_network_area_region_payload.go new file mode 100644 index 000000000..8c6108342 --- /dev/null +++ b/services/iaas/v2beta1api/model_v2beta1_update_network_area_region_payload.go @@ -0,0 +1,125 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the V2beta1UpdateNetworkAreaRegionPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &V2beta1UpdateNetworkAreaRegionPayload{} + +// V2beta1UpdateNetworkAreaRegionPayload Object that represents the request body for a regional network area update. +type V2beta1UpdateNetworkAreaRegionPayload struct { + Ipv4 *UpdateRegionalAreaIPv4 `json:"ipv4,omitempty"` +} + +// NewV2beta1UpdateNetworkAreaRegionPayload instantiates a new V2beta1UpdateNetworkAreaRegionPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewV2beta1UpdateNetworkAreaRegionPayload() *V2beta1UpdateNetworkAreaRegionPayload { + this := V2beta1UpdateNetworkAreaRegionPayload{} + return &this +} + +// NewV2beta1UpdateNetworkAreaRegionPayloadWithDefaults instantiates a new V2beta1UpdateNetworkAreaRegionPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewV2beta1UpdateNetworkAreaRegionPayloadWithDefaults() *V2beta1UpdateNetworkAreaRegionPayload { + this := V2beta1UpdateNetworkAreaRegionPayload{} + return &this +} + +// GetIpv4 returns the Ipv4 field value if set, zero value otherwise. +func (o *V2beta1UpdateNetworkAreaRegionPayload) GetIpv4() UpdateRegionalAreaIPv4 { + if o == nil || IsNil(o.Ipv4) { + var ret UpdateRegionalAreaIPv4 + return ret + } + return *o.Ipv4 +} + +// GetIpv4Ok returns a tuple with the Ipv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateNetworkAreaRegionPayload) GetIpv4Ok() (*UpdateRegionalAreaIPv4, bool) { + if o == nil || IsNil(o.Ipv4) { + return nil, false + } + return o.Ipv4, true +} + +// HasIpv4 returns a boolean if a field has been set. +func (o *V2beta1UpdateNetworkAreaRegionPayload) HasIpv4() bool { + if o != nil && !IsNil(o.Ipv4) { + return true + } + + return false +} + +// SetIpv4 gets a reference to the given UpdateRegionalAreaIPv4 and assigns it to the Ipv4 field. +func (o *V2beta1UpdateNetworkAreaRegionPayload) SetIpv4(v UpdateRegionalAreaIPv4) { + o.Ipv4 = &v +} + +func (o V2beta1UpdateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o V2beta1UpdateNetworkAreaRegionPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Ipv4) { + toSerialize["ipv4"] = o.Ipv4 + } + return toSerialize, nil +} + +type NullableV2beta1UpdateNetworkAreaRegionPayload struct { + value *V2beta1UpdateNetworkAreaRegionPayload + isSet bool +} + +func (v NullableV2beta1UpdateNetworkAreaRegionPayload) Get() *V2beta1UpdateNetworkAreaRegionPayload { + return v.value +} + +func (v *NullableV2beta1UpdateNetworkAreaRegionPayload) Set(val *V2beta1UpdateNetworkAreaRegionPayload) { + v.value = val + v.isSet = true +} + +func (v NullableV2beta1UpdateNetworkAreaRegionPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableV2beta1UpdateNetworkAreaRegionPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV2beta1UpdateNetworkAreaRegionPayload(val *V2beta1UpdateNetworkAreaRegionPayload) *NullableV2beta1UpdateNetworkAreaRegionPayload { + return &NullableV2beta1UpdateNetworkAreaRegionPayload{value: val, isSet: true} +} + +func (v NullableV2beta1UpdateNetworkAreaRegionPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV2beta1UpdateNetworkAreaRegionPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_v2beta1_update_route_of_area_payload.go b/services/iaas/v2beta1api/model_v2beta1_update_route_of_area_payload.go new file mode 100644 index 000000000..664a262ed --- /dev/null +++ b/services/iaas/v2beta1api/model_v2beta1_update_route_of_area_payload.go @@ -0,0 +1,126 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the V2beta1UpdateRouteOfAreaPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &V2beta1UpdateRouteOfAreaPayload{} + +// V2beta1UpdateRouteOfAreaPayload Object that represents the request body for a route update. +type V2beta1UpdateRouteOfAreaPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` +} + +// NewV2beta1UpdateRouteOfAreaPayload instantiates a new V2beta1UpdateRouteOfAreaPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewV2beta1UpdateRouteOfAreaPayload() *V2beta1UpdateRouteOfAreaPayload { + this := V2beta1UpdateRouteOfAreaPayload{} + return &this +} + +// NewV2beta1UpdateRouteOfAreaPayloadWithDefaults instantiates a new V2beta1UpdateRouteOfAreaPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewV2beta1UpdateRouteOfAreaPayloadWithDefaults() *V2beta1UpdateRouteOfAreaPayload { + this := V2beta1UpdateRouteOfAreaPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *V2beta1UpdateRouteOfAreaPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateRouteOfAreaPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *V2beta1UpdateRouteOfAreaPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *V2beta1UpdateRouteOfAreaPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +func (o V2beta1UpdateRouteOfAreaPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o V2beta1UpdateRouteOfAreaPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + return toSerialize, nil +} + +type NullableV2beta1UpdateRouteOfAreaPayload struct { + value *V2beta1UpdateRouteOfAreaPayload + isSet bool +} + +func (v NullableV2beta1UpdateRouteOfAreaPayload) Get() *V2beta1UpdateRouteOfAreaPayload { + return v.value +} + +func (v *NullableV2beta1UpdateRouteOfAreaPayload) Set(val *V2beta1UpdateRouteOfAreaPayload) { + v.value = val + v.isSet = true +} + +func (v NullableV2beta1UpdateRouteOfAreaPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableV2beta1UpdateRouteOfAreaPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV2beta1UpdateRouteOfAreaPayload(val *V2beta1UpdateRouteOfAreaPayload) *NullableV2beta1UpdateRouteOfAreaPayload { + return &NullableV2beta1UpdateRouteOfAreaPayload{value: val, isSet: true} +} + +func (v NullableV2beta1UpdateRouteOfAreaPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV2beta1UpdateRouteOfAreaPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_v2beta1_update_security_group_payload.go b/services/iaas/v2beta1api/model_v2beta1_update_security_group_payload.go new file mode 100644 index 000000000..70f0bc1c6 --- /dev/null +++ b/services/iaas/v2beta1api/model_v2beta1_update_security_group_payload.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the V2beta1UpdateSecurityGroupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &V2beta1UpdateSecurityGroupPayload{} + +// V2beta1UpdateSecurityGroupPayload Object that represents an update request body of a security group. +type V2beta1UpdateSecurityGroupPayload struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewV2beta1UpdateSecurityGroupPayload instantiates a new V2beta1UpdateSecurityGroupPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewV2beta1UpdateSecurityGroupPayload() *V2beta1UpdateSecurityGroupPayload { + this := V2beta1UpdateSecurityGroupPayload{} + return &this +} + +// NewV2beta1UpdateSecurityGroupPayloadWithDefaults instantiates a new V2beta1UpdateSecurityGroupPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewV2beta1UpdateSecurityGroupPayloadWithDefaults() *V2beta1UpdateSecurityGroupPayload { + this := V2beta1UpdateSecurityGroupPayload{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *V2beta1UpdateSecurityGroupPayload) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateSecurityGroupPayload) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *V2beta1UpdateSecurityGroupPayload) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *V2beta1UpdateSecurityGroupPayload) SetDescription(v string) { + o.Description = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *V2beta1UpdateSecurityGroupPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateSecurityGroupPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *V2beta1UpdateSecurityGroupPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *V2beta1UpdateSecurityGroupPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V2beta1UpdateSecurityGroupPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateSecurityGroupPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V2beta1UpdateSecurityGroupPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V2beta1UpdateSecurityGroupPayload) SetName(v string) { + o.Name = &v +} + +func (o V2beta1UpdateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o V2beta1UpdateSecurityGroupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableV2beta1UpdateSecurityGroupPayload struct { + value *V2beta1UpdateSecurityGroupPayload + isSet bool +} + +func (v NullableV2beta1UpdateSecurityGroupPayload) Get() *V2beta1UpdateSecurityGroupPayload { + return v.value +} + +func (v *NullableV2beta1UpdateSecurityGroupPayload) Set(val *V2beta1UpdateSecurityGroupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableV2beta1UpdateSecurityGroupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableV2beta1UpdateSecurityGroupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV2beta1UpdateSecurityGroupPayload(val *V2beta1UpdateSecurityGroupPayload) *NullableV2beta1UpdateSecurityGroupPayload { + return &NullableV2beta1UpdateSecurityGroupPayload{value: val, isSet: true} +} + +func (v NullableV2beta1UpdateSecurityGroupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV2beta1UpdateSecurityGroupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_v2beta1_update_snapshot_payload.go b/services/iaas/v2beta1api/model_v2beta1_update_snapshot_payload.go new file mode 100644 index 000000000..7bf59db5a --- /dev/null +++ b/services/iaas/v2beta1api/model_v2beta1_update_snapshot_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the V2beta1UpdateSnapshotPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &V2beta1UpdateSnapshotPayload{} + +// V2beta1UpdateSnapshotPayload Object that represents an update request body of a snapshot. +type V2beta1UpdateSnapshotPayload struct { + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` +} + +// NewV2beta1UpdateSnapshotPayload instantiates a new V2beta1UpdateSnapshotPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewV2beta1UpdateSnapshotPayload() *V2beta1UpdateSnapshotPayload { + this := V2beta1UpdateSnapshotPayload{} + return &this +} + +// NewV2beta1UpdateSnapshotPayloadWithDefaults instantiates a new V2beta1UpdateSnapshotPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewV2beta1UpdateSnapshotPayloadWithDefaults() *V2beta1UpdateSnapshotPayload { + this := V2beta1UpdateSnapshotPayload{} + return &this +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *V2beta1UpdateSnapshotPayload) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateSnapshotPayload) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *V2beta1UpdateSnapshotPayload) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *V2beta1UpdateSnapshotPayload) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *V2beta1UpdateSnapshotPayload) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *V2beta1UpdateSnapshotPayload) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *V2beta1UpdateSnapshotPayload) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *V2beta1UpdateSnapshotPayload) SetName(v string) { + o.Name = &v +} + +func (o V2beta1UpdateSnapshotPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o V2beta1UpdateSnapshotPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + return toSerialize, nil +} + +type NullableV2beta1UpdateSnapshotPayload struct { + value *V2beta1UpdateSnapshotPayload + isSet bool +} + +func (v NullableV2beta1UpdateSnapshotPayload) Get() *V2beta1UpdateSnapshotPayload { + return v.value +} + +func (v *NullableV2beta1UpdateSnapshotPayload) Set(val *V2beta1UpdateSnapshotPayload) { + v.value = val + v.isSet = true +} + +func (v NullableV2beta1UpdateSnapshotPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableV2beta1UpdateSnapshotPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableV2beta1UpdateSnapshotPayload(val *V2beta1UpdateSnapshotPayload) *NullableV2beta1UpdateSnapshotPayload { + return &NullableV2beta1UpdateSnapshotPayload{value: val, isSet: true} +} + +func (v NullableV2beta1UpdateSnapshotPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableV2beta1UpdateSnapshotPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_volume.go b/services/iaas/v2beta1api/model_volume.go new file mode 100644 index 000000000..4235733eb --- /dev/null +++ b/services/iaas/v2beta1api/model_volume.go @@ -0,0 +1,711 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Volume type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Volume{} + +// Volume Object that represents a volume and its parameters. Volumes sized up to 16000GB are supported. +type Volume struct { + // Object that represents an availability zone. + AvailabilityZone string `json:"availabilityZone"` + // Indicates if a volume is bootable. + Bootable *bool `json:"bootable,omitempty"` + // Date-time when resource was created. + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Indicates if a volume is encrypted. + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionParameters *VolumeEncryptionParameter `json:"encryptionParameters,omitempty"` + // Universally Unique Identifier (UUID). + Id *string `json:"id,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + ImageConfig *ImageConfig `json:"imageConfig,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name *string `json:"name,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // The name for a General Object. Matches Names and also UUIDs. + PerformanceClass *string `json:"performanceClass,omitempty" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Size in Gigabyte. + Size *int64 `json:"size,omitempty"` + Source *VolumeSource `json:"source,omitempty"` + // The status of a volume object. Possible values: `ATTACHED`, `ATTACHING`, `AVAILABLE`, `AWAITING-TRANSFER`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `DETACHING`, `DOWNLOADING`, `ERROR`, `ERROR_BACKING-UP`, `ERROR_DELETING`, `ERROR_RESIZING`, `ERROR_RESTORING-BACKUP`, `MAINTENANCE`, `RESERVED`, `RESIZING`, `RESTORING-BACKUP`, `RETYPING`, `UPLOADING`. + Status *string `json:"status,omitempty"` + // Date-time when resource was last updated. + UpdatedAt *time.Time `json:"updatedAt,omitempty"` +} + +type _Volume Volume + +// NewVolume instantiates a new Volume object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolume(availabilityZone string) *Volume { + this := Volume{} + this.AvailabilityZone = availabilityZone + return &this +} + +// NewVolumeWithDefaults instantiates a new Volume object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeWithDefaults() *Volume { + this := Volume{} + return &this +} + +// GetAvailabilityZone returns the AvailabilityZone field value +func (o *Volume) GetAvailabilityZone() string { + if o == nil { + var ret string + return ret + } + + return o.AvailabilityZone +} + +// GetAvailabilityZoneOk returns a tuple with the AvailabilityZone field value +// and a boolean to check if the value has been set. +func (o *Volume) GetAvailabilityZoneOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AvailabilityZone, true +} + +// SetAvailabilityZone sets field value +func (o *Volume) SetAvailabilityZone(v string) { + o.AvailabilityZone = v +} + +// GetBootable returns the Bootable field value if set, zero value otherwise. +func (o *Volume) GetBootable() bool { + if o == nil || IsNil(o.Bootable) { + var ret bool + return ret + } + return *o.Bootable +} + +// GetBootableOk returns a tuple with the Bootable field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetBootableOk() (*bool, bool) { + if o == nil || IsNil(o.Bootable) { + return nil, false + } + return o.Bootable, true +} + +// HasBootable returns a boolean if a field has been set. +func (o *Volume) HasBootable() bool { + if o != nil && !IsNil(o.Bootable) { + return true + } + + return false +} + +// SetBootable gets a reference to the given bool and assigns it to the Bootable field. +func (o *Volume) SetBootable(v bool) { + o.Bootable = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Volume) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Volume) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Volume) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *Volume) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *Volume) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *Volume) SetDescription(v string) { + o.Description = &v +} + +// GetEncrypted returns the Encrypted field value if set, zero value otherwise. +func (o *Volume) GetEncrypted() bool { + if o == nil || IsNil(o.Encrypted) { + var ret bool + return ret + } + return *o.Encrypted +} + +// GetEncryptedOk returns a tuple with the Encrypted field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetEncryptedOk() (*bool, bool) { + if o == nil || IsNil(o.Encrypted) { + return nil, false + } + return o.Encrypted, true +} + +// HasEncrypted returns a boolean if a field has been set. +func (o *Volume) HasEncrypted() bool { + if o != nil && !IsNil(o.Encrypted) { + return true + } + + return false +} + +// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field. +func (o *Volume) SetEncrypted(v bool) { + o.Encrypted = &v +} + +// GetEncryptionParameters returns the EncryptionParameters field value if set, zero value otherwise. +func (o *Volume) GetEncryptionParameters() VolumeEncryptionParameter { + if o == nil || IsNil(o.EncryptionParameters) { + var ret VolumeEncryptionParameter + return ret + } + return *o.EncryptionParameters +} + +// GetEncryptionParametersOk returns a tuple with the EncryptionParameters field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetEncryptionParametersOk() (*VolumeEncryptionParameter, bool) { + if o == nil || IsNil(o.EncryptionParameters) { + return nil, false + } + return o.EncryptionParameters, true +} + +// HasEncryptionParameters returns a boolean if a field has been set. +func (o *Volume) HasEncryptionParameters() bool { + if o != nil && !IsNil(o.EncryptionParameters) { + return true + } + + return false +} + +// SetEncryptionParameters gets a reference to the given VolumeEncryptionParameter and assigns it to the EncryptionParameters field. +func (o *Volume) SetEncryptionParameters(v VolumeEncryptionParameter) { + o.EncryptionParameters = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Volume) GetId() string { + if o == nil || IsNil(o.Id) { + var ret string + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Volume) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *Volume) SetId(v string) { + o.Id = &v +} + +// GetImageConfig returns the ImageConfig field value if set, zero value otherwise. +func (o *Volume) GetImageConfig() ImageConfig { + if o == nil || IsNil(o.ImageConfig) { + var ret ImageConfig + return ret + } + return *o.ImageConfig +} + +// GetImageConfigOk returns a tuple with the ImageConfig field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetImageConfigOk() (*ImageConfig, bool) { + if o == nil || IsNil(o.ImageConfig) { + return nil, false + } + return o.ImageConfig, true +} + +// HasImageConfig returns a boolean if a field has been set. +func (o *Volume) HasImageConfig() bool { + if o != nil && !IsNil(o.ImageConfig) { + return true + } + + return false +} + +// SetImageConfig gets a reference to the given ImageConfig and assigns it to the ImageConfig field. +func (o *Volume) SetImageConfig(v ImageConfig) { + o.ImageConfig = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *Volume) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *Volume) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *Volume) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Volume) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Volume) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Volume) SetName(v string) { + o.Name = &v +} + +// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise. +func (o *Volume) GetPerformanceClass() string { + if o == nil || IsNil(o.PerformanceClass) { + var ret string + return ret + } + return *o.PerformanceClass +} + +// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetPerformanceClassOk() (*string, bool) { + if o == nil || IsNil(o.PerformanceClass) { + return nil, false + } + return o.PerformanceClass, true +} + +// HasPerformanceClass returns a boolean if a field has been set. +func (o *Volume) HasPerformanceClass() bool { + if o != nil && !IsNil(o.PerformanceClass) { + return true + } + + return false +} + +// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field. +func (o *Volume) SetPerformanceClass(v string) { + o.PerformanceClass = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *Volume) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *Volume) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *Volume) SetServerId(v string) { + o.ServerId = &v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Volume) GetSize() int64 { + if o == nil || IsNil(o.Size) { + var ret int64 + return ret + } + return *o.Size +} + +// GetSizeOk returns a tuple with the Size field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Volume) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Volume) SetSize(v int64) { + o.Size = &v +} + +// GetSource returns the Source field value if set, zero value otherwise. +func (o *Volume) GetSource() VolumeSource { + if o == nil || IsNil(o.Source) { + var ret VolumeSource + return ret + } + return *o.Source +} + +// GetSourceOk returns a tuple with the Source field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetSourceOk() (*VolumeSource, bool) { + if o == nil || IsNil(o.Source) { + return nil, false + } + return o.Source, true +} + +// HasSource returns a boolean if a field has been set. +func (o *Volume) HasSource() bool { + if o != nil && !IsNil(o.Source) { + return true + } + + return false +} + +// SetSource gets a reference to the given VolumeSource and assigns it to the Source field. +func (o *Volume) SetSource(v VolumeSource) { + o.Source = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *Volume) GetStatus() string { + if o == nil || IsNil(o.Status) { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Volume) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Volume) SetStatus(v string) { + o.Status = &v +} + +// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise. +func (o *Volume) GetUpdatedAt() time.Time { + if o == nil || IsNil(o.UpdatedAt) { + var ret time.Time + return ret + } + return *o.UpdatedAt +} + +// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Volume) GetUpdatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.UpdatedAt) { + return nil, false + } + return o.UpdatedAt, true +} + +// HasUpdatedAt returns a boolean if a field has been set. +func (o *Volume) HasUpdatedAt() bool { + if o != nil && !IsNil(o.UpdatedAt) { + return true + } + + return false +} + +// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. +func (o *Volume) SetUpdatedAt(v time.Time) { + o.UpdatedAt = &v +} + +func (o Volume) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Volume) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["availabilityZone"] = o.AvailabilityZone + if !IsNil(o.Bootable) { + toSerialize["bootable"] = o.Bootable + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Encrypted) { + toSerialize["encrypted"] = o.Encrypted + } + if !IsNil(o.EncryptionParameters) { + toSerialize["encryptionParameters"] = o.EncryptionParameters + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.ImageConfig) { + toSerialize["imageConfig"] = o.ImageConfig + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.PerformanceClass) { + toSerialize["performanceClass"] = o.PerformanceClass + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Source) { + toSerialize["source"] = o.Source + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.UpdatedAt) { + toSerialize["updatedAt"] = o.UpdatedAt + } + return toSerialize, nil +} + +func (o *Volume) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "availabilityZone", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolume := _Volume{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolume) + + if err != nil { + return err + } + + *o = Volume(varVolume) + + return err +} + +type NullableVolume struct { + value *Volume + isSet bool +} + +func (v NullableVolume) Get() *Volume { + return v.value +} + +func (v *NullableVolume) Set(val *Volume) { + v.value = val + v.isSet = true +} + +func (v NullableVolume) IsSet() bool { + return v.isSet +} + +func (v *NullableVolume) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolume(val *Volume) *NullableVolume { + return &NullableVolume{value: val, isSet: true} +} + +func (v NullableVolume) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolume) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_volume_attachment.go b/services/iaas/v2beta1api/model_volume_attachment.go new file mode 100644 index 000000000..c4748feef --- /dev/null +++ b/services/iaas/v2beta1api/model_volume_attachment.go @@ -0,0 +1,200 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "encoding/json" +) + +// checks if the VolumeAttachment type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeAttachment{} + +// VolumeAttachment Object that represents a Volume attachment to a server. +type VolumeAttachment struct { + // Delete the volume during the termination of the server. Defaults to false. + DeleteOnTermination *bool `json:"deleteOnTermination,omitempty"` + // Universally Unique Identifier (UUID). + ServerId *string `json:"serverId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Universally Unique Identifier (UUID). + VolumeId *string `json:"volumeId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` +} + +// NewVolumeAttachment instantiates a new VolumeAttachment object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeAttachment() *VolumeAttachment { + this := VolumeAttachment{} + return &this +} + +// NewVolumeAttachmentWithDefaults instantiates a new VolumeAttachment object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeAttachmentWithDefaults() *VolumeAttachment { + this := VolumeAttachment{} + return &this +} + +// GetDeleteOnTermination returns the DeleteOnTermination field value if set, zero value otherwise. +func (o *VolumeAttachment) GetDeleteOnTermination() bool { + if o == nil || IsNil(o.DeleteOnTermination) { + var ret bool + return ret + } + return *o.DeleteOnTermination +} + +// GetDeleteOnTerminationOk returns a tuple with the DeleteOnTermination field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetDeleteOnTerminationOk() (*bool, bool) { + if o == nil || IsNil(o.DeleteOnTermination) { + return nil, false + } + return o.DeleteOnTermination, true +} + +// HasDeleteOnTermination returns a boolean if a field has been set. +func (o *VolumeAttachment) HasDeleteOnTermination() bool { + if o != nil && !IsNil(o.DeleteOnTermination) { + return true + } + + return false +} + +// SetDeleteOnTermination gets a reference to the given bool and assigns it to the DeleteOnTermination field. +func (o *VolumeAttachment) SetDeleteOnTermination(v bool) { + o.DeleteOnTermination = &v +} + +// GetServerId returns the ServerId field value if set, zero value otherwise. +func (o *VolumeAttachment) GetServerId() string { + if o == nil || IsNil(o.ServerId) { + var ret string + return ret + } + return *o.ServerId +} + +// GetServerIdOk returns a tuple with the ServerId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetServerIdOk() (*string, bool) { + if o == nil || IsNil(o.ServerId) { + return nil, false + } + return o.ServerId, true +} + +// HasServerId returns a boolean if a field has been set. +func (o *VolumeAttachment) HasServerId() bool { + if o != nil && !IsNil(o.ServerId) { + return true + } + + return false +} + +// SetServerId gets a reference to the given string and assigns it to the ServerId field. +func (o *VolumeAttachment) SetServerId(v string) { + o.ServerId = &v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *VolumeAttachment) GetVolumeId() string { + if o == nil || IsNil(o.VolumeId) { + var ret string + return ret + } + return *o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeAttachment) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *VolumeAttachment) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *VolumeAttachment) SetVolumeId(v string) { + o.VolumeId = &v +} + +func (o VolumeAttachment) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeAttachment) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.DeleteOnTermination) { + toSerialize["deleteOnTermination"] = o.DeleteOnTermination + } + if !IsNil(o.ServerId) { + toSerialize["serverId"] = o.ServerId + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableVolumeAttachment struct { + value *VolumeAttachment + isSet bool +} + +func (v NullableVolumeAttachment) Get() *VolumeAttachment { + return v.value +} + +func (v *NullableVolumeAttachment) Set(val *VolumeAttachment) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeAttachment) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeAttachment) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeAttachment(val *VolumeAttachment) *NullableVolumeAttachment { + return &NullableVolumeAttachment{value: val, isSet: true} +} + +func (v NullableVolumeAttachment) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeAttachment) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_volume_attachment_list_response.go b/services/iaas/v2beta1api/model_volume_attachment_list_response.go new file mode 100644 index 000000000..4b40ac9ac --- /dev/null +++ b/services/iaas/v2beta1api/model_volume_attachment_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeAttachmentListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeAttachmentListResponse{} + +// VolumeAttachmentListResponse Volume attachment list response. +type VolumeAttachmentListResponse struct { + // A list containing Volume attachments of a server. + Items []VolumeAttachment `json:"items"` +} + +type _VolumeAttachmentListResponse VolumeAttachmentListResponse + +// NewVolumeAttachmentListResponse instantiates a new VolumeAttachmentListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeAttachmentListResponse(items []VolumeAttachment) *VolumeAttachmentListResponse { + this := VolumeAttachmentListResponse{} + this.Items = items + return &this +} + +// NewVolumeAttachmentListResponseWithDefaults instantiates a new VolumeAttachmentListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeAttachmentListResponseWithDefaults() *VolumeAttachmentListResponse { + this := VolumeAttachmentListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumeAttachmentListResponse) GetItems() []VolumeAttachment { + if o == nil { + var ret []VolumeAttachment + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumeAttachmentListResponse) GetItemsOk() ([]VolumeAttachment, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumeAttachmentListResponse) SetItems(v []VolumeAttachment) { + o.Items = v +} + +func (o VolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeAttachmentListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumeAttachmentListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeAttachmentListResponse := _VolumeAttachmentListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeAttachmentListResponse) + + if err != nil { + return err + } + + *o = VolumeAttachmentListResponse(varVolumeAttachmentListResponse) + + return err +} + +type NullableVolumeAttachmentListResponse struct { + value *VolumeAttachmentListResponse + isSet bool +} + +func (v NullableVolumeAttachmentListResponse) Get() *VolumeAttachmentListResponse { + return v.value +} + +func (v *NullableVolumeAttachmentListResponse) Set(val *VolumeAttachmentListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeAttachmentListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeAttachmentListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeAttachmentListResponse(val *VolumeAttachmentListResponse) *NullableVolumeAttachmentListResponse { + return &NullableVolumeAttachmentListResponse{value: val, isSet: true} +} + +func (v NullableVolumeAttachmentListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeAttachmentListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_volume_encryption_parameter.go b/services/iaas/v2beta1api/model_volume_encryption_parameter.go new file mode 100644 index 000000000..94d65f0db --- /dev/null +++ b/services/iaas/v2beta1api/model_volume_encryption_parameter.go @@ -0,0 +1,319 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeEncryptionParameter type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeEncryptionParameter{} + +// VolumeEncryptionParameter Parameter to connect to a key-encryption-key within the STACKIT-KMS to create encrypted volumes. If no key_payload is set, a random passphrase is generated, which will be encrypted against the STACKIT-KMS. These parameter never leave the backend again. So these parameters are not in the responses. +type VolumeEncryptionParameter struct { + // UUID of the Key within the STACKIT-KMS to use for the encryption. + KekKeyId string `json:"kekKeyId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Version of the key within the STACKIT-KMS to use for the encryption. + KekKeyVersion int64 `json:"kekKeyVersion"` + // UUID of the keyring where the key is located within the STACKTI-KMS. + KekKeyringId string `json:"kekKeyringId" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Id of the project, where the key in the STACKIT-KMS belongs to, in case the key is located in a different project. By default the same project ID is used, like for the volume itself. Defining a key in a different project is only allowed for privileged internal projects. + KekProjectId *string `json:"kekProjectId,omitempty" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // Optional predefined secret, which will be encrypted against the key-encryption-key within the STACKIT-KMS. If not defined, a random secret will be generated by the API and encrypted against the STACKIT-KMS. If a key-payload is provided here, it must be base64 encoded. + KeyPayload *string `json:"keyPayload,omitempty"` + // Service-Account linked to the Key within the STACKIT-KMS. + ServiceAccount string `json:"serviceAccount" validate:"regexp=[a-z0-9-]+(?:\\\\.[a-z0-9]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?"` +} + +type _VolumeEncryptionParameter VolumeEncryptionParameter + +// NewVolumeEncryptionParameter instantiates a new VolumeEncryptionParameter object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeEncryptionParameter(kekKeyId string, kekKeyVersion int64, kekKeyringId string, serviceAccount string) *VolumeEncryptionParameter { + this := VolumeEncryptionParameter{} + this.KekKeyId = kekKeyId + this.KekKeyVersion = kekKeyVersion + this.KekKeyringId = kekKeyringId + this.ServiceAccount = serviceAccount + return &this +} + +// NewVolumeEncryptionParameterWithDefaults instantiates a new VolumeEncryptionParameter object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeEncryptionParameterWithDefaults() *VolumeEncryptionParameter { + this := VolumeEncryptionParameter{} + return &this +} + +// GetKekKeyId returns the KekKeyId field value +func (o *VolumeEncryptionParameter) GetKekKeyId() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyId +} + +// GetKekKeyIdOk returns a tuple with the KekKeyId field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyId, true +} + +// SetKekKeyId sets field value +func (o *VolumeEncryptionParameter) SetKekKeyId(v string) { + o.KekKeyId = v +} + +// GetKekKeyVersion returns the KekKeyVersion field value +func (o *VolumeEncryptionParameter) GetKekKeyVersion() int64 { + if o == nil { + var ret int64 + return ret + } + + return o.KekKeyVersion +} + +// GetKekKeyVersionOk returns a tuple with the KekKeyVersion field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyVersionOk() (*int64, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyVersion, true +} + +// SetKekKeyVersion sets field value +func (o *VolumeEncryptionParameter) SetKekKeyVersion(v int64) { + o.KekKeyVersion = v +} + +// GetKekKeyringId returns the KekKeyringId field value +func (o *VolumeEncryptionParameter) GetKekKeyringId() string { + if o == nil { + var ret string + return ret + } + + return o.KekKeyringId +} + +// GetKekKeyringIdOk returns a tuple with the KekKeyringId field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekKeyringIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.KekKeyringId, true +} + +// SetKekKeyringId sets field value +func (o *VolumeEncryptionParameter) SetKekKeyringId(v string) { + o.KekKeyringId = v +} + +// GetKekProjectId returns the KekProjectId field value if set, zero value otherwise. +func (o *VolumeEncryptionParameter) GetKekProjectId() string { + if o == nil || IsNil(o.KekProjectId) { + var ret string + return ret + } + return *o.KekProjectId +} + +// GetKekProjectIdOk returns a tuple with the KekProjectId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKekProjectIdOk() (*string, bool) { + if o == nil || IsNil(o.KekProjectId) { + return nil, false + } + return o.KekProjectId, true +} + +// HasKekProjectId returns a boolean if a field has been set. +func (o *VolumeEncryptionParameter) HasKekProjectId() bool { + if o != nil && !IsNil(o.KekProjectId) { + return true + } + + return false +} + +// SetKekProjectId gets a reference to the given string and assigns it to the KekProjectId field. +func (o *VolumeEncryptionParameter) SetKekProjectId(v string) { + o.KekProjectId = &v +} + +// GetKeyPayload returns the KeyPayload field value if set, zero value otherwise. +func (o *VolumeEncryptionParameter) GetKeyPayload() string { + if o == nil || IsNil(o.KeyPayload) { + var ret string + return ret + } + return *o.KeyPayload +} + +// GetKeyPayloadOk returns a tuple with the KeyPayload field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetKeyPayloadOk() (*string, bool) { + if o == nil || IsNil(o.KeyPayload) { + return nil, false + } + return o.KeyPayload, true +} + +// HasKeyPayload returns a boolean if a field has been set. +func (o *VolumeEncryptionParameter) HasKeyPayload() bool { + if o != nil && !IsNil(o.KeyPayload) { + return true + } + + return false +} + +// SetKeyPayload gets a reference to the given string and assigns it to the KeyPayload field. +func (o *VolumeEncryptionParameter) SetKeyPayload(v string) { + o.KeyPayload = &v +} + +// GetServiceAccount returns the ServiceAccount field value +func (o *VolumeEncryptionParameter) GetServiceAccount() string { + if o == nil { + var ret string + return ret + } + + return o.ServiceAccount +} + +// GetServiceAccountOk returns a tuple with the ServiceAccount field value +// and a boolean to check if the value has been set. +func (o *VolumeEncryptionParameter) GetServiceAccountOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ServiceAccount, true +} + +// SetServiceAccount sets field value +func (o *VolumeEncryptionParameter) SetServiceAccount(v string) { + o.ServiceAccount = v +} + +func (o VolumeEncryptionParameter) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeEncryptionParameter) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["kekKeyId"] = o.KekKeyId + toSerialize["kekKeyVersion"] = o.KekKeyVersion + toSerialize["kekKeyringId"] = o.KekKeyringId + if !IsNil(o.KekProjectId) { + toSerialize["kekProjectId"] = o.KekProjectId + } + if !IsNil(o.KeyPayload) { + toSerialize["keyPayload"] = o.KeyPayload + } + toSerialize["serviceAccount"] = o.ServiceAccount + return toSerialize, nil +} + +func (o *VolumeEncryptionParameter) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "kekKeyId", + "kekKeyVersion", + "kekKeyringId", + "serviceAccount", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeEncryptionParameter := _VolumeEncryptionParameter{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeEncryptionParameter) + + if err != nil { + return err + } + + *o = VolumeEncryptionParameter(varVolumeEncryptionParameter) + + return err +} + +type NullableVolumeEncryptionParameter struct { + value *VolumeEncryptionParameter + isSet bool +} + +func (v NullableVolumeEncryptionParameter) Get() *VolumeEncryptionParameter { + return v.value +} + +func (v *NullableVolumeEncryptionParameter) Set(val *VolumeEncryptionParameter) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeEncryptionParameter) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeEncryptionParameter) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeEncryptionParameter(val *VolumeEncryptionParameter) *NullableVolumeEncryptionParameter { + return &NullableVolumeEncryptionParameter{value: val, isSet: true} +} + +func (v NullableVolumeEncryptionParameter) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeEncryptionParameter) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_volume_list_response.go b/services/iaas/v2beta1api/model_volume_list_response.go new file mode 100644 index 000000000..06a84af64 --- /dev/null +++ b/services/iaas/v2beta1api/model_volume_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeListResponse{} + +// VolumeListResponse Volume list response. +type VolumeListResponse struct { + // A list containing volume objects. + Items []Volume `json:"items"` +} + +type _VolumeListResponse VolumeListResponse + +// NewVolumeListResponse instantiates a new VolumeListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeListResponse(items []Volume) *VolumeListResponse { + this := VolumeListResponse{} + this.Items = items + return &this +} + +// NewVolumeListResponseWithDefaults instantiates a new VolumeListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeListResponseWithDefaults() *VolumeListResponse { + this := VolumeListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumeListResponse) GetItems() []Volume { + if o == nil { + var ret []Volume + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumeListResponse) GetItemsOk() ([]Volume, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumeListResponse) SetItems(v []Volume) { + o.Items = v +} + +func (o VolumeListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumeListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeListResponse := _VolumeListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeListResponse) + + if err != nil { + return err + } + + *o = VolumeListResponse(varVolumeListResponse) + + return err +} + +type NullableVolumeListResponse struct { + value *VolumeListResponse + isSet bool +} + +func (v NullableVolumeListResponse) Get() *VolumeListResponse { + return v.value +} + +func (v *NullableVolumeListResponse) Set(val *VolumeListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeListResponse(val *VolumeListResponse) *NullableVolumeListResponse { + return &NullableVolumeListResponse{value: val, isSet: true} +} + +func (v NullableVolumeListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_volume_performance_class.go b/services/iaas/v2beta1api/model_volume_performance_class.go new file mode 100644 index 000000000..71f8cafae --- /dev/null +++ b/services/iaas/v2beta1api/model_volume_performance_class.go @@ -0,0 +1,306 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumePerformanceClass type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumePerformanceClass{} + +// VolumePerformanceClass Object that represents a Volume performance class. +type VolumePerformanceClass struct { + // Description Object. Allows string up to 255 Characters. + Description *string `json:"description,omitempty"` + // Input/Output Operations per second. + Iops *int64 `json:"iops,omitempty"` + // 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. + Labels map[string]interface{} `json:"labels,omitempty"` + // The name for a General Object. Matches Names and also UUIDs. + Name string `json:"name" validate:"regexp=^[A-Za-z0-9]+([ \\/._-]*[A-Za-z0-9]+)*$"` + // Throughput in Megabyte per second. + Throughput *int64 `json:"throughput,omitempty"` +} + +type _VolumePerformanceClass VolumePerformanceClass + +// NewVolumePerformanceClass instantiates a new VolumePerformanceClass object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumePerformanceClass(name string) *VolumePerformanceClass { + this := VolumePerformanceClass{} + this.Name = name + return &this +} + +// NewVolumePerformanceClassWithDefaults instantiates a new VolumePerformanceClass object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumePerformanceClassWithDefaults() *VolumePerformanceClass { + this := VolumePerformanceClass{} + return &this +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *VolumePerformanceClass) SetDescription(v string) { + o.Description = &v +} + +// GetIops returns the Iops field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetIops() int64 { + if o == nil || IsNil(o.Iops) { + var ret int64 + return ret + } + return *o.Iops +} + +// GetIopsOk returns a tuple with the Iops field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetIopsOk() (*int64, bool) { + if o == nil || IsNil(o.Iops) { + return nil, false + } + return o.Iops, true +} + +// HasIops returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasIops() bool { + if o != nil && !IsNil(o.Iops) { + return true + } + + return false +} + +// SetIops gets a reference to the given int64 and assigns it to the Iops field. +func (o *VolumePerformanceClass) SetIops(v int64) { + o.Iops = &v +} + +// GetLabels returns the Labels field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetLabels() map[string]interface{} { + if o == nil || IsNil(o.Labels) { + var ret map[string]interface{} + return ret + } + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetLabelsOk() (map[string]interface{}, bool) { + if o == nil || IsNil(o.Labels) { + return map[string]interface{}{}, false + } + return o.Labels, true +} + +// HasLabels returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasLabels() bool { + if o != nil && !IsNil(o.Labels) { + return true + } + + return false +} + +// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field. +func (o *VolumePerformanceClass) SetLabels(v map[string]interface{}) { + o.Labels = v +} + +// GetName returns the Name field value +func (o *VolumePerformanceClass) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *VolumePerformanceClass) SetName(v string) { + o.Name = v +} + +// GetThroughput returns the Throughput field value if set, zero value otherwise. +func (o *VolumePerformanceClass) GetThroughput() int64 { + if o == nil || IsNil(o.Throughput) { + var ret int64 + return ret + } + return *o.Throughput +} + +// GetThroughputOk returns a tuple with the Throughput field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClass) GetThroughputOk() (*int64, bool) { + if o == nil || IsNil(o.Throughput) { + return nil, false + } + return o.Throughput, true +} + +// HasThroughput returns a boolean if a field has been set. +func (o *VolumePerformanceClass) HasThroughput() bool { + if o != nil && !IsNil(o.Throughput) { + return true + } + + return false +} + +// SetThroughput gets a reference to the given int64 and assigns it to the Throughput field. +func (o *VolumePerformanceClass) SetThroughput(v int64) { + o.Throughput = &v +} + +func (o VolumePerformanceClass) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumePerformanceClass) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Iops) { + toSerialize["iops"] = o.Iops + } + if !IsNil(o.Labels) { + toSerialize["labels"] = o.Labels + } + toSerialize["name"] = o.Name + if !IsNil(o.Throughput) { + toSerialize["throughput"] = o.Throughput + } + return toSerialize, nil +} + +func (o *VolumePerformanceClass) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumePerformanceClass := _VolumePerformanceClass{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumePerformanceClass) + + if err != nil { + return err + } + + *o = VolumePerformanceClass(varVolumePerformanceClass) + + return err +} + +type NullableVolumePerformanceClass struct { + value *VolumePerformanceClass + isSet bool +} + +func (v NullableVolumePerformanceClass) Get() *VolumePerformanceClass { + return v.value +} + +func (v *NullableVolumePerformanceClass) Set(val *VolumePerformanceClass) { + v.value = val + v.isSet = true +} + +func (v NullableVolumePerformanceClass) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumePerformanceClass) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumePerformanceClass(val *VolumePerformanceClass) *NullableVolumePerformanceClass { + return &NullableVolumePerformanceClass{value: val, isSet: true} +} + +func (v NullableVolumePerformanceClass) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumePerformanceClass) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_volume_performance_class_list_response.go b/services/iaas/v2beta1api/model_volume_performance_class_list_response.go new file mode 100644 index 000000000..c93d1321d --- /dev/null +++ b/services/iaas/v2beta1api/model_volume_performance_class_list_response.go @@ -0,0 +1,158 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumePerformanceClassListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumePerformanceClassListResponse{} + +// VolumePerformanceClassListResponse Volume performance class list response. +type VolumePerformanceClassListResponse struct { + // A list containing Volume performance classes. + Items []VolumePerformanceClass `json:"items"` +} + +type _VolumePerformanceClassListResponse VolumePerformanceClassListResponse + +// NewVolumePerformanceClassListResponse instantiates a new VolumePerformanceClassListResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumePerformanceClassListResponse(items []VolumePerformanceClass) *VolumePerformanceClassListResponse { + this := VolumePerformanceClassListResponse{} + this.Items = items + return &this +} + +// NewVolumePerformanceClassListResponseWithDefaults instantiates a new VolumePerformanceClassListResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumePerformanceClassListResponseWithDefaults() *VolumePerformanceClassListResponse { + this := VolumePerformanceClassListResponse{} + return &this +} + +// GetItems returns the Items field value +func (o *VolumePerformanceClassListResponse) GetItems() []VolumePerformanceClass { + if o == nil { + var ret []VolumePerformanceClass + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *VolumePerformanceClassListResponse) GetItemsOk() ([]VolumePerformanceClass, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *VolumePerformanceClassListResponse) SetItems(v []VolumePerformanceClass) { + o.Items = v +} + +func (o VolumePerformanceClassListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumePerformanceClassListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *VolumePerformanceClassListResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumePerformanceClassListResponse := _VolumePerformanceClassListResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumePerformanceClassListResponse) + + if err != nil { + return err + } + + *o = VolumePerformanceClassListResponse(varVolumePerformanceClassListResponse) + + return err +} + +type NullableVolumePerformanceClassListResponse struct { + value *VolumePerformanceClassListResponse + isSet bool +} + +func (v NullableVolumePerformanceClassListResponse) Get() *VolumePerformanceClassListResponse { + return v.value +} + +func (v *NullableVolumePerformanceClassListResponse) Set(val *VolumePerformanceClassListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableVolumePerformanceClassListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumePerformanceClassListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumePerformanceClassListResponse(val *VolumePerformanceClassListResponse) *NullableVolumePerformanceClassListResponse { + return &NullableVolumePerformanceClassListResponse{value: val, isSet: true} +} + +func (v NullableVolumePerformanceClassListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumePerformanceClassListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/model_volume_source.go b/services/iaas/v2beta1api/model_volume_source.go new file mode 100644 index 000000000..926a44758 --- /dev/null +++ b/services/iaas/v2beta1api/model_volume_source.go @@ -0,0 +1,187 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the VolumeSource type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &VolumeSource{} + +// VolumeSource The source object of a volume. +type VolumeSource struct { + // Universally Unique Identifier (UUID). + Id string `json:"id" validate:"regexp=^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"` + // The source types of a volume. Possible values: `image`, `volume`, `snapshot`, `backup`. + Type string `json:"type"` +} + +type _VolumeSource VolumeSource + +// NewVolumeSource instantiates a new VolumeSource object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewVolumeSource(id string, types string) *VolumeSource { + this := VolumeSource{} + this.Id = id + this.Type = types + return &this +} + +// NewVolumeSourceWithDefaults instantiates a new VolumeSource object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewVolumeSourceWithDefaults() *VolumeSource { + this := VolumeSource{} + return &this +} + +// GetId returns the Id field value +func (o *VolumeSource) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *VolumeSource) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *VolumeSource) SetId(v string) { + o.Id = v +} + +// GetType returns the Type field value +func (o *VolumeSource) GetType() string { + if o == nil { + var ret string + return ret + } + + return o.Type +} + +// GetTypeOk returns a tuple with the Type field value +// and a boolean to check if the value has been set. +func (o *VolumeSource) GetTypeOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Type, true +} + +// SetType sets field value +func (o *VolumeSource) SetType(v string) { + o.Type = v +} + +func (o VolumeSource) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o VolumeSource) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + toSerialize["type"] = o.Type + return toSerialize, nil +} + +func (o *VolumeSource) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + "type", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varVolumeSource := _VolumeSource{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varVolumeSource) + + if err != nil { + return err + } + + *o = VolumeSource(varVolumeSource) + + return err +} + +type NullableVolumeSource struct { + value *VolumeSource + isSet bool +} + +func (v NullableVolumeSource) Get() *VolumeSource { + return v.value +} + +func (v *NullableVolumeSource) Set(val *VolumeSource) { + v.value = val + v.isSet = true +} + +func (v NullableVolumeSource) IsSet() bool { + return v.isSet +} + +func (v *NullableVolumeSource) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableVolumeSource(val *VolumeSource) *NullableVolumeSource { + return &NullableVolumeSource{value: val, isSet: true} +} + +func (v NullableVolumeSource) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableVolumeSource) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/iaas/v2beta1api/response.go b/services/iaas/v2beta1api/response.go new file mode 100644 index 000000000..ce3856991 --- /dev/null +++ b/services/iaas/v2beta1api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/iaas/v2beta1api/utils.go b/services/iaas/v2beta1api/utils.go new file mode 100644 index 000000000..9d2127e20 --- /dev/null +++ b/services/iaas/v2beta1api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT IaaS API + +This API allows you to create and modify IaaS resources. + +API version: 2beta1 +Contact: stackit-iaas@mail.schwarz +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2beta1api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/iaas/wait/deprecation.go b/services/iaas/wait/deprecation.go new file mode 100644 index 000000000..58f184c09 --- /dev/null +++ b/services/iaas/wait/deprecation.go @@ -0,0 +1,2 @@ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package wait